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 ad0e3af6
authored
Jan 30, 2014
by
Michael Schonfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change param name to ignoreDuplicates
1 parent
4d17304a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
lib/dao-factory.js
lib/dialects/mysql/query-generator.js
lib/dialects/sqlite/query-generator.js
lib/dao-factory.js
View file @
ad0e3af
...
...
@@ -779,7 +779,7 @@ module.exports = (function() {
options
=
Utils
.
_
.
extend
({
validate
:
false
,
hooks
:
false
,
ignore
:
false
ignore
Duplicates
:
false
},
options
||
{})
if
(
fieldsOrOptions
instanceof
Array
)
{
...
...
lib/dialects/mysql/query-generator.js
View file @
ad0e3af
...
...
@@ -177,7 +177,7 @@ module.exports = (function() {
},
bulkInsertQuery
:
function
(
tableName
,
attrValueHashes
,
options
)
{
var
query
=
"INSERT<%= ignore %> INTO <%= table %> (<%= attributes %>) VALUES <%= tuples %>;"
var
query
=
"INSERT<%= ignore
Duplicates
%> INTO <%= table %> (<%= attributes %>) VALUES <%= tuples %>;"
,
tuples
=
[]
,
allAttributes
=
[]
...
...
@@ -196,7 +196,7 @@ module.exports = (function() {
}.
bind
(
this
))
var
replacements
=
{
ignore
:
options
&&
options
.
ignore
?
' IGNORE'
:
''
,
ignore
Duplicates
:
options
&&
options
.
ignoreDuplicates
?
' IGNORE'
:
''
,
table
:
this
.
quoteIdentifier
(
tableName
),
attributes
:
allAttributes
.
map
(
function
(
attr
){
return
this
.
quoteIdentifier
(
attr
)
...
...
lib/dialects/sqlite/query-generator.js
View file @
ad0e3af
...
...
@@ -173,7 +173,7 @@ module.exports = (function() {
},
bulkInsertQuery
:
function
(
tableName
,
attrValueHashes
,
options
)
{
var
query
=
"INSERT<%= ignore %> INTO <%= table %> (<%= attributes %>) VALUES <%= tuples %>;"
var
query
=
"INSERT<%= ignore
Duplicates
%> INTO <%= table %> (<%= attributes %>) VALUES <%= tuples %>;"
,
tuples
=
[]
,
allAttributes
=
[]
...
...
@@ -192,7 +192,7 @@ module.exports = (function() {
}.
bind
(
this
))
var
replacements
=
{
ignore
:
options
&&
options
.
ignore
?
' OR IGNORE'
:
''
,
ignore
Duplicates
:
options
&&
options
.
ignoreDuplicates
?
' OR IGNORE'
:
''
,
table
:
this
.
quoteIdentifier
(
tableName
),
attributes
:
allAttributes
.
map
(
function
(
attr
){
return
this
.
quoteIdentifier
(
attr
)
...
...
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