@arcote.tech/arc-adapter-db-postgres 0.3.3 → 0.3.4
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.
- package/dist/index.js +13 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5612,11 +5612,19 @@ class PostgreSQLReadWriteTransaction extends PostgreSQLReadTransaction {
|
|
|
5612
5612
|
if (!table) {
|
|
5613
5613
|
throw new Error(`Store ${store} not found`);
|
|
5614
5614
|
}
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5615
|
+
if (this.adapter.hasSoftDelete(store)) {
|
|
5616
|
+
const query = `UPDATE "${table.name}" SET "deleted" = $1, "lastUpdate" = $2 WHERE "${table.primaryKey}" = $3`;
|
|
5617
|
+
this.queries.push({
|
|
5618
|
+
sql: query,
|
|
5619
|
+
params: [true, new Date().toISOString(), id2]
|
|
5620
|
+
});
|
|
5621
|
+
} else {
|
|
5622
|
+
const query = `DELETE FROM "${table.name}" WHERE "${table.primaryKey}" = $1`;
|
|
5623
|
+
this.queries.push({
|
|
5624
|
+
sql: query,
|
|
5625
|
+
params: [id2]
|
|
5626
|
+
});
|
|
5627
|
+
}
|
|
5620
5628
|
}
|
|
5621
5629
|
async set(store, item) {
|
|
5622
5630
|
const table = this.tables.get(store);
|