From b7a34afcfb8f1c0eed4615f5015ee5e2497d83ff Mon Sep 17 00:00:00 2001 From: "pieter@protobi.com" Date: Mon, 3 Apr 2023 11:23:44 -0400 Subject: [PATCH] Add typeOID '1082':'date' --- .idea/.gitignore | 5 + .idea/modules.xml | 8 + .idea/node-vertica.iml | 12 + .idea/vcs.xml | 6 + lib/authentication.js | 2 +- lib/backend_message.js | 96 ++++---- lib/buffer.js | 2 +- lib/connection.js | 46 ++-- lib/errors.js | 42 ++-- lib/frontend_message.js | 164 ++++++------- lib/query.js | 505 ++++++++++++++++++++-------------------- lib/query.js.map | 10 - lib/quoting.js | 14 +- lib/resultset.js | 2 +- lib/starttls.js | 2 +- lib/types.js | 3 +- lib/vertica.js | 2 +- package-lock.json | 343 +++++++++++++++++++++++++++ package.json | 2 +- src/types.coffee | 1 + 20 files changed, 814 insertions(+), 453 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/modules.xml create mode 100644 .idea/node-vertica.iml create mode 100644 .idea/vcs.xml delete mode 100644 lib/query.js.map create mode 100644 package-lock.json diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..7db7485 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/node-vertica.iml b/.idea/node-vertica.iml new file mode 100644 index 0000000..0c8867d --- /dev/null +++ b/.idea/node-vertica.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/lib/authentication.js b/lib/authentication.js index 4ee5647..564533f 100644 --- a/lib/authentication.js +++ b/lib/authentication.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.11.1 +// Generated by CoffeeScript 1.9.0 var Authentication; Authentication = { diff --git a/lib/backend_message.js b/lib/backend_message.js index 002f701..f6fb41b 100644 --- a/lib/backend_message.js +++ b/lib/backend_message.js @@ -1,7 +1,7 @@ -// Generated by CoffeeScript 1.11.1 +// Generated by CoffeeScript 1.9.0 var AuthenticationMethods, BackendMessage, messageClass, name, typeOIDs, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + __hasProp = {}.hasOwnProperty; AuthenticationMethods = require('./authentication').methods; @@ -20,8 +20,8 @@ BackendMessage = (function() { })(); -BackendMessage.Authentication = (function(superClass) { - extend(Authentication, superClass); +BackendMessage.Authentication = (function(_super) { + __extends(Authentication, _super); function Authentication() { return Authentication.__super__.constructor.apply(this, arguments); @@ -42,8 +42,8 @@ BackendMessage.Authentication = (function(superClass) { })(BackendMessage); -BackendMessage.BackendKeyData = (function(superClass) { - extend(BackendKeyData, superClass); +BackendMessage.BackendKeyData = (function(_super) { + __extends(BackendKeyData, _super); function BackendKeyData() { return BackendKeyData.__super__.constructor.apply(this, arguments); @@ -60,8 +60,8 @@ BackendMessage.BackendKeyData = (function(superClass) { })(BackendMessage); -BackendMessage.ParameterStatus = (function(superClass) { - extend(ParameterStatus, superClass); +BackendMessage.ParameterStatus = (function(_super) { + __extends(ParameterStatus, _super); function ParameterStatus() { return ParameterStatus.__super__.constructor.apply(this, arguments); @@ -78,8 +78,8 @@ BackendMessage.ParameterStatus = (function(superClass) { })(BackendMessage); -BackendMessage.NotificationResponse = (function(superClass) { - extend(NotificationResponse, superClass); +BackendMessage.NotificationResponse = (function(_super) { + __extends(NotificationResponse, _super); function NotificationResponse() { return NotificationResponse.__super__.constructor.apply(this, arguments); @@ -97,8 +97,8 @@ BackendMessage.NotificationResponse = (function(superClass) { })(BackendMessage); -BackendMessage.EmptyQueryResponse = (function(superClass) { - extend(EmptyQueryResponse, superClass); +BackendMessage.EmptyQueryResponse = (function(_super) { + __extends(EmptyQueryResponse, _super); function EmptyQueryResponse() { return EmptyQueryResponse.__super__.constructor.apply(this, arguments); @@ -110,8 +110,8 @@ BackendMessage.EmptyQueryResponse = (function(superClass) { })(BackendMessage); -BackendMessage.RowDescription = (function(superClass) { - extend(RowDescription, superClass); +BackendMessage.RowDescription = (function(_super) { + __extends(RowDescription, _super); function RowDescription() { return RowDescription.__super__.constructor.apply(this, arguments); @@ -120,11 +120,11 @@ BackendMessage.RowDescription = (function(superClass) { RowDescription.prototype.typeId = 84; RowDescription.prototype.read = function(buffer) { - var fieldDescriptor, formatCode, i, j, modifier, name, numberOfFields, pos, ref, size, tableFieldIndex, tableOID, typeOID; + var fieldDescriptor, formatCode, i, modifier, name, numberOfFields, pos, size, tableFieldIndex, tableOID, typeOID, _i; numberOfFields = buffer.readUInt16BE(0); pos = 2; this.columns = []; - for (i = j = 0, ref = numberOfFields; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { + for (i = _i = 0; 0 <= numberOfFields ? _i < numberOfFields : _i > numberOfFields; i = 0 <= numberOfFields ? ++_i : --_i) { name = buffer.readZeroTerminatedString(pos); pos += Buffer.byteLength(name) + 1; tableOID = buffer.readUInt32BE(pos); @@ -158,8 +158,8 @@ BackendMessage.RowDescription = (function(superClass) { })(BackendMessage); -BackendMessage.DataRow = (function(superClass) { - extend(DataRow, superClass); +BackendMessage.DataRow = (function(_super) { + __extends(DataRow, _super); function DataRow() { return DataRow.__super__.constructor.apply(this, arguments); @@ -168,11 +168,11 @@ BackendMessage.DataRow = (function(superClass) { DataRow.prototype.typeId = 68; DataRow.prototype.read = function(buffer) { - var data, i, j, length, numberOfFields, pos, ref; + var data, i, length, numberOfFields, pos, _i; numberOfFields = buffer.readUInt16BE(0); pos = 2; this.values = []; - for (i = j = 0, ref = numberOfFields; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { + for (i = _i = 0; 0 <= numberOfFields ? _i < numberOfFields : _i > numberOfFields; i = 0 <= numberOfFields ? ++_i : --_i) { length = buffer.readUInt32BE(pos); pos += 4; if (length === 4294967295) { @@ -190,8 +190,8 @@ BackendMessage.DataRow = (function(superClass) { })(BackendMessage); -BackendMessage.CommandComplete = (function(superClass) { - extend(CommandComplete, superClass); +BackendMessage.CommandComplete = (function(_super) { + __extends(CommandComplete, _super); function CommandComplete() { return CommandComplete.__super__.constructor.apply(this, arguments); @@ -207,8 +207,8 @@ BackendMessage.CommandComplete = (function(superClass) { })(BackendMessage); -BackendMessage.CloseComplete = (function(superClass) { - extend(CloseComplete, superClass); +BackendMessage.CloseComplete = (function(_super) { + __extends(CloseComplete, _super); function CloseComplete() { return CloseComplete.__super__.constructor.apply(this, arguments); @@ -220,8 +220,8 @@ BackendMessage.CloseComplete = (function(superClass) { })(BackendMessage); -BackendMessage.ParameterDescription = (function(superClass) { - extend(ParameterDescription, superClass); +BackendMessage.ParameterDescription = (function(_super) { + __extends(ParameterDescription, _super); function ParameterDescription() { return ParameterDescription.__super__.constructor.apply(this, arguments); @@ -233,12 +233,12 @@ BackendMessage.ParameterDescription = (function(superClass) { var count, i; count = buffer.readUInt16BE(0); return this.parameterTypes = (function() { - var j, ref, results; - results = []; - for (i = j = 0, ref = count; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { - results.push(buffer.readUInt32BE(2 + i * 4)); + var _i, _results; + _results = []; + for (i = _i = 0; 0 <= count ? _i < count : _i > count; i = 0 <= count ? ++_i : --_i) { + _results.push(buffer.readUInt32BE(2 + i * 4)); } - return results; + return _results; })(); }; @@ -246,8 +246,8 @@ BackendMessage.ParameterDescription = (function(superClass) { })(BackendMessage); -BackendMessage.ParseComplete = (function(superClass) { - extend(ParseComplete, superClass); +BackendMessage.ParseComplete = (function(_super) { + __extends(ParseComplete, _super); function ParseComplete() { return ParseComplete.__super__.constructor.apply(this, arguments); @@ -259,8 +259,8 @@ BackendMessage.ParseComplete = (function(superClass) { })(BackendMessage); -BackendMessage.ErrorResponse = (function(superClass) { - extend(ErrorResponse, superClass); +BackendMessage.ErrorResponse = (function(_super) { + __extends(ErrorResponse, _super); function ErrorResponse() { return ErrorResponse.__super__.constructor.apply(this, arguments); @@ -302,8 +302,8 @@ BackendMessage.ErrorResponse = (function(superClass) { })(BackendMessage); -BackendMessage.NoticeResponse = (function(superClass) { - extend(NoticeResponse, superClass); +BackendMessage.NoticeResponse = (function(_super) { + __extends(NoticeResponse, _super); function NoticeResponse() { return NoticeResponse.__super__.constructor.apply(this, arguments); @@ -315,8 +315,8 @@ BackendMessage.NoticeResponse = (function(superClass) { })(BackendMessage.ErrorResponse); -BackendMessage.ReadyForQuery = (function(superClass) { - extend(ReadyForQuery, superClass); +BackendMessage.ReadyForQuery = (function(_super) { + __extends(ReadyForQuery, _super); function ReadyForQuery() { return ReadyForQuery.__super__.constructor.apply(this, arguments); @@ -332,8 +332,8 @@ BackendMessage.ReadyForQuery = (function(superClass) { })(BackendMessage); -BackendMessage.CopyFileResponse = (function(superClass) { - extend(CopyFileResponse, superClass); +BackendMessage.CopyFileResponse = (function(_super) { + __extends(CopyFileResponse, _super); function CopyFileResponse() { return CopyFileResponse.__super__.constructor.apply(this, arguments); @@ -342,11 +342,11 @@ BackendMessage.CopyFileResponse = (function(superClass) { CopyFileResponse.prototype.typeId = 70; CopyFileResponse.prototype.read = function(buffer) { - var filename, i, j, last, numberOfFiles, pos, ref; + var filename, i, last, numberOfFiles, pos, _i; this.files = []; numberOfFiles = buffer.readUInt16BE(0); pos = 2; - for (i = j = 0, ref = numberOfFiles; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { + for (i = _i = 0; 0 <= numberOfFiles ? _i < numberOfFiles : _i > numberOfFiles; i = 0 <= numberOfFiles ? ++_i : --_i) { filename = buffer.readZeroTerminatedString(pos); this.files.push(filename); pos += filename.length + 1; @@ -358,8 +358,8 @@ BackendMessage.CopyFileResponse = (function(superClass) { })(BackendMessage); -BackendMessage.CopyInResponse = (function(superClass) { - extend(CopyInResponse, superClass); +BackendMessage.CopyInResponse = (function(_super) { + __extends(CopyInResponse, _super); function CopyInResponse() { return CopyInResponse.__super__.constructor.apply(this, arguments); @@ -368,12 +368,12 @@ BackendMessage.CopyInResponse = (function(superClass) { CopyInResponse.prototype.typeId = 71; CopyInResponse.prototype.read = function(buffer) { - var i, j, numberOfFields, pos, ref; + var i, numberOfFields, pos, _i; this.globalFormatType = buffer.readUInt8(0); this.fieldFormatTypes = []; numberOfFields = buffer.readUInt16BE(1); pos = 3; - for (i = j = 0, ref = numberOfFields; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { + for (i = _i = 0; 0 <= numberOfFields ? _i < numberOfFields : _i > numberOfFields; i = 0 <= numberOfFields ? ++_i : --_i) { this.fieldFormatTypes.push(buffer.readUInt8(pos)); pos += 1; } diff --git a/lib/buffer.js b/lib/buffer.js index c10cbf2..997a01e 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.11.1 +// Generated by CoffeeScript 1.9.0 var Buffer; Buffer = require('buffer').Buffer; diff --git a/lib/connection.js b/lib/connection.js index d3ec29c..81fd16d 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -1,7 +1,7 @@ -// Generated by CoffeeScript 1.11.1 +// Generated by CoffeeScript 1.9.0 var Authentication, BackendMessage, Connection, EventEmitter, FrontendMessage, Query, errors, net, util, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + __hasProp = {}.hasOwnProperty; util = require('util'); @@ -19,23 +19,23 @@ Query = require('./query'); errors = require('./errors'); -Connection = (function(superClass) { - extend(Connection, superClass); +Connection = (function(_super) { + __extends(Connection, _super); - function Connection(connectionOptions) { - var base, base1, base2, base3; - this.connectionOptions = connectionOptions; - if ((base = this.connectionOptions).host == null) { - base.host = 'localhost'; + function Connection(_at_connectionOptions) { + var _base, _base1, _base2, _base3; + this.connectionOptions = _at_connectionOptions; + if ((_base = this.connectionOptions).host == null) { + _base.host = 'localhost'; } - if ((base1 = this.connectionOptions).port == null) { - base1.port = 5433; + if ((_base1 = this.connectionOptions).port == null) { + _base1.port = 5433; } - if ((base2 = this.connectionOptions).ssl == null) { - base2.ssl = 'optional'; + if ((_base2 = this.connectionOptions).ssl == null) { + _base2.ssl = 'optional'; } - if ((base3 = this.connectionOptions).keepAlive == null) { - base3.keepAlive = false; + if ((_base3 = this.connectionOptions).keepAlive == null) { + _base3.keepAlive = false; } this.connected = false; this.busy = true; @@ -226,8 +226,8 @@ Connection = (function(superClass) { })(this)); this.on('BackendKeyData', (function(_this) { return function(msg) { - var ref; - return ref = [msg.pid, msg.key], _this.pid = ref[0], _this.key = ref[1], ref; + var _ref; + return _ref = [msg.pid, msg.key], _this.pid = _ref[0], _this.key = _ref[1], _ref; }; })(this)); return this.on('ReadyForQuery', (function(_this) { @@ -240,7 +240,7 @@ Connection = (function(superClass) { }; Connection.prototype._initializeConnection = function() { - var chain, i, initializer, initializers, len; + var chain, initializer, initializers, _i, _len; initializers = []; if (!this.connectionOptions.skipInitialization) { if (this.connectionOptions.interruptible) { @@ -260,8 +260,8 @@ Connection = (function(superClass) { } } chain = this._initializationSuccess.bind(this); - for (i = 0, len = initializers.length; i < len; i++) { - initializer = initializers[i]; + for (_i = 0, _len = initializers.length; _i < _len; _i++) { + initializer = initializers[_i]; chain = initializer.bind(this, chain, this._initializationFailure.bind(this)); } return chain(); @@ -384,8 +384,8 @@ Connection = (function(superClass) { }; Connection.prototype._onError = function(err) { - var error, ref; - error = new errors.ConnectionError((ref = err.message) != null ? ref : err.toString()); + var error, _ref; + error = new errors.ConnectionError((_ref = err.message) != null ? _ref : err.toString()); if (this.currentJob) { this.currentJob.onConnectionError(error); } diff --git a/lib/errors.js b/lib/errors.js index 00225c5..52183bb 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -1,12 +1,12 @@ -// Generated by CoffeeScript 1.11.1 -var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; +// Generated by CoffeeScript 1.9.0 +var __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + __hasProp = {}.hasOwnProperty; -exports.VerticaError = (function(superClass) { - extend(VerticaError, superClass); +exports.VerticaError = (function(_super) { + __extends(VerticaError, _super); - function VerticaError(message) { - this.message = message; + function VerticaError(_at_message) { + this.message = _at_message; VerticaError.__super__.constructor.call(this, this.message); } @@ -14,8 +14,8 @@ exports.VerticaError = (function(superClass) { })(Error); -exports.ConnectionError = (function(superClass) { - extend(ConnectionError, superClass); +exports.ConnectionError = (function(_super) { + __extends(ConnectionError, _super); function ConnectionError() { return ConnectionError.__super__.constructor.apply(this, arguments); @@ -25,8 +25,8 @@ exports.ConnectionError = (function(superClass) { })(exports.VerticaError); -exports.ConnectionErrorResponse = (function(superClass) { - extend(ConnectionErrorResponse, superClass); +exports.ConnectionErrorResponse = (function(_super) { + __extends(ConnectionErrorResponse, _super); function ConnectionErrorResponse(msg) { ConnectionErrorResponse.__super__.constructor.call(this, msg.information['Message']); @@ -38,8 +38,8 @@ exports.ConnectionErrorResponse = (function(superClass) { })(exports.ConnectionError); -exports.AuthenticationError = (function(superClass) { - extend(AuthenticationError, superClass); +exports.AuthenticationError = (function(_super) { + __extends(AuthenticationError, _super); function AuthenticationError() { return AuthenticationError.__super__.constructor.apply(this, arguments); @@ -49,8 +49,8 @@ exports.AuthenticationError = (function(superClass) { })(exports.ConnectionErrorResponse); -exports.SSLError = (function(superClass) { - extend(SSLError, superClass); +exports.SSLError = (function(_super) { + __extends(SSLError, _super); function SSLError() { return SSLError.__super__.constructor.apply(this, arguments); @@ -60,8 +60,8 @@ exports.SSLError = (function(superClass) { })(exports.ConnectionError); -exports.ClientStateError = (function(superClass) { - extend(ClientStateError, superClass); +exports.ClientStateError = (function(_super) { + __extends(ClientStateError, _super); function ClientStateError() { return ClientStateError.__super__.constructor.apply(this, arguments); @@ -71,8 +71,8 @@ exports.ClientStateError = (function(superClass) { })(exports.VerticaError); -exports.QueryError = (function(superClass) { - extend(QueryError, superClass); +exports.QueryError = (function(_super) { + __extends(QueryError, _super); function QueryError() { return QueryError.__super__.constructor.apply(this, arguments); @@ -82,8 +82,8 @@ exports.QueryError = (function(superClass) { })(exports.VerticaError); -exports.QueryErrorResponse = (function(superClass) { - extend(QueryErrorResponse, superClass); +exports.QueryErrorResponse = (function(_super) { + __extends(QueryErrorResponse, _super); function QueryErrorResponse(msg) { QueryErrorResponse.__super__.constructor.call(this, msg.information['Message']); diff --git a/lib/frontend_message.js b/lib/frontend_message.js index f28a4be..d58b777 100644 --- a/lib/frontend_message.js +++ b/lib/frontend_message.js @@ -1,8 +1,8 @@ -// Generated by CoffeeScript 1.11.1 +// Generated by CoffeeScript 1.9.0 var Authentication, Buffer, FrontendMessage, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty, - slice = [].slice; + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + __hasProp = {}.hasOwnProperty, + __slice = [].slice; Authentication = require('./authentication'); @@ -43,17 +43,17 @@ FrontendMessage = (function() { })(); -FrontendMessage.Startup = (function(superClass) { - extend(Startup, superClass); +FrontendMessage.Startup = (function(_super) { + __extends(Startup, _super); Startup.prototype.typeId = null; Startup.prototype.protocol = 3 << 16; - function Startup(user, database, options) { - this.user = user; - this.database = database; - this.options = options; + function Startup(_at_user, _at_database, _at_options) { + this.user = _at_user; + this.database = _at_database; + this.options = _at_options; } Startup.prototype.payload = function() { @@ -83,8 +83,8 @@ FrontendMessage.Startup = (function(superClass) { })(FrontendMessage); -FrontendMessage.SSLRequest = (function(superClass) { - extend(SSLRequest, superClass); +FrontendMessage.SSLRequest = (function(_super) { + __extends(SSLRequest, _super); function SSLRequest() { return SSLRequest.__super__.constructor.apply(this, arguments); @@ -105,15 +105,15 @@ FrontendMessage.SSLRequest = (function(superClass) { })(FrontendMessage); -FrontendMessage.Password = (function(superClass) { - extend(Password, superClass); +FrontendMessage.Password = (function(_super) { + __extends(Password, _super); Password.prototype.typeId = 112; - function Password(password, authMethod, options) { - this.password = password; - this.authMethod = authMethod; - this.options = options; + function Password(_at_password, _at_authMethod, _at_options) { + this.password = _at_password; + this.authMethod = _at_authMethod; + this.options = _at_options; if (this.password == null) { this.password = ''; } @@ -126,11 +126,11 @@ FrontendMessage.Password = (function(superClass) { } Password.prototype.md5 = function() { - var hash, i, len, value, values; - values = 1 <= arguments.length ? slice.call(arguments, 0) : []; + var hash, value, values, _i, _len; + values = 1 <= arguments.length ? __slice.call(arguments, 0) : []; hash = require('crypto').createHash('md5'); - for (i = 0, len = values.length; i < len; i++) { - value = values[i]; + for (_i = 0, _len = values.length; _i < _len; _i++) { + value = values[_i]; hash.update(value); } return hash.digest('hex'); @@ -158,14 +158,14 @@ FrontendMessage.Password = (function(superClass) { })(FrontendMessage); -FrontendMessage.CancelRequest = (function(superClass) { - extend(CancelRequest, superClass); +FrontendMessage.CancelRequest = (function(_super) { + __extends(CancelRequest, _super); CancelRequest.prototype.cancelRequestMagicNumber = 80877102; - function CancelRequest(backendPid, backendKey) { - this.backendPid = backendPid; - this.backendKey = backendKey; + function CancelRequest(_at_backendPid, _at_backendKey) { + this.backendPid = _at_backendPid; + this.backendKey = _at_backendKey; } CancelRequest.prototype.payload = function() { @@ -181,13 +181,13 @@ FrontendMessage.CancelRequest = (function(superClass) { })(FrontendMessage); -FrontendMessage.Close = (function(superClass) { - extend(Close, superClass); +FrontendMessage.Close = (function(_super) { + __extends(Close, _super); Close.prototype.typeId = 67; - function Close(type, name) { - this.name = name; + function Close(type, _at_name) { + this.name = _at_name; if (this.name == null) { this.name = ""; } @@ -223,13 +223,13 @@ FrontendMessage.Close = (function(superClass) { })(FrontendMessage); -FrontendMessage.Describe = (function(superClass) { - extend(Describe, superClass); +FrontendMessage.Describe = (function(_super) { + __extends(Describe, _super); Describe.prototype.typeId = 68; - function Describe(type, name) { - this.name = name; + function Describe(type, _at_name) { + this.name = _at_name; if (this.name == null) { this.name = ""; } @@ -263,14 +263,14 @@ FrontendMessage.Describe = (function(superClass) { })(FrontendMessage); -FrontendMessage.Execute = (function(superClass) { - extend(Execute, superClass); +FrontendMessage.Execute = (function(_super) { + __extends(Execute, _super); Execute.prototype.typeId = 69; - function Execute(portal, maxRows) { - this.portal = portal; - this.maxRows = maxRows; + function Execute(_at_portal, _at_maxRows) { + this.portal = _at_portal; + this.maxRows = _at_maxRows; if (this.portal == null) { this.portal = ""; } @@ -291,13 +291,13 @@ FrontendMessage.Execute = (function(superClass) { })(FrontendMessage); -FrontendMessage.Query = (function(superClass) { - extend(Query, superClass); +FrontendMessage.Query = (function(_super) { + __extends(Query, _super); Query.prototype.typeId = 81; - function Query(sql) { - this.sql = sql; + function Query(_at_sql) { + this.sql = _at_sql; } Query.prototype.payload = function() { @@ -308,15 +308,15 @@ FrontendMessage.Query = (function(superClass) { })(FrontendMessage); -FrontendMessage.Parse = (function(superClass) { - extend(Parse, superClass); +FrontendMessage.Parse = (function(_super) { + __extends(Parse, _super); Parse.prototype.typeId = 80; - function Parse(name, sql, parameterTypes) { - this.name = name; - this.sql = sql; - this.parameterTypes = parameterTypes; + function Parse(_at_name, _at_sql, _at_parameterTypes) { + this.name = _at_name; + this.sql = _at_sql; + this.parameterTypes = _at_parameterTypes; if (this.name == null) { this.name = ""; } @@ -326,15 +326,15 @@ FrontendMessage.Parse = (function(superClass) { } Parse.prototype.payload = function() { - var b, i, len, paramType, pos, ref; + var b, paramType, pos, _i, _len, _ref; b = new Buffer(8192); pos = b.writeZeroTerminatedString(this.name, 0); pos += b.writeZeroTerminatedString(this.sql, pos); b.writeUInt16BE(this.parameterTypes.length, pos); pos += 2; - ref = this.parameterTypes; - for (i = 0, len = ref.length; i < len; i++) { - paramType = ref[i]; + _ref = this.parameterTypes; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + paramType = _ref[_i]; b.writeUInt32BE(paramType, pos); pos += 4; } @@ -345,24 +345,24 @@ FrontendMessage.Parse = (function(superClass) { })(FrontendMessage); -FrontendMessage.Bind = (function(superClass) { - extend(Bind, superClass); +FrontendMessage.Bind = (function(_super) { + __extends(Bind, _super); Bind.prototype.typeId = 66; - function Bind(portal, preparedStatement, parameterValues) { - var i, len, parameterValue; - this.portal = portal; - this.preparedStatement = preparedStatement; + function Bind(_at_portal, _at_preparedStatement, parameterValues) { + var parameterValue, _i, _len; + this.portal = _at_portal; + this.preparedStatement = _at_preparedStatement; this.parameterValues = []; - for (i = 0, len = parameterValues.length; i < len; i++) { - parameterValue = parameterValues[i]; + for (_i = 0, _len = parameterValues.length; _i < _len; _i++) { + parameterValue = parameterValues[_i]; this.parameterValues.push(parameterValue.toString()); } } Bind.prototype.payload = function() { - var b, i, len, pos, ref, value; + var b, pos, value, _i, _len, _ref; b = new Buffer(8192); pos = 0; pos += b.writeZeroTerminatedString(this.portal, pos); @@ -370,9 +370,9 @@ FrontendMessage.Bind = (function(superClass) { b.writeUInt16BE(0x00, pos); b.writeUInt16BE(this.parameterValues.length, pos + 2); pos += 4; - ref = this.parameterValues; - for (i = 0, len = ref.length; i < len; i++) { - value = ref[i]; + _ref = this.parameterValues; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + value = _ref[_i]; b.writeUInt32BE(value.length, pos); pos += 4; pos += b.write(value, pos); @@ -384,8 +384,8 @@ FrontendMessage.Bind = (function(superClass) { })(FrontendMessage); -FrontendMessage.Flush = (function(superClass) { - extend(Flush, superClass); +FrontendMessage.Flush = (function(_super) { + __extends(Flush, _super); function Flush() { return Flush.__super__.constructor.apply(this, arguments); @@ -397,8 +397,8 @@ FrontendMessage.Flush = (function(superClass) { })(FrontendMessage); -FrontendMessage.Sync = (function(superClass) { - extend(Sync, superClass); +FrontendMessage.Sync = (function(_super) { + __extends(Sync, _super); function Sync() { return Sync.__super__.constructor.apply(this, arguments); @@ -410,8 +410,8 @@ FrontendMessage.Sync = (function(superClass) { })(FrontendMessage); -FrontendMessage.Terminate = (function(superClass) { - extend(Terminate, superClass); +FrontendMessage.Terminate = (function(_super) { + __extends(Terminate, _super); function Terminate() { return Terminate.__super__.constructor.apply(this, arguments); @@ -423,13 +423,13 @@ FrontendMessage.Terminate = (function(superClass) { })(FrontendMessage); -FrontendMessage.CopyData = (function(superClass) { - extend(CopyData, superClass); +FrontendMessage.CopyData = (function(_super) { + __extends(CopyData, _super); CopyData.prototype.typeId = 100; - function CopyData(data) { - this.data = data; + function CopyData(_at_data) { + this.data = _at_data; } CopyData.prototype.payload = function() { @@ -440,8 +440,8 @@ FrontendMessage.CopyData = (function(superClass) { })(FrontendMessage); -FrontendMessage.CopyDone = (function(superClass) { - extend(CopyDone, superClass); +FrontendMessage.CopyDone = (function(_super) { + __extends(CopyDone, _super); function CopyDone() { return CopyDone.__super__.constructor.apply(this, arguments); @@ -453,13 +453,13 @@ FrontendMessage.CopyDone = (function(superClass) { })(FrontendMessage); -FrontendMessage.CopyFail = (function(superClass) { - extend(CopyFail, superClass); +FrontendMessage.CopyFail = (function(_super) { + __extends(CopyFail, _super); CopyFail.prototype.typeId = 102; - function CopyFail(error) { - this.error = error; + function CopyFail(_at_error) { + this.error = _at_error; } CopyFail.prototype.payload = function() { diff --git a/lib/query.js b/lib/query.js index e52ffd3..67bb002 100644 --- a/lib/query.js +++ b/lib/query.js @@ -1,293 +1,288 @@ -// Generated by CoffeeScript 1.11.1 -(function() { - var EventEmitter, FrontendMessage, Query, Resultset, decoders, errors, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; +// Generated by CoffeeScript 1.9.0 +var EventEmitter, FrontendMessage, Query, Resultset, decoders, errors, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + __hasProp = {}.hasOwnProperty; - EventEmitter = require('events').EventEmitter; +EventEmitter = require('events').EventEmitter; - FrontendMessage = require('./frontend_message'); +FrontendMessage = require('./frontend_message'); - decoders = require('./types').decoders; +decoders = require('./types').decoders; - Resultset = require('./resultset'); +Resultset = require('./resultset'); - errors = require('./errors'); +errors = require('./errors'); - Query = (function(superClass) { - extend(Query, superClass); +Query = (function(_super) { + __extends(Query, _super); - function Query(connection, sql, callback1) { - this.connection = connection; - this.sql = sql; - this.callback = callback1; - Query.__super__.constructor.call(this); - this._handlingCopyIn = false; - } + function Query(_at_connection, _at_sql, _at_callback) { + this.connection = _at_connection; + this.sql = _at_sql; + this.callback = _at_callback; + Query.__super__.constructor.call(this); + this._handlingCopyIn = false; + } - Query.prototype.run = function() { - this.emit('start'); - this.connection._writeMessage(new FrontendMessage.Query(this.sql)); - this.connection.once('EmptyQueryResponse', this.onEmptyQueryListener = this.onEmptyQuery.bind(this)); - this.connection.on('RowDescription', this.onRowDescriptionListener = this.onRowDescription.bind(this)); - this.connection.on('DataRow', this.onDataRowListener = this.onDataRow.bind(this)); - this.connection.on('CommandComplete', this.onCommandCompleteListener = this.onCommandComplete.bind(this)); - this.connection.once('ErrorResponse', this.onErrorResponseListener = this.onErrorResponse.bind(this)); - this.connection.once('ReadyForQuery', this.onReadyForQueryListener = this.onReadyForQuery.bind(this)); - this.connection.once('CopyInResponse', this.onCopyInResponseListener = this.onCopyInResponse.bind(this)); - return this.connection.once('CopyFileResponse', this.onCopyFileResponseListener = this.onCopyFileResponse.bind(this)); - }; + Query.prototype.run = function() { + this.emit('start'); + this.connection._writeMessage(new FrontendMessage.Query(this.sql)); + this.connection.once('EmptyQueryResponse', this.onEmptyQueryListener = this.onEmptyQuery.bind(this)); + this.connection.on('RowDescription', this.onRowDescriptionListener = this.onRowDescription.bind(this)); + this.connection.on('DataRow', this.onDataRowListener = this.onDataRow.bind(this)); + this.connection.on('CommandComplete', this.onCommandCompleteListener = this.onCommandComplete.bind(this)); + this.connection.once('ErrorResponse', this.onErrorResponseListener = this.onErrorResponse.bind(this)); + this.connection.once('ReadyForQuery', this.onReadyForQueryListener = this.onReadyForQuery.bind(this)); + this.connection.once('CopyInResponse', this.onCopyInResponseListener = this.onCopyInResponse.bind(this)); + return this.connection.once('CopyFileResponse', this.onCopyFileResponseListener = this.onCopyFileResponse.bind(this)); + }; - Query.prototype.onEmptyQuery = function(msg) { - var err; - err = new errors.QueryError("The query was empty!"); - if (this.callback) { - return this.error = err; - } else { - return this.emit('error', err); - } - }; - - Query.prototype.onRowDescription = function(msg) { - var column, customDecoders, decoder, err, field, i, len, ref, ref1, ref2, type; - if (this.status && this.callback) { - err = new errors.VerticaError("Cannot handle multi-queries with a callback!"); - this.error = err; - return; - } - customDecoders = {}; - ref = this.connection.connectionOptions.decoders; - for (type in ref) { - decoder = ref[type]; - customDecoders[type] = decoder; - } - ref1 = this.decoders; - for (type in ref1) { - decoder = ref1[type]; - customDecoders[type] = decoder; - } - this.fields = []; - ref2 = msg.columns; - for (i = 0, len = ref2.length; i < len; i++) { - column = ref2[i]; - field = new Query.Field(column, customDecoders); - this.emit('field', field); - this.fields.push(field); - } - if (this.callback) { - this.rows = []; - } - return this.emit('fields', this.fields); - }; - - Query.prototype.onDataRow = function(msg) { - var err, i, index, len, ref, row, value; - try { - row = []; - ref = msg.values; - for (index = i = 0, len = ref.length; i < len; index = ++i) { - value = ref[index]; - row.push(value != null ? this.fields[index].decoder(value) : null); - } - if (this.callback) { - this.rows.push(row); - } - return this.emit('row', row); - } catch (error1) { - err = error1; - if (this.callback) { - return this.error = err.message; - } else { - return this.emit('error', err.message); - } - } - }; + Query.prototype.onEmptyQuery = function(msg) { + var err; + err = new errors.QueryError("The query was empty!"); + if (this.callback) { + return this.error = err; + } else { + return this.emit('error', err); + } + }; - Query.prototype.onReadyForQuery = function(msg) { - this._removeAllListeners(); - if (this.callback) { - return process.nextTick((function(_this) { - return function() { - if (_this.error) { - return _this.callback(_this.error); - } else { - return _this.callback(null, new Resultset({ - fields: _this.fields, - rows: _this.rows, - status: _this.status - })); - } - }; - })(this)); - } - }; + Query.prototype.onRowDescription = function(msg) { + var column, customDecoders, decoder, err, field, type, _i, _len, _ref, _ref1, _ref2; + if (this.status && this.callback) { + err = new errors.VerticaError("Cannot handle multi-queries with a callback!"); + this.error = err; + return; + } + customDecoders = {}; + _ref = this.connection.connectionOptions.decoders; + for (type in _ref) { + decoder = _ref[type]; + customDecoders[type] = decoder; + } + _ref1 = this.decoders; + for (type in _ref1) { + decoder = _ref1[type]; + customDecoders[type] = decoder; + } + this.fields = []; + _ref2 = msg.columns; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + column = _ref2[_i]; + field = new Query.Field(column, customDecoders); + this.emit('field', field); + this.fields.push(field); + } + if (this.callback) { + this.rows = []; + } + return this.emit('fields', this.fields); + }; - Query.prototype.onCommandComplete = function(msg) { - if (this.callback) { - this.status = msg.status; + Query.prototype.onDataRow = function(msg) { + var err, index, row, value, _i, _len, _ref; + try { + row = []; + _ref = msg.values; + for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) { + value = _ref[index]; + row.push(value != null ? this.fields[index].decoder(value) : null); } - return this.emit('end', msg.status); - }; - - Query.prototype.onErrorResponse = function(msg) { - var err; - err = new errors.QueryErrorResponse(msg); if (this.callback) { - return this.error = err; - } else { - return this.emit('error', err); + this.rows.push(row); } - }; - - Query.prototype.onConnectionError = function(msg) { - this._removeAllListeners(); + return this.emit('row', row); + } catch (_error) { + err = _error; if (this.callback) { - return process.nextTick((function(_this) { - return function() { - return _this.callback(msg); - }; - })(this)); + return this.error = err.message; } else { - return this.emit('error', msg); + return this.emit('error', err.message); } - }; + } + }; - Query.prototype.onCopyInResponse = function(msg) { - var copyInHandler, dataHandler, err, failureHandler, successHandler; - this._handlingCopyIn = true; - dataHandler = (function(_this) { - return function(data, callback) { - return _this.copyData(data, callback); + Query.prototype.onReadyForQuery = function(msg) { + this._removeAllListeners(); + if (this.callback) { + return process.nextTick((function(_this) { + return function() { + if (_this.error) { + return _this.callback(_this.error); + } else { + return _this.callback(null, new Resultset({ + fields: _this.fields, + rows: _this.rows, + status: _this.status + })); + } }; - })(this); - successHandler = (function(_this) { - return function(callback) { - return _this.copyDone(callback); - }; - })(this); - failureHandler = (function(_this) { - return function(err, callback) { - return _this.copyFail(err, callback); - }; - })(this); - try { - copyInHandler = this._getCopyInHandler(); - return copyInHandler(dataHandler, successHandler, failureHandler); - } catch (error1) { - err = error1; - return this.copyFail(err); - } - }; + })(this)); + } + }; - Query.prototype.onCopyFileResponse = function(msg) { - var error; - error = new errors.ClientStateError("COPY FROM LOCAL is not supported."); - return this.connection.disconnect(error); - }; + Query.prototype.onCommandComplete = function(msg) { + if (this.callback) { + this.status = msg.status; + } + return this.emit('end', msg.status); + }; - Query.prototype._getCopyInHandler = function() { - var existsSync, fs, stream; - if (typeof this.copyInSource === 'function') { - return this.copyInSource; - } else if (typeof this.copyInSource === 'string') { - fs = require('fs'); - existsSync = fs.existsSync || require('path').existsSync; - if (existsSync(this.copyInSource)) { - stream = fs.createReadStream(this.copyInSource); - return this._getStreamCopyInHandler(stream); - } else { - throw new errors.ClientStateError("Could not find local file " + this.copyInSource + "."); - } - } else if (this.copyInSource === process.stdin) { - process.stdin.resume(); - return this._getStreamCopyInHandler(process.stdin); - } else if (typeof this.copyInSource === 'object' && typeof this.copyInSource.read === 'function' && typeof this.copyInSource.push === 'function') { - return this._getStreamCopyInHandler(this.copyInSource); - } else { - throw new errors.ClientStateError("No copy in handler defined to handle the COPY statement."); - } - }; + Query.prototype.onErrorResponse = function(msg) { + var err; + err = new errors.QueryErrorResponse(msg); + if (this.callback) { + return this.error = err; + } else { + return this.emit('error', err); + } + }; - Query.prototype._getStreamCopyInHandler = function(stream) { - return function(transfer, success, fail) { - stream.on('data', function(data) { - return transfer(data); - }); - stream.on('end', function() { - return success(); - }); - return stream.on('error', function(err) { - return fail(err); - }); - }; - }; + Query.prototype.onConnectionError = function(msg) { + this._removeAllListeners(); + if (this.callback) { + return process.nextTick((function(_this) { + return function() { + return _this.callback(msg); + }; + })(this)); + } else { + return this.emit('error', msg); + } + }; - Query.prototype.copyData = function(data, callback) { - if (this._handlingCopyIn) { - return this.connection._writeMessage(new FrontendMessage.CopyData(data), callback); - } else { - throw new errors.ClientStateError("Copy in mode not active!"); - } - }; + Query.prototype.onCopyInResponse = function(msg) { + var copyInHandler, dataHandler, err, failureHandler, successHandler; + this._handlingCopyIn = true; + dataHandler = (function(_this) { + return function(data, callback) { + return _this.copyData(data, callback); + }; + })(this); + successHandler = (function(_this) { + return function(callback) { + return _this.copyDone(callback); + }; + })(this); + failureHandler = (function(_this) { + return function(err, callback) { + return _this.copyFail(err, callback); + }; + })(this); + try { + copyInHandler = this._getCopyInHandler(); + return copyInHandler(dataHandler, successHandler, failureHandler); + } catch (_error) { + err = _error; + return this.copyFail(err); + } + }; - Query.prototype.copyDone = function(callback) { - if (this._handlingCopyIn) { - this.connection._writeMessage(new FrontendMessage.CopyDone(), callback); - return this._handlingCopyIn = false; - } else { - throw new errors.ClientStateError("Copy in mode not active!"); - } - }; + Query.prototype.onCopyFileResponse = function(msg) { + var error; + error = new errors.ClientStateError("COPY FROM LOCAL is not supported."); + return this.connection.disconnect(error); + }; - Query.prototype.copyFail = function(error, callback) { - var message, ref; - if (this._handlingCopyIn) { - message = (ref = error.message) != null ? ref : error.toString(); - this.connection._writeMessage(new FrontendMessage.CopyFail(message), callback); - return this._handlingCopyIn = false; + Query.prototype._getCopyInHandler = function() { + var existsSync, fs, stream; + if (typeof this.copyInSource === 'function') { + return this.copyInSource; + } else if (typeof this.copyInSource === 'string') { + fs = require('fs'); + existsSync = fs.existsSync || require('path').existsSync; + if (existsSync(this.copyInSource)) { + stream = fs.createReadStream(this.copyInSource); + return this._getStreamCopyInHandler(stream); } else { - throw new errors.ClientStateError("Copy in mode not active!"); + throw new errors.ClientStateError("Could not find local file " + this.copyInSource + "."); } - }; + } else if (this.copyInSource === process.stdin) { + process.stdin.resume(); + return this._getStreamCopyInHandler(process.stdin); + } else if (typeof this.copyInSource === 'object' && typeof this.copyInSource.read === 'function' && typeof this.copyInSource.push === 'function') { + return this._getStreamCopyInHandler(this.copyInSource); + } else { + throw new errors.ClientStateError("No copy in handler defined to handle the COPY statement."); + } + }; - Query.prototype._removeAllListeners = function() { - this.connection.removeListener('EmptyQueryResponse', this.onEmptyQueryListener); - this.connection.removeListener('RowDescription', this.onRowDescriptionListener); - this.connection.removeListener('DataRow', this.onDataRowListener); - this.connection.removeListener('CommandComplete', this.onCommandCompleteListener); - this.connection.removeListener('ErrorResponse', this.onErrorResponseListener); - this.connection.removeListener('ReadyForQuery', this.onReadyForQueryListener); - this.connection.removeListener('CopyInResponse', this.onCopyInResponseListener); - return this.connection.removeListener('CopyFileResponse', this.onCopyFileResponseListener); + Query.prototype._getStreamCopyInHandler = function(stream) { + return function(transfer, success, fail) { + stream.on('data', function(data) { + return transfer(data); + }); + stream.on('end', function() { + return success(); + }); + return stream.on('error', function(err) { + return fail(err); + }); }; + }; - return Query; + Query.prototype.copyData = function(data, callback) { + if (this._handlingCopyIn) { + return this.connection._writeMessage(new FrontendMessage.CopyData(data), callback); + } else { + throw new errors.ClientStateError("Copy in mode not active!"); + } + }; - })(EventEmitter); + Query.prototype.copyDone = function(callback) { + if (this._handlingCopyIn) { + this.connection._writeMessage(new FrontendMessage.CopyDone(), callback); + return this._handlingCopyIn = false; + } else { + throw new errors.ClientStateError("Copy in mode not active!"); + } + }; - Query.Field = (function() { - function Field(msg, customDecoders) { - var decoder; - this.name = msg.name; - this.tableOID = msg.tableOID; - this.tableFieldIndex = msg.tableFieldIndex; - this.typeOID = msg.typeOID; - this.type = msg.type; - this.size = msg.size; - this.modifier = msg.modifier; - this.formatCode = msg.formatCode; - if (customDecoders) { - decoder = customDecoders[this.type] || customDecoders["default"]; - } - this.decoder = decoder || decoders[this.formatCode][this.type] || decoders[this.formatCode]["default"]; + Query.prototype.copyFail = function(error, callback) { + var message, _ref; + if (this._handlingCopyIn) { + message = (_ref = error.message) != null ? _ref : error.toString(); + this.connection._writeMessage(new FrontendMessage.CopyFail(message), callback); + return this._handlingCopyIn = false; + } else { + throw new errors.ClientStateError("Copy in mode not active!"); } + }; + + Query.prototype._removeAllListeners = function() { + this.connection.removeListener('EmptyQueryResponse', this.onEmptyQueryListener); + this.connection.removeListener('RowDescription', this.onRowDescriptionListener); + this.connection.removeListener('DataRow', this.onDataRowListener); + this.connection.removeListener('CommandComplete', this.onCommandCompleteListener); + this.connection.removeListener('ErrorResponse', this.onErrorResponseListener); + this.connection.removeListener('ReadyForQuery', this.onReadyForQueryListener); + this.connection.removeListener('CopyInResponse', this.onCopyInResponseListener); + return this.connection.removeListener('CopyFileResponse', this.onCopyFileResponseListener); + }; - return Field; + return Query; - })(); +})(EventEmitter); + +Query.Field = (function() { + function Field(msg, customDecoders) { + var decoder; + this.name = msg.name; + this.tableOID = msg.tableOID; + this.tableFieldIndex = msg.tableFieldIndex; + this.typeOID = msg.typeOID; + this.type = msg.type; + this.size = msg.size; + this.modifier = msg.modifier; + this.formatCode = msg.formatCode; + if (customDecoders) { + decoder = customDecoders[this.type] || customDecoders["default"]; + } + this.decoder = decoder || decoders[this.formatCode][this.type] || decoders[this.formatCode]["default"]; + } - module.exports = Query; + return Field; -}).call(this); +})(); -//# sourceMappingURL=query.js.map +module.exports = Query; diff --git a/lib/query.js.map b/lib/query.js.map deleted file mode 100644 index d73c85a..0000000 --- a/lib/query.js.map +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 3, - "file": "query.js", - "sourceRoot": "../src", - "sources": [ - "query.coffee" - ], - "names": [], - "mappings": ";AAAA;AAAA,MAAA,iEAAA;IAAA;;;EAAA,YAAA,GAAkB,OAAA,CAAQ,QAAR,CAAiB,CAAC;;EACpC,eAAA,GAAkB,OAAA,CAAQ,oBAAR;;EAClB,QAAA,GAAkB,OAAA,CAAQ,SAAR,CAAkB,CAAC;;EACrC,SAAA,GAAkB,OAAA,CAAQ,aAAR;;EAClB,MAAA,GAAkB,OAAA,CAAQ,UAAR;;EAEZ;;;IAES,eAAC,UAAD,EAAc,GAAd,EAAoB,SAApB;MAAC,IAAC,CAAA,aAAD;MAAa,IAAC,CAAA,MAAD;MAAM,IAAC,CAAA,WAAD;MAC/B,qCAAA;MACA,IAAC,CAAA,eAAD,GAAmB;IAFR;;oBAIb,GAAA,GAAK,SAAA;MACH,IAAC,CAAA,IAAD,CAAM,OAAN;MAEA,IAAC,CAAA,UAAU,CAAC,aAAZ,CAA8B,IAAA,eAAe,CAAC,KAAhB,CAAsB,IAAC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AAU,CAAC,cAAZ,CAA2B,eAA3B,EAAiD,IAAC,CAAA,uBAAlD;MACA,IAAC,CAAA,UAAU,CAAC,cAAZ,CAA2B,eAA3B,EAAiD,IAAC,CAAA,uBAAlD;MACA,IAAC,CAAA,UAAU,CAAC,cAAZ,CAA2B,gBAA3B,EAAiD,IAAC,CAAA,wBAAlD;aACA,IAAC,CAAA,UAAU,CAAC,cAAZ,CAA2B,kBAA3B,EAAiD,IAAC,CAAA,0BAAlD;IARmB;;;;KApKH;;EA+Kd,KAAK,CAAC;IACG,eAAC,GAAD,EAAM,cAAN;AACX,UAAA;MAAA,IAAC,CAAA,IAAD,GAAmB,GAAG,CAAC;MACvB,IAAC,CAAA,QAAD,GAAmB,GAAG,CAAC;MACvB,IAAC,CAAA,eAAD,GAAmB,GAAG,CAAC;MACvB,IAAC,CAAA,OAAD,GAAmB,GAAG,CAAC;MACvB,IAAC,CAAA,IAAD,GAAmB,GAAG,CAAC;MACvB,IAAC,CAAA,IAAD,GAAmB,GAAG,CAAC;MACvB,IAAC,CAAA,QAAD,GAAmB,GAAG,CAAC;MACvB,IAAC,CAAA,UAAD,GAAmB,GAAG,CAAC;MAEvB,IAAG,cAAH;QAEE,OAAA,GAAU,cAAe,CAAA,IAAC,CAAA,IAAD,CAAf,IAAyB,cAAc,EAAC,OAAD,GAFnD;;MAIA,IAAC,CAAA,OAAD,GAAW,OAAA,IAAW,QAAS,CAAA,IAAC,CAAA,UAAD,CAAa,CAAA,IAAC,CAAA,IAAD,CAAjC,IAA2C,QAAS,CAAA,IAAC,CAAA,UAAD,CAAY,EAAC,OAAD;IAdhE;;;;;;EAiBf,MAAM,CAAC,OAAP,GAAiB;AAvMjB" -} \ No newline at end of file diff --git a/lib/quoting.js b/lib/quoting.js index 78ce098..f459ad2 100644 --- a/lib/quoting.js +++ b/lib/quoting.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.11.1 +// Generated by CoffeeScript 1.9.0 exports.escape = function(val) { return val.toString().replace(/'/g, "''"); }; @@ -19,13 +19,13 @@ exports.quote = function(val) { return "'" + (exports.escape(val)) + "'"; } else if (val instanceof Array) { return ((function() { - var i, len, results; - results = []; - for (i = 0, len = val.length; i < len; i++) { - v = val[i]; - results.push(exports.quote(v)); + var _i, _len, _results; + _results = []; + for (_i = 0, _len = val.length; _i < _len; _i++) { + v = val[_i]; + _results.push(exports.quote(v)); } - return results; + return _results; })()).join(', '); } else if (val instanceof Date) { return "'" + (val.toISOString().replace(/T/, ' ').replace(/\.\d+Z$/, '')) + "'::timestamp"; diff --git a/lib/resultset.js b/lib/resultset.js index 6cf93b7..905096d 100644 --- a/lib/resultset.js +++ b/lib/resultset.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.11.1 +// Generated by CoffeeScript 1.9.0 var Resultset; Resultset = (function() { diff --git a/lib/starttls.js b/lib/starttls.js index ffe941e..98b05d6 100644 --- a/lib/starttls.js +++ b/lib/starttls.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.11.1 +// Generated by CoffeeScript 1.9.0 var pipe; module.exports = function(socket, options, cb) { diff --git a/lib/types.js b/lib/types.js index e09e917..499cb04 100644 --- a/lib/types.js +++ b/lib/types.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.11.1 +// Generated by CoffeeScript 1.9.0 var VerticaDate, VerticaInterval, VerticaTime, VerticaTimestamp, binaryDecoders, binaryEncoders, padWithZeroes, stringDecoders, stringEncoders; padWithZeroes = function(str, length) { @@ -26,6 +26,7 @@ exports.typeOIDs = { 16: "numeric", 25: "string", 1043: "string", + 1082: "date", 20: "integer", 21: "integer", 23: "integer", diff --git a/lib/vertica.js b/lib/vertica.js index 42b9983..17f9c28 100644 --- a/lib/vertica.js +++ b/lib/vertica.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.11.1 +// Generated by CoffeeScript 1.9.0 var quoting, types; exports.Connection = require('./connection'); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..f47db41 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,343 @@ +{ + "name": "vertica", + "version": "0.5.6", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "vertica", + "version": "0.5.6", + "devDependencies": { + "coffee-script": "1.9.0", + "mocha": "~> 1.18.0", + "semver": "~> 6.3" + } + }, + "node_modules/coffee-script": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.9.0.tgz", + "integrity": "sha512-Kx4M9Z7kYAcrKGl7jgYrfLdtJUpGyQRtYrD8YO84MYb8z3f/H/W0NSk/v9lLB0HFlcja4OvjNd+afImgOukSnQ==", + "deprecated": "CoffeeScript on NPM has moved to \"coffeescript\" (no hyphen)", + "dev": true, + "bin": { + "cake": "bin/cake", + "coffee": "bin/coffee" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/commander": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.0.0.tgz", + "integrity": "sha512-qebjpyeaA/nJ4w3EO2cV2++/zEkccPnjWogzA2rff+Lk8ILI75vULeTmyd4wPxWdKwtP3J+G39IXVZadh0UHyw==", + "dev": true, + "engines": { + "node": ">= 0.6.x" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/diff": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.0.7.tgz", + "integrity": "sha512-0bTLzyr1S59cPsgAD/lR+ivvHTbgPb+k/mUR6WGqma1J6QDU+kUegI8uQFuH/cMUNK7JGN3Tk1Y5Jf2MO85WrA==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/glob": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.3.tgz", + "integrity": "sha512-WPaLsMHD1lYEqAmIQI6VOJSPwuBdGShDWnj1yUo0vQqEO809R8W3LM9OVU13CnnDhyv/EiNwOtxEW74SmrzS6w==", + "dev": true, + "dependencies": { + "graceful-fs": "~2.0.0", + "inherits": "2", + "minimatch": "~0.2.11" + }, + "engines": { + "node": "*" + } + }, + "node_modules/graceful-fs": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz", + "integrity": "sha512-hcj/NTUWv+C3MbqrVb9F+aH6lvTwEHJdx2foBxlrVq5h6zE8Bfu4pv4CAAqbDcZrw/9Ak5lsRXlY9Ao8/F0Tuw==", + "deprecated": "please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/growl": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.7.0.tgz", + "integrity": "sha512-VWv7s1EI41AG2LiCr7uAuxWikLDN1SQOuEUc37d/P34NAIIYgkvWYngNw0d9d9iCrDFL0SYCE9UQpxhIjjtuLg==", + "dev": true + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/jade": { + "version": "0.26.3", + "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", + "integrity": "sha512-mkk3vzUHFjzKjpCXeu+IjXeZD+QOTjUUdubgmHtHTDwvAO2ZTkMTTVrapts5CWz3JvJryh/4KWZpjeZrCepZ3A==", + "deprecated": "Jade has been renamed to pug, please install the latest version of pug instead of jade", + "dev": true, + "dependencies": { + "commander": "0.6.1", + "mkdirp": "0.3.0" + }, + "bin": { + "jade": "bin/jade" + } + }, + "node_modules/jade/node_modules/commander": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", + "integrity": "sha512-0fLycpl1UMTGX257hRsu/arL/cUbcvQM4zMKwvLvzXtfdezIV4yotPS2dYtknF+NmEfWSoCEF6+hj9XLm/6hEw==", + "dev": true, + "engines": { + "node": ">= 0.4.x" + } + }, + "node_modules/jade/node_modules/mkdirp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", + "integrity": "sha512-OHsdUcVAQ6pOtg5JYWpCBo9W/GySVuwvP9hueRMW7UqshC0tbfzLv8wjySTPm3tfUZ/21CE9E1pJagOA91Pxew==", + "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha512-WpibWJ60c3AgAz8a2iYErDrcT2C7OmKnsWhIcHOjkUHFjkXncJhtLxNSqUmxRxRunpb5I8Vprd7aNSd2NtksJQ==", + "dev": true + }, + "node_modules/minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha512-zZ+Jy8lVWlvqqeM8iZB7w7KmQkoJn8djM585z88rywrEbzoqawVa9FR5p2hwD+y74nfuKOjmNvi9gtWJNLqHvA==", + "deprecated": "Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue", + "dev": true, + "dependencies": { + "lru-cache": "2", + "sigmund": "~1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mkdirp": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "integrity": "sha512-8OCq0De/h9ZxseqzCH8Kw/Filf5pF/vMI6+BH7Lu0jXz2pqYCjTAQRolSxRIi+Ax+oCCjlxoJMP0YQ4XlrQNHg==", + "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", + "dev": true + }, + "node_modules/mocha": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-1.18.2.tgz", + "integrity": "sha512-IGINop40uo+TmtAN4KBiK36XznVV/G9QMG6nRdRcf041QAwaQI7opNJuLP6oal0e7fWdNS3qA83fovwuB/P6Jg==", + "deprecated": "Mocha v1.x is no longer supported.", + "dev": true, + "dependencies": { + "commander": "2.0.0", + "debug": "*", + "diff": "1.0.7", + "glob": "3.2.3", + "growl": "1.7.x", + "jade": "0.26.3", + "mkdirp": "0.3.5" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 0.4.x" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==", + "dev": true + } + }, + "dependencies": { + "coffee-script": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.9.0.tgz", + "integrity": "sha512-Kx4M9Z7kYAcrKGl7jgYrfLdtJUpGyQRtYrD8YO84MYb8z3f/H/W0NSk/v9lLB0HFlcja4OvjNd+afImgOukSnQ==", + "dev": true + }, + "commander": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.0.0.tgz", + "integrity": "sha512-qebjpyeaA/nJ4w3EO2cV2++/zEkccPnjWogzA2rff+Lk8ILI75vULeTmyd4wPxWdKwtP3J+G39IXVZadh0UHyw==", + "dev": true + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "diff": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.0.7.tgz", + "integrity": "sha512-0bTLzyr1S59cPsgAD/lR+ivvHTbgPb+k/mUR6WGqma1J6QDU+kUegI8uQFuH/cMUNK7JGN3Tk1Y5Jf2MO85WrA==", + "dev": true + }, + "glob": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.3.tgz", + "integrity": "sha512-WPaLsMHD1lYEqAmIQI6VOJSPwuBdGShDWnj1yUo0vQqEO809R8W3LM9OVU13CnnDhyv/EiNwOtxEW74SmrzS6w==", + "dev": true, + "requires": { + "graceful-fs": "~2.0.0", + "inherits": "2", + "minimatch": "~0.2.11" + } + }, + "graceful-fs": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz", + "integrity": "sha512-hcj/NTUWv+C3MbqrVb9F+aH6lvTwEHJdx2foBxlrVq5h6zE8Bfu4pv4CAAqbDcZrw/9Ak5lsRXlY9Ao8/F0Tuw==", + "dev": true + }, + "growl": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.7.0.tgz", + "integrity": "sha512-VWv7s1EI41AG2LiCr7uAuxWikLDN1SQOuEUc37d/P34NAIIYgkvWYngNw0d9d9iCrDFL0SYCE9UQpxhIjjtuLg==", + "dev": true + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "jade": { + "version": "0.26.3", + "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", + "integrity": "sha512-mkk3vzUHFjzKjpCXeu+IjXeZD+QOTjUUdubgmHtHTDwvAO2ZTkMTTVrapts5CWz3JvJryh/4KWZpjeZrCepZ3A==", + "dev": true, + "requires": { + "commander": "0.6.1", + "mkdirp": "0.3.0" + }, + "dependencies": { + "commander": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", + "integrity": "sha512-0fLycpl1UMTGX257hRsu/arL/cUbcvQM4zMKwvLvzXtfdezIV4yotPS2dYtknF+NmEfWSoCEF6+hj9XLm/6hEw==", + "dev": true + }, + "mkdirp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", + "integrity": "sha512-OHsdUcVAQ6pOtg5JYWpCBo9W/GySVuwvP9hueRMW7UqshC0tbfzLv8wjySTPm3tfUZ/21CE9E1pJagOA91Pxew==", + "dev": true + } + } + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha512-WpibWJ60c3AgAz8a2iYErDrcT2C7OmKnsWhIcHOjkUHFjkXncJhtLxNSqUmxRxRunpb5I8Vprd7aNSd2NtksJQ==", + "dev": true + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha512-zZ+Jy8lVWlvqqeM8iZB7w7KmQkoJn8djM585z88rywrEbzoqawVa9FR5p2hwD+y74nfuKOjmNvi9gtWJNLqHvA==", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + }, + "mkdirp": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "integrity": "sha512-8OCq0De/h9ZxseqzCH8Kw/Filf5pF/vMI6+BH7Lu0jXz2pqYCjTAQRolSxRIi+Ax+oCCjlxoJMP0YQ4XlrQNHg==", + "dev": true + }, + "mocha": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-1.18.2.tgz", + "integrity": "sha512-IGINop40uo+TmtAN4KBiK36XznVV/G9QMG6nRdRcf041QAwaQI7opNJuLP6oal0e7fWdNS3qA83fovwuB/P6Jg==", + "dev": true, + "requires": { + "commander": "2.0.0", + "debug": "*", + "diff": "1.0.7", + "glob": "3.2.3", + "growl": "1.7.x", + "jade": "0.26.3", + "mkdirp": "0.3.5" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==", + "dev": true + } + } +} diff --git a/package.json b/package.json index b86613c..58eae29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vertica", - "version": "0.5.6", + "version": "0.5.7", "description": "Pure Javascript client library for Vertica", "keywords": ["database", "vertica", "sql"], "author": "Willem van Bergen ", diff --git a/src/types.coffee b/src/types.coffee index 77debd5..f9bbddf 100644 --- a/src/types.coffee +++ b/src/types.coffee @@ -20,6 +20,7 @@ exports.typeOIDs = 16: "numeric" 25: "string" 1043: "string" + 1082: "date" 20: "integer" 21: "integer" 23: "integer"