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 2aa5a031
authored
May 05, 2014
by
Nick Mitchinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hacky solution for inserting arrays of dates in postgres
1 parent
0121225f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
lib/sql-string.js
lib/sql-string.js
View file @
2aa5a03
...
...
@@ -109,7 +109,13 @@ SqlString.arrayToList = function(array, timeZone, dialect, field) {
}
var
ret
=
'ARRAY['
+
valstr
+
']'
if
(
!!
field
&&
!!
field
.
type
)
{
ret
+=
'::'
+
field
.
type
.
replace
(
/
\(\d
+
\)
/g
,
''
)
// Need to translate DATETIME to TIMESTAMP WITH TIME ZONE for Postgres here
// There has to be a better solution than this
if
(
dialect
==
"postgres"
)
{
ret
+=
'::'
+
field
.
type
.
replace
(
/
\(\d
+
\)
/g
,
''
).
replace
(
/DATETIME/
,
'TIMESTAMP WITH TIME ZONE'
)
}
else
{
ret
+=
'::'
+
field
.
type
.
replace
(
/
\(\d
+
\)
/g
,
''
)
}
}
return
ret
}
else
{
...
...
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