@knorm/postgres
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -467,2 +467,3 @@ const { Knorm } = require('@knorm/knorm'); | ||
// TODO: handle duplicate rows in inserted and updated data? | ||
async save(data, options) { | ||
@@ -480,7 +481,13 @@ const inserts = []; | ||
// TODO: handle duplicate rows in inserted and updated? | ||
const inserted = await this.insert(inserts, options); | ||
let inserted = await this.insert(inserts, options); | ||
const updated = await this.update(updates, options); | ||
return inserted.concat(updated); | ||
if (!Array.isArray(inserted)) { | ||
inserted = [inserted]; | ||
} | ||
const rows = inserted.concat(updated); | ||
const first = this.getOption('first'); | ||
return first ? rows[0] : rows; | ||
} | ||
@@ -487,0 +494,0 @@ } |
{ | ||
"name": "@knorm/postgres", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Postgres plugin for knorm", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
93420
2463