不要怂,就是干,撸起袖子干!

Commit 5a9e9c6a by Nick Mitchinson

Hacky solution for inserting arrays of dates in postgres

1 parent 3cc67019
Showing with 7 additions and 1 deletions
...@@ -112,7 +112,13 @@ SqlString.arrayToList = function(array, timeZone, dialect, field) { ...@@ -112,7 +112,13 @@ SqlString.arrayToList = function(array, timeZone, dialect, field) {
} }
var ret = 'ARRAY[' + valstr + ']'; var ret = 'ARRAY[' + valstr + ']';
if (!!field && !!field.type) { 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; return ret;
} else { } else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!