orchid-orm 1.58.7 → 1.58.8
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/migrations/node-postgres.js +3 -8
- package/dist/migrations/node-postgres.js.map +1 -1
- package/dist/migrations/node-postgres.mjs +3 -8
- package/dist/migrations/node-postgres.mjs.map +1 -1
- package/dist/migrations/postgres-js.js +3 -8
- package/dist/migrations/postgres-js.js.map +1 -1
- package/dist/migrations/postgres-js.mjs +3 -8
- package/dist/migrations/postgres-js.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -15,21 +15,16 @@ const compareSqlExpressions = async (tableExpressions, adapter) => {
|
|
|
15
15
|
const viewName = `orchidTmpView${id++}`;
|
|
16
16
|
const values = [];
|
|
17
17
|
const combinedQueries = [
|
|
18
|
-
`SAVEPOINT "${viewName}"`,
|
|
19
18
|
`CREATE TEMPORARY VIEW ${viewName} AS (SELECT ${compare.map(
|
|
20
19
|
({ inDb, inCode }, i) => `${inDb} AS "*inDb-${i}*", ${inCode.map(
|
|
21
20
|
(s, j) => `(${typeof s === "string" ? s : s.toSQL({ values })}) "*inCode-${i}-${j}*"`
|
|
22
21
|
).join(", ")}`
|
|
23
22
|
).join(", ")} FROM ${source})`,
|
|
24
23
|
`SELECT pg_get_viewdef('${viewName}') v`,
|
|
25
|
-
`DROP VIEW ${viewName}
|
|
26
|
-
`RELEASE SAVEPOINT "${viewName}"`
|
|
24
|
+
`DROP VIEW ${viewName}`
|
|
27
25
|
].join("; ");
|
|
28
|
-
const result = await adapter.query(combinedQueries, values).then(
|
|
29
|
-
(res) =>
|
|
30
|
-
const results = res;
|
|
31
|
-
return results.length === 2 ? results[1] : results[2];
|
|
32
|
-
},
|
|
26
|
+
const result = await adapter.query(combinedQueries, values, viewName).then(
|
|
27
|
+
(res) => res[1],
|
|
33
28
|
async (err) => {
|
|
34
29
|
await adapter.query(`ROLLBACK TO SAVEPOINT "${viewName}"`);
|
|
35
30
|
if (err.code !== "42704") {
|