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

Commit 40cd8d97 by Jan Aagaard Meier

Merge pull request #2720 from jpmonette/master

Fixing "error: syntax error at or near ")"" when using upsert with postgres dialect
2 parents eea1c58a c98db629
Showing with 1 additions and 1 deletions
......@@ -355,7 +355,7 @@ module.exports = (function() {
// http://www.maori.geek.nz/post/postgres_upsert_update_or_insert_in_ger_using_knex_js
upsertQuery: function (tableName, insertValues, updateValues, where, rawAttributes, options) {
var insert = this.insertQuery(tableName, insertValues, rawAttributes, options).replace(/VALUES \((.*?)\)/, 'SELECT $1');
var insert = this.insertQuery(tableName, insertValues, rawAttributes, options);
var update = this.updateQuery(tableName, updateValues, where, options, rawAttributes);
// The numbers here are selected to match the number of affected rows returned by MySQL
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!