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

Commit 74055b22 by Jan Aagaard Meier

Use dialect when calling Utils.format in query gen

1 parent 30037649
......@@ -5,6 +5,7 @@ var Utils = require("../../utils")
module.exports = (function() {
var QueryGenerator = {
dialect: 'mysql',
addSchema: function(opts) {
var tableName
var schema = (!!opts && !!opts.options && !!opts.options.schema ? opts.options.schema : undefined)
......@@ -437,7 +438,7 @@ module.exports = (function() {
} else if (typeof smth === "string") {
result = smth
} else if (Array.isArray(smth)) {
result = Utils.format(smth)
result = Utils.format(smth, this.dialect)
}
return result ? result : '1=1'
......
......@@ -8,6 +8,7 @@ var Utils = require("../../utils")
module.exports = (function() {
var QueryGenerator = {
options: {},
dialect: 'postgres',
addSchema: function(opts) {
var tableName = undefined
......
......@@ -12,6 +12,7 @@ var hashToWhereConditions = MySqlQueryGenerator.hashToWhereConditions
module.exports = (function() {
var QueryGenerator = {
options: {},
dialect: 'sqlite',
addSchema: function(opts) {
var tableName = undefined
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!