@saltcorn/postgres 1.4.0-beta.1 → 1.4.0-beta.11

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 +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/postgres",
3
- "version": "1.4.0-beta.1",
3
+ "version": "1.4.0-beta.11",
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": "1.4.0-beta.1",
15
+ "@saltcorn/db-common": "1.4.0-beta.11",
16
16
  "@saltcorn/plain-date": "0.2.5",
17
17
  "pg": "^8.13.1",
18
18
  "pg-copy-streams": "^6.0.6",
package/postgres.js CHANGED
@@ -407,7 +407,7 @@ const drop_unique_constraint = async (table_name, field_names) => {
407
407
  // TBD check that there are no problems with lenght of constraint name
408
408
  const sql = `alter table "${getTenantSchema()}"."${sqlsanitize(
409
409
  table_name
410
- )}" drop CONSTRAINT "${sqlsanitize(table_name)}_${field_names
410
+ )}" drop CONSTRAINT IF EXISTS "${sqlsanitize(table_name)}_${field_names
411
411
  .map((f) => sqlsanitize(f))
412
412
  .join("_")}_unique";`;
413
413
  sql_log(sql);
@@ -626,7 +626,7 @@ const tryCatchInTransaction = async (f, onError) => {
626
626
  return await f();
627
627
  } catch (error) {
628
628
  if (reqCon?.client) await query(`ROLLBACK TO SAVEPOINT sp${rndid}`);
629
- await onError(error);
629
+ return await onError(error);
630
630
  } finally {
631
631
  if (reqCon?.client) await query(`RELEASE SAVEPOINT sp${rndid}`);
632
632
  }