Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 74055b22
authored
Aug 18, 2013
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use dialect when calling Utils.format in query gen
1 parent
30037649
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
1 deletions
lib/dialects/mysql/query-generator.js
lib/dialects/postgres/query-generator.js
lib/dialects/sqlite/query-generator.js
lib/dialects/mysql/query-generator.js
View file @
74055b2
...
@@ -5,6 +5,7 @@ var Utils = require("../../utils")
...
@@ -5,6 +5,7 @@ var Utils = require("../../utils")
module
.
exports
=
(
function
()
{
module
.
exports
=
(
function
()
{
var
QueryGenerator
=
{
var
QueryGenerator
=
{
dialect
:
'mysql'
,
addSchema
:
function
(
opts
)
{
addSchema
:
function
(
opts
)
{
var
tableName
var
tableName
var
schema
=
(
!!
opts
&&
!!
opts
.
options
&&
!!
opts
.
options
.
schema
?
opts
.
options
.
schema
:
undefined
)
var
schema
=
(
!!
opts
&&
!!
opts
.
options
&&
!!
opts
.
options
.
schema
?
opts
.
options
.
schema
:
undefined
)
...
@@ -437,7 +438,7 @@ module.exports = (function() {
...
@@ -437,7 +438,7 @@ module.exports = (function() {
}
else
if
(
typeof
smth
===
"string"
)
{
}
else
if
(
typeof
smth
===
"string"
)
{
result
=
smth
result
=
smth
}
else
if
(
Array
.
isArray
(
smth
))
{
}
else
if
(
Array
.
isArray
(
smth
))
{
result
=
Utils
.
format
(
smth
)
result
=
Utils
.
format
(
smth
,
this
.
dialect
)
}
}
return
result
?
result
:
'1=1'
return
result
?
result
:
'1=1'
...
...
lib/dialects/postgres/query-generator.js
View file @
74055b2
...
@@ -8,6 +8,7 @@ var Utils = require("../../utils")
...
@@ -8,6 +8,7 @@ var Utils = require("../../utils")
module
.
exports
=
(
function
()
{
module
.
exports
=
(
function
()
{
var
QueryGenerator
=
{
var
QueryGenerator
=
{
options
:
{},
options
:
{},
dialect
:
'postgres'
,
addSchema
:
function
(
opts
)
{
addSchema
:
function
(
opts
)
{
var
tableName
=
undefined
var
tableName
=
undefined
...
...
lib/dialects/sqlite/query-generator.js
View file @
74055b2
...
@@ -12,6 +12,7 @@ var hashToWhereConditions = MySqlQueryGenerator.hashToWhereConditions
...
@@ -12,6 +12,7 @@ var hashToWhereConditions = MySqlQueryGenerator.hashToWhereConditions
module
.
exports
=
(
function
()
{
module
.
exports
=
(
function
()
{
var
QueryGenerator
=
{
var
QueryGenerator
=
{
options
:
{},
options
:
{},
dialect
:
'sqlite'
,
addSchema
:
function
(
opts
)
{
addSchema
:
function
(
opts
)
{
var
tableName
=
undefined
var
tableName
=
undefined
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment