不要怂,就是干,撸起袖子干!

Commit 13b862f2 by Jan Aagaard Meier

specify timezone option instead of typecaster

1 parent 721eef26
......@@ -241,7 +241,8 @@ module.exports = (function() {
port: config.port,
user: config.username,
password: config.password,
database: config.database
database: config.database,
timezone: 'Z'
})
connection.query("SET time_zone = '+0:00'");
// client.setMaxListeners(self.maxConcurrentQueries)
......
......@@ -23,21 +23,13 @@ module.exports = (function() {
this.options.logging('Executing: ' + this.sql)
}
this.client.query({
sql: this.sql,
typeCast: function (field, next) {
if (field.type == 'DATETIME') {
return new Date(field.string()+'Z')
}
return next();
}
}, function(err, results, fields) {
this.client.query(this.sql, function(err, results, fields) {
this.emit('sql', this.sql)
if (err) {
this.emit('error', err, this.callee)
} else {
this.emit('success', this.formatResults(results, fields))
this.emit('success', this.formatResults(results))
}
}.bind(this)).setMaxListeners(100)
return this
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!