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

Commit eb41cdd0 by Jan Aagaard Meier

type flag and isselect refactor

1 parent 92d191d5
......@@ -200,6 +200,10 @@ module.exports = (function() {
var isSelectQuery = function() {
return this.options.type === 'SELECT';
return (this.options.type && this.options.type === "SELECT") || (this.sql.toLowerCase().indexOf('select') === 0)
if (this.options.type !== undefined) return this.options.type === 'SELECT';
return (this.sql.toLowerCase().indexOf('select') === 0)
}
var isUpdateQuery = function() {
......
......@@ -222,7 +222,7 @@ module.exports = (function() {
return new Utils.CustomEventEmitter(function(emitter) {
var sql = self.QueryGenerator.selectQuery(tableName, options)
, qry = self.sequelize.query(sql, null, { plain: true, raw: true })
, qry = self.sequelize.query(sql, null, { plain: true, raw: true, type: 'SELECT' })
qry
.success(function(data) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!