mysql-activerecord
Advanced tools
Comparing version 0.7.4 to 0.8.1
32
index.js
@@ -51,3 +51,3 @@ /** | ||
var connection = new mysql.createClient({ | ||
var connection = new mysql.createConnection({ | ||
host: settings.server, | ||
@@ -241,3 +241,3 @@ port: settings.port, | ||
this.comma_seperated_arguments = function(set) { | ||
this.comma_separated_arguments = function(set) { | ||
var clause = ''; | ||
@@ -254,3 +254,3 @@ if (Object.prototype.toString.call(set) === '[object Array]') { | ||
this.group_by = function(set) { | ||
groupByClause = this.comma_seperated_arguments(set); | ||
groupByClause = this.comma_separated_arguments(set); | ||
return that; | ||
@@ -260,3 +260,3 @@ }; | ||
this.order_by = function(set) { | ||
orderByClause = this.comma_seperated_arguments(set); | ||
orderByClause = this.comma_separated_arguments(set); | ||
return that; | ||
@@ -418,5 +418,27 @@ }; | ||
var reconnectingTimeout = false; | ||
function handleDisconnect(connectionInstance) { | ||
connectionInstance.on('error', function(err) { | ||
if (!err.fatal || reconnectingTimeout) { | ||
return; | ||
} | ||
if (err.code !== 'PROTOCOL_CONNECTION_LOST' && err.code !== 'ECONNREFUSED') { | ||
throw err; | ||
} | ||
var reconnectingTimeout = setTimeout(function() { | ||
connection = mysql.createConnection(connectionInstance.config); | ||
handleDisconnect(connection); | ||
connection.connect(); | ||
}, 2000); | ||
}); | ||
} | ||
handleDisconnect(connection); | ||
var that = this; | ||
return this; | ||
} | ||
} |
{ | ||
"name" : "mysql-activerecord", | ||
"version": "0.7.4", | ||
"version": "0.8.1", | ||
"author": "Martin Tajur <martin@tajur.ee>", | ||
@@ -13,3 +13,3 @@ "description": "MySQL ActiveRecord pattern implementation on top of the mysql module.", | ||
"dependencies": { | ||
"mysql": "0.9.6" | ||
"mysql": "2.0.0-alpha8" | ||
}, | ||
@@ -16,0 +16,0 @@ "main" : "./", |
@@ -226,3 +226,3 @@ MySQL ActiveRecord Adapter for Node.js | ||
## .connection() | ||
Returns the underlying database connection object, ultimately what https://github.com/felixge/node-mysql .createClient() returns. | ||
Returns the underlying database connection object, ultimately what https://github.com/felixge/node-mysql .createConnection() returns. | ||
@@ -229,0 +229,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24019
374
+ Addedbignumber.js@1.0.1(transitive)
+ Addedmysql@2.0.0-alpha8(transitive)
+ Addedrequire-all@0.0.3(transitive)
- Removedarray-buffer-byte-length@1.0.2(transitive)
- Removedarraybuffer.prototype.slice@1.0.4(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedcall-bind@1.0.8(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedcall-bound@1.0.3(transitive)
- Removeddata-view-buffer@1.0.2(transitive)
- Removeddata-view-byte-length@1.0.2(transitive)
- Removeddata-view-byte-offset@1.0.1(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedes-abstract@1.23.9(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.0.0(transitive)
- Removedes-set-tostringtag@2.1.0(transitive)
- Removedes-to-primitive@1.3.0(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedfunction.prototype.name@1.1.8(transitive)
- Removedfunctions-have-names@1.2.3(transitive)
- Removedget-intrinsic@1.2.7(transitive)
- Removedget-proto@1.0.1(transitive)
- Removedget-symbol-description@1.1.0(transitive)
- Removedglobalthis@1.0.4(transitive)
- Removedgopd@1.2.0(transitive)
- Removedhas-bigints@1.1.0(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.2.0(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhashish@0.0.4(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinternal-slot@1.1.0(transitive)
- Removedis-array-buffer@3.0.5(transitive)
- Removedis-async-function@2.1.0(transitive)
- Removedis-bigint@1.1.0(transitive)
- Removedis-boolean-object@1.2.1(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-data-view@1.0.2(transitive)
- Removedis-date-object@1.1.0(transitive)
- Removedis-finalizationregistry@1.1.1(transitive)
- Removedis-generator-function@1.1.0(transitive)
- Removedis-map@2.0.3(transitive)
- Removedis-number-object@1.1.1(transitive)
- Removedis-regex@1.2.1(transitive)
- Removedis-set@2.0.3(transitive)
- Removedis-shared-array-buffer@1.0.4(transitive)
- Removedis-string@1.1.1(transitive)
- Removedis-symbol@1.1.1(transitive)
- Removedis-typed-array@1.1.15(transitive)
- Removedis-weakmap@2.0.2(transitive)
- Removedis-weakref@1.1.0(transitive)
- Removedis-weakset@2.0.4(transitive)
- Removedisarray@2.0.5(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedmysql@0.9.6(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.7(transitive)
- Removedown-keys@1.0.1(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedreflect.getprototypeof@1.0.10(transitive)
- Removedregexp.prototype.flags@1.5.4(transitive)
- Removedsafe-array-concat@1.1.3(transitive)
- Removedsafe-push-apply@1.0.0(transitive)
- Removedsafe-regex-test@1.1.0(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedset-function-name@2.0.2(transitive)
- Removedset-proto@1.0.0(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)
- Removedstring.prototype.trim@1.2.10(transitive)
- Removedstring.prototype.trimend@1.0.9(transitive)
- Removedstring.prototype.trimstart@1.0.8(transitive)
- Removedtraverse@0.6.10(transitive)
- Removedtyped-array-buffer@1.0.3(transitive)
- Removedtyped-array-byte-length@1.0.3(transitive)
- Removedtyped-array-byte-offset@1.0.4(transitive)
- Removedtyped-array-length@1.0.7(transitive)
- Removedtypedarray.prototype.slice@1.0.5(transitive)
- Removedunbox-primitive@1.1.0(transitive)
- Removedwhich-boxed-primitive@1.1.1(transitive)
- Removedwhich-builtin-type@1.2.1(transitive)
- Removedwhich-collection@1.0.2(transitive)
- Removedwhich-typed-array@1.1.18(transitive)
Updatedmysql@2.0.0-alpha8