@saltcorn/postgres 0.9.5-beta.9 → 0.9.6-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/postgres.js +1 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/postgres",
3
- "version": "0.9.5-beta.9",
3
+ "version": "0.9.6-beta.0",
4
4
  "description": "Postgres structures for Saltcorn, open-source no-code platform",
5
5
  "homepage": "https://saltcorn.com",
6
6
  "scripts": {
@@ -12,7 +12,7 @@
12
12
  "license": "MIT",
13
13
  "main": "index.js",
14
14
  "dependencies": {
15
- "@saltcorn/db-common": "0.9.5-beta.9",
15
+ "@saltcorn/db-common": "0.9.6-beta.0",
16
16
  "pg": "^8.2.1",
17
17
  "pg-copy-streams": "^5.1.1"
18
18
  },
package/postgres.js CHANGED
@@ -190,7 +190,7 @@ const insert = async (tbl, obj, opts = {}) => {
190
190
  var valPosList = [];
191
191
  var valList = [];
192
192
  const schema = opts.schema || getTenantSchema();
193
- let conflict = "";
193
+ const conflict = opts.onConflictDoNothing ? "on conflict do nothing " : "";
194
194
  kvs.forEach(([k, v]) => {
195
195
  if (v && v.next_version_by_id) {
196
196
  valList.push(v.next_version_by_id);
@@ -199,7 +199,6 @@ const insert = async (tbl, obj, opts = {}) => {
199
199
  tbl
200
200
  )}" where id=$${valList.length}), 0)+1`
201
201
  );
202
- if (opts.onConflictDoNothing) conflict = "on conflict do nothing ";
203
202
  } else {
204
203
  valList.push(v);
205
204
  valPosList.push(`$${valList.length}`);