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 a9f8facf
authored
Sep 05, 2013
by
Rob Raux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
postgres requires empty array to be explicitly cast on update
1 parent
3a46e499
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
lib/dialects/postgres/query-generator.js
lib/query-interface.js
lib/dialects/postgres/query-generator.js
View file @
a9f8fac
...
...
@@ -382,7 +382,7 @@ module.exports = (function() {
return
Utils
.
_
.
template
(
query
)(
replacements
)
},
updateQuery
:
function
(
tableName
,
attrValueHash
,
where
,
options
)
{
updateQuery
:
function
(
tableName
,
attrValueHash
,
where
,
options
,
attributes
)
{
attrValueHash
=
Utils
.
removeNullValuesFromHash
(
attrValueHash
,
this
.
options
.
omitNull
,
options
)
var
query
=
"UPDATE <%= table %> SET <%= values %> WHERE <%= where %> RETURNING *"
...
...
@@ -390,7 +390,7 @@ module.exports = (function() {
for
(
var
key
in
attrValueHash
)
{
var
value
=
attrValueHash
[
key
]
values
.
push
(
this
.
quoteIdentifier
(
key
)
+
"="
+
this
.
escape
(
value
))
values
.
push
(
this
.
quoteIdentifier
(
key
)
+
"="
+
this
.
escape
(
value
,
(
!!
attributes
&&
!!
attributes
[
key
]
?
attributes
[
key
]
:
undefined
)
))
}
var
replacements
=
{
...
...
lib/query-interface.js
View file @
a9f8fac
...
...
@@ -417,7 +417,7 @@ module.exports = (function() {
QueryInterface
.
prototype
.
update
=
function
(
dao
,
tableName
,
values
,
identifier
,
options
)
{
var
self
=
this
,
restrict
=
false
,
sql
=
self
.
QueryGenerator
.
updateQuery
(
tableName
,
values
,
identifier
,
options
)
,
sql
=
self
.
QueryGenerator
.
updateQuery
(
tableName
,
values
,
identifier
,
options
,
dao
.
daoFactory
.
rawAttributes
)
// Check for a restrict field
if
(
!!
dao
.
daoFactory
&&
!!
dao
.
daoFactory
.
associations
)
{
...
...
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