Comparing version 2.1.26 to 2.1.27
@@ -0,1 +1,4 @@ | ||
### v2.1.27 | ||
- Fix noisy mysql debug output (#642) | ||
### v2.1.26 | ||
@@ -2,0 +5,0 @@ - Add `instance.saveAssociationsByDefault` setting |
@@ -18,2 +18,3 @@ var _ = require("lodash"); | ||
} | ||
this.query = new Query({ dialect: this.dialect, timezone: this.config.timezone }); | ||
@@ -64,5 +65,15 @@ | ||
Driver.prototype.reconnect = function (cb, connection) { | ||
this.db = (connection ? connection : mysql.createConnection(this.config.href || this.config)); | ||
var connOpts = this.config.href || this.config; | ||
// Prevent noisy mysql driver output | ||
if (typeof connOpts == 'object') { | ||
connOpts = _.omit(connOpts, 'debug'); | ||
} | ||
if (typeof connOpts == 'string') { | ||
connOpts = connOpts.replace("debug=true", "debug=false"); | ||
} | ||
this.db = (connection ? connection : mysql.createConnection(connOpts)); | ||
if (this.opts.pool) { | ||
this.db.pool = (connection ? connection : mysql.createPool(this.config.href || this.config)); | ||
this.db.pool = (connection ? connection : mysql.createPool(connOpts)); | ||
} | ||
@@ -69,0 +80,0 @@ if (typeof cb == "function") { |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version" : "2.1.26", | ||
"version" : "2.1.27", | ||
"license" : "MIT", | ||
@@ -18,0 +18,0 @@ "homepage" : "http://dresende.github.io/node-orm2", |
@@ -274,4 +274,4 @@ ## Object Relational Mapping | ||
var Person = db.define("person", { | ||
firstname : { type: 'string', key: true }, | ||
lastname : { type: 'string', key: true } | ||
firstname : { type: 'text', key: true }, | ||
lastname : { type: 'text', key: true } | ||
}); | ||
@@ -278,0 +278,0 @@ ``` |
236294
6035