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 72d2737b
authored
May 10, 2013
by
terraflubb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor low-hanging changes to improve jshint performance
1 parent
42a44f10
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
lib/dialects/mysql/query-generator.js
lib/dialects/mysql/query-generator.js
View file @
72d2737
...
...
@@ -15,7 +15,7 @@ var processAndEscapeValue = function(value) {
module
.
exports
=
(
function
()
{
var
QueryGenerator
=
{
addSchema
:
function
(
opts
)
{
var
tableName
=
undefined
var
tableName
var
schema
=
(
!!
opts
&&
!!
opts
.
options
&&
!!
opts
.
options
.
schema
?
opts
.
options
.
schema
:
undefined
)
var
schemaDelimiter
=
(
!!
opts
&&
!!
opts
.
options
&&
!!
opts
.
options
.
schemaDelimiter
?
opts
.
options
.
schemaDelimiter
:
undefined
)
...
...
@@ -141,7 +141,7 @@ module.exports = (function() {
var
query
=
"ALTER TABLE `<%= tableName %>` CHANGE <%= attributes %>;"
var
attrString
=
[]
for
(
attrName
in
attributes
)
{
for
(
var
attrName
in
attributes
)
{
var
definition
=
attributes
[
attrName
]
attrString
.
push
(
Utils
.
_
.
template
(
'`<%= attrName %>` `<%= attrName %>` <%= definition %>'
)({
...
...
@@ -291,7 +291,7 @@ module.exports = (function() {
options
=
options
||
{}
var
table
=
QueryGenerator
.
addQuotes
(
tableName
)
var
where
=
QueryGenerator
.
getWhereConditions
(
where
)
where
=
QueryGenerator
.
getWhereConditions
(
where
)
var
limit
=
""
if
(
Utils
.
_
.
isUndefined
(
options
.
limit
))
{
...
...
@@ -311,7 +311,7 @@ module.exports = (function() {
options
=
options
||
{}
var
table
=
QueryGenerator
.
addQuotes
(
tableName
)
var
where
=
QueryGenerator
.
getWhereConditions
(
where
)
where
=
QueryGenerator
.
getWhereConditions
(
where
)
var
query
=
"DELETE FROM "
+
table
+
" WHERE "
+
where
...
...
@@ -331,8 +331,8 @@ module.exports = (function() {
}
var
table
=
QueryGenerator
.
addQuotes
(
tableName
)
va
r
values
=
values
.
join
(
","
)
var
where
=
QueryGenerator
.
getWhereConditions
(
where
)
va
lues
=
values
.
join
(
","
)
where
=
QueryGenerator
.
getWhereConditions
(
where
)
var
query
=
"UPDATE "
+
table
+
" SET "
+
values
+
" WHERE "
+
where
...
...
@@ -431,7 +431,7 @@ module.exports = (function() {
if
(
Array
.
isArray
(
value
))
{
// is value an array?
if
(
value
.
length
==
0
)
{
value
=
[
null
]
}
if
(
value
.
length
==
=
0
)
{
value
=
[
null
]
}
_value
=
"("
+
value
.
map
(
function
(
subValue
)
{
return
Utils
.
escape
(
subValue
);
}).
join
(
','
)
+
")"
...
...
@@ -481,7 +481,7 @@ module.exports = (function() {
template
+=
" auto_increment"
}
if
((
dataType
.
defaultValue
!=
undefined
)
&&
(
dataType
.
defaultValue
!=
DataTypes
.
NOW
))
{
if
((
dataType
.
defaultValue
!=
=
undefined
)
&&
(
dataType
.
defaultValue
!=
DataTypes
.
NOW
))
{
template
+=
" DEFAULT "
+
Utils
.
escape
(
dataType
.
defaultValue
)
}
...
...
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