@prisma/orm-target-sqlite 8.0.0-rc.22-dev.8 → 8.0.0-rc.22-dev.9
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/{adapter-PfKs5Kya.d.mts → adapter-BLfNDWw-.d.mts} +5 -5
- package/dist/{adapter-PfKs5Kya.d.mts.map → adapter-BLfNDWw-.d.mts.map} +1 -1
- package/dist/{adapter-gpb0ICA2-DPjB1dMR.mjs → adapter-gpb0ICA2-Ddnczc5D.mjs} +3 -3
- package/dist/{adapter-gpb0ICA2-DPjB1dMR.mjs.map → adapter-gpb0ICA2-Ddnczc5D.mjs.map} +1 -1
- package/dist/{adapter-xFPDhkod-Cio6up_5.d.mts → adapter-xFPDhkod-DB6XDGgl.d.mts} +3 -3
- package/dist/{adapter-xFPDhkod-Cio6up_5.d.mts.map → adapter-xFPDhkod-DB6XDGgl.d.mts.map} +1 -1
- package/dist/adapter.d.mts +9 -9
- package/dist/adapter.mjs +2 -2
- package/dist/adapter__adapter.d.mts +2 -2
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__codec-types.d.mts +3 -3
- package/dist/adapter__control.d.mts +2 -2
- package/dist/adapter__control.mjs +3 -3
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +3 -3
- package/dist/adapter__sql-renderer.d.mts +2 -2
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +2 -2
- package/dist/{aggregates--0FaH9Te.d.mts → aggregates-DNxUFwla.d.mts} +4 -4
- package/dist/{aggregates--0FaH9Te.d.mts.map → aggregates-DNxUFwla.d.mts.map} +1 -1
- package/dist/{codec-types-CG5ZkqDU-DCx8ZvBg.d.mts → codec-types-CGtSWeZ5-B5RH39BA.d.mts} +3 -3
- package/dist/{codec-types-CG5ZkqDU-DCx8ZvBg.d.mts.map → codec-types-CGtSWeZ5-B5RH39BA.d.mts.map} +1 -1
- package/dist/codec-types-Dx9dQe-Y.d.mts +1 -0
- package/dist/codec-types-IproBv-Q.d.mts +2 -0
- package/dist/{codecs-BqOj4EKm-BaGeNd2m.d.mts → codecs-A0DbaZRE-CMyLhO_K.d.mts} +10 -2
- package/dist/codecs-A0DbaZRE-CMyLhO_K.d.mts.map +1 -0
- package/dist/{codecs-My4bmOU6-D4-b5qLd.mjs → codecs-BSYEsc7M-C4nov_lo.mjs} +10 -2
- package/dist/{codecs-My4bmOU6-D4-b5qLd.mjs.map → codecs-BSYEsc7M-C4nov_lo.mjs.map} +1 -1
- package/dist/{codecs-R3kGRyq2.mjs → codecs-BhRFtE69.mjs} +2 -2
- package/dist/{codecs-R3kGRyq2.mjs.map → codecs-BhRFtE69.mjs.map} +1 -1
- package/dist/codecs-CX5BZUdO.d.mts +1 -0
- package/dist/{control-DXzV_IVS.d.mts → control-Bc3l_1mV.d.mts} +3 -3
- package/dist/{control-DXzV_IVS.d.mts.map → control-Bc3l_1mV.d.mts.map} +1 -1
- package/dist/{descriptor-meta-DrNwC4vO-B9xeeDp9.mjs → descriptor-meta-DrNwC4vO-C_RZ1Tmp.mjs} +2 -2
- package/dist/{descriptor-meta-DrNwC4vO-B9xeeDp9.mjs.map → descriptor-meta-DrNwC4vO-C_RZ1Tmp.mjs.map} +1 -1
- package/dist/{migration-DYyfcQB_.mjs → migration-DBqx2jWN.mjs} +2 -2
- package/dist/{migration-DYyfcQB_.mjs.map → migration-DBqx2jWN.mjs.map} +1 -1
- package/dist/{migration-BHhnGEA2.d.mts → migration-Dekon_QC.d.mts} +3 -3
- package/dist/{migration-BHhnGEA2.d.mts.map → migration-Dekon_QC.d.mts.map} +1 -1
- package/dist/{op-factory-call-BQYECylm-K7S_xgRS.mjs → op-factory-call-Dxsyn5gF-CvHmM-h_.mjs} +506 -21
- package/dist/op-factory-call-Dxsyn5gF-CvHmM-h_.mjs.map +1 -0
- package/dist/{op-factory-call-B8bJlvkP.d.mts → op-factory-call-gQ5ddSys.d.mts} +78 -9
- package/dist/op-factory-call-gQ5ddSys.d.mts.map +1 -0
- package/dist/{pack-CXW0_XyO.d.mts → pack-D3gC0XlT.d.mts} +3 -3
- package/dist/{pack-CXW0_XyO.d.mts.map → pack-D3gC0XlT.d.mts.map} +1 -1
- package/dist/{planner-DNwf8s8s-BoXZwpVs.mjs → planner-DgEGQuj9-Ca6jqWrd.mjs} +111 -64
- package/dist/planner-DgEGQuj9-Ca6jqWrd.mjs.map +1 -0
- package/dist/{planner-DcOz-1na.d.mts → planner-ccevdpwf.d.mts} +2 -2
- package/dist/{planner-DcOz-1na.d.mts.map → planner-ccevdpwf.d.mts.map} +1 -1
- package/dist/{planner-produced-sqlite-migration-DyUPHRKW-CFtZi2VG.d.mts → planner-produced-sqlite-migration-BHH_ftCV-CndNmTrH.d.mts} +3 -3
- package/dist/planner-produced-sqlite-migration-BHH_ftCV-CndNmTrH.d.mts.map +1 -0
- package/dist/{planner-produced-sqlite-migration-Z9OWyjQn-DGMHz6I1.mjs → planner-produced-sqlite-migration-BMogETJ0-COe4tate.mjs} +4 -4
- package/dist/{planner-produced-sqlite-migration-Z9OWyjQn-DGMHz6I1.mjs.map → planner-produced-sqlite-migration-BMogETJ0-COe4tate.mjs.map} +1 -1
- package/dist/planner-produced-sqlite-migration-_n61WaiD.d.mts +1 -0
- package/dist/{render-ops-CJXrOY63-1y0nLsb8.mjs → render-ops-BUk3wlAR-Awdho1_L.mjs} +3 -3
- package/dist/{render-ops-CJXrOY63-1y0nLsb8.mjs.map → render-ops-BUk3wlAR-Awdho1_L.mjs.map} +1 -1
- package/dist/{runtime-BQKQH94p.d.mts → runtime-H_OgXoaz.d.mts} +2 -2
- package/dist/{runtime-BQKQH94p.d.mts.map → runtime-H_OgXoaz.d.mts.map} +1 -1
- package/dist/sql-renderer-_NdIrQuX.d.mts +1 -0
- package/dist/{sqlite-migration-BxQ65pKq-C7siJGuR.mjs → sqlite-migration-B42dCAqX-DiSO-PeZ.mjs} +47 -7
- package/dist/sqlite-migration-B42dCAqX-DiSO-PeZ.mjs.map +1 -0
- package/dist/{sqlite-migration-CcXBptQr-DlKSNedI.d.mts → sqlite-migration-C_9TPlLD-DtKN8bi9.d.mts} +52 -4
- package/dist/sqlite-migration-C_9TPlLD-DtKN8bi9.d.mts.map +1 -0
- package/dist/{tables-C9afyQN9-CkIhVNYn.d.mts → tables-BY3u6rl_-Coqqy4JK.d.mts} +11 -3
- package/dist/tables-BY3u6rl_-Coqqy4JK.d.mts.map +1 -0
- package/dist/target.d.mts +13 -13
- package/dist/target.mjs +9 -9
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__codec-types.d.mts +3 -3
- package/dist/target__codecs.d.mts +2 -2
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__control.mjs +52 -32
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__migration.d.mts +2 -2
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.d.mts +2 -2
- package/dist/target__op-factory-call.mjs +2 -2
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__planner-produced-sqlite-migration.d.mts +2 -2
- package/dist/target__planner-produced-sqlite-migration.mjs +1 -1
- package/dist/target__planner.d.mts +1 -1
- package/dist/target__planner.mjs +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/{types-DpDK9e9U.d.mts → types-28E593y9.d.mts} +1 -1
- package/package.json +10 -10
- package/dist/codec-types-BQCSRfvR.d.mts +0 -1
- package/dist/codec-types-YpVaNlY0.d.mts +0 -2
- package/dist/codecs-BqOj4EKm-BaGeNd2m.d.mts.map +0 -1
- package/dist/codecs-DzkRnjjE.d.mts +0 -1
- package/dist/op-factory-call-B8bJlvkP.d.mts.map +0 -1
- package/dist/op-factory-call-BQYECylm-K7S_xgRS.mjs.map +0 -1
- package/dist/planner-DNwf8s8s-BoXZwpVs.mjs.map +0 -1
- package/dist/planner-produced-sqlite-migration-DxyN096L.d.mts +0 -1
- package/dist/planner-produced-sqlite-migration-DyUPHRKW-CFtZi2VG.d.mts.map +0 -1
- package/dist/sql-renderer-CgY2Sghp.d.mts +0 -1
- package/dist/sqlite-migration-BxQ65pKq-C7siJGuR.mjs.map +0 -1
- package/dist/sqlite-migration-CcXBptQr-DlKSNedI.d.mts.map +0 -1
- package/dist/tables-C9afyQN9-CkIhVNYn.d.mts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as JsonValue$1 } from "./codecs-
|
|
2
|
-
import { t as CodecTypes } from "./codec-types-
|
|
3
|
-
import "./codec-types-
|
|
1
|
+
import { t as JsonValue$1 } from "./codecs-A0DbaZRE-CMyLhO_K.mjs";
|
|
2
|
+
import { t as CodecTypes } from "./codec-types-CGtSWeZ5-B5RH39BA.mjs";
|
|
3
|
+
import "./codec-types-IproBv-Q.mjs";
|
|
4
4
|
export { CodecTypes, type JsonValue$1 as JsonValue };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as sqliteDatetimeColumn, B as sqliteTimeTemporalColumn, C as sqliteBigintColumn, D as sqliteCodecRegistry, E as sqliteCodecDescriptorRegistry, F as sqliteJsonColumn, I as sqliteNowExpressionFor, L as sqliteRealColumn, M as sqliteDatetimeTemporalColumn, N as sqliteDurationStringColumn, O as sqliteDateStringColumn, P as sqliteIntegerColumn, R as sqliteTextColumn, S as jsonDocumentRetag, T as sqliteBlobColumn, _ as SqliteTimeStringDescriptor, a as SqliteBlobDescriptor, b as createSqliteBuiltinCodecLookup, c as SqliteDateTemporalDescriptor, d as SqliteDatetimeTemporalDescriptor, f as SqliteDurationStringDescriptor, g as SqliteTextDescriptor, h as SqliteRealDescriptor, i as SqliteBigintNumberDescriptor, j as sqliteDatetimeStringColumn, k as sqliteDateTemporalColumn, l as SqliteDatetimeDescriptor, m as SqliteJsonDescriptor, n as SQLITE_NOW_EXPRESSION, o as SqliteCodecRegistry, p as SqliteIntegerDescriptor, r as SqliteBigintDescriptor, s as SqliteDateStringDescriptor, t as JsonValue$1, u as SqliteDatetimeStringDescriptor, v as SqliteTimeTemporalDescriptor, w as sqliteBigintNumberColumn, x as createSqliteCodecRegistryWithBuiltins, y as assembleSqliteCodecRegistry, z as sqliteTimeStringColumn } from "./codecs-
|
|
2
|
-
import "./codecs-
|
|
1
|
+
import { A as sqliteDatetimeColumn, B as sqliteTimeTemporalColumn, C as sqliteBigintColumn, D as sqliteCodecRegistry, E as sqliteCodecDescriptorRegistry, F as sqliteJsonColumn, I as sqliteNowExpressionFor, L as sqliteRealColumn, M as sqliteDatetimeTemporalColumn, N as sqliteDurationStringColumn, O as sqliteDateStringColumn, P as sqliteIntegerColumn, R as sqliteTextColumn, S as jsonDocumentRetag, T as sqliteBlobColumn, _ as SqliteTimeStringDescriptor, a as SqliteBlobDescriptor, b as createSqliteBuiltinCodecLookup, c as SqliteDateTemporalDescriptor, d as SqliteDatetimeTemporalDescriptor, f as SqliteDurationStringDescriptor, g as SqliteTextDescriptor, h as SqliteRealDescriptor, i as SqliteBigintNumberDescriptor, j as sqliteDatetimeStringColumn, k as sqliteDateTemporalColumn, l as SqliteDatetimeDescriptor, m as SqliteJsonDescriptor, n as SQLITE_NOW_EXPRESSION, o as SqliteCodecRegistry, p as SqliteIntegerDescriptor, r as SqliteBigintDescriptor, s as SqliteDateStringDescriptor, t as JsonValue$1, u as SqliteDatetimeStringDescriptor, v as SqliteTimeTemporalDescriptor, w as sqliteBigintNumberColumn, x as createSqliteCodecRegistryWithBuiltins, y as assembleSqliteCodecRegistry, z as sqliteTimeStringColumn } from "./codecs-A0DbaZRE-CMyLhO_K.mjs";
|
|
2
|
+
import "./codecs-CX5BZUdO.mjs";
|
|
3
3
|
export { type JsonValue$1 as JsonValue, SQLITE_NOW_EXPRESSION, type SqliteBigintDescriptor, type SqliteBigintNumberDescriptor, type SqliteBlobDescriptor, type SqliteCodecRegistry, type SqliteDateStringDescriptor, type SqliteDateTemporalDescriptor, type SqliteDatetimeDescriptor, type SqliteDatetimeStringDescriptor, type SqliteDatetimeTemporalDescriptor, type SqliteDurationStringDescriptor, type SqliteIntegerDescriptor, type SqliteJsonDescriptor, type SqliteRealDescriptor, type SqliteTextDescriptor, type SqliteTimeStringDescriptor, type SqliteTimeTemporalDescriptor, assembleSqliteCodecRegistry, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins, jsonDocumentRetag, sqliteBigintColumn, sqliteBigintNumberColumn, sqliteBlobColumn, sqliteCodecDescriptorRegistry, sqliteCodecRegistry, sqliteDateStringColumn, sqliteDateTemporalColumn, sqliteDatetimeColumn, sqliteDatetimeStringColumn, sqliteDatetimeTemporalColumn, sqliteDurationStringColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteNowExpressionFor, sqliteRealColumn, sqliteTextColumn, sqliteTimeStringColumn, sqliteTimeTemporalColumn };
|
package/dist/target__codecs.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as sqliteTimeStringColumn, a as sqliteBigintNumberColumn, c as sqliteDateTemporalColumn, d as sqliteDatetimeTemporalColumn, f as sqliteDurationStringColumn, g as sqliteTextColumn, h as sqliteRealColumn, i as sqliteBigintColumn, l as sqliteDatetimeColumn, m as sqliteJsonColumn, o as sqliteBlobColumn, p as sqliteIntegerColumn, r as jsonDocumentRetag, s as sqliteDateStringColumn, u as sqliteDatetimeStringColumn, v as sqliteTimeTemporalColumn } from "./codecs-
|
|
1
|
+
import { _ as sqliteTimeStringColumn, a as sqliteBigintNumberColumn, c as sqliteDateTemporalColumn, d as sqliteDatetimeTemporalColumn, f as sqliteDurationStringColumn, g as sqliteTextColumn, h as sqliteRealColumn, i as sqliteBigintColumn, l as sqliteDatetimeColumn, m as sqliteJsonColumn, o as sqliteBlobColumn, p as sqliteIntegerColumn, r as jsonDocumentRetag, s as sqliteDateStringColumn, u as sqliteDatetimeStringColumn, v as sqliteTimeTemporalColumn } from "./codecs-BSYEsc7M-C4nov_lo.mjs";
|
|
2
2
|
import { o as sqliteNowExpressionFor, r as SQLITE_NOW_EXPRESSION } from "./datetime-text-CbgLX4q3-BKp563Ja.mjs";
|
|
3
|
-
import { a as sqliteCodecRegistry, i as sqliteCodecDescriptorRegistry, n as createSqliteBuiltinCodecLookup, r as createSqliteCodecRegistryWithBuiltins, t as assembleSqliteCodecRegistry } from "./codecs-
|
|
3
|
+
import { a as sqliteCodecRegistry, i as sqliteCodecDescriptorRegistry, n as createSqliteBuiltinCodecLookup, r as createSqliteCodecRegistryWithBuiltins, t as assembleSqliteCodecRegistry } from "./codecs-BhRFtE69.mjs";
|
|
4
4
|
export { SQLITE_NOW_EXPRESSION, assembleSqliteCodecRegistry, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins, jsonDocumentRetag, sqliteBigintColumn, sqliteBigintNumberColumn, sqliteBlobColumn, sqliteCodecDescriptorRegistry, sqliteCodecRegistry, sqliteDateStringColumn, sqliteDateTemporalColumn, sqliteDatetimeColumn, sqliteDatetimeStringColumn, sqliteDatetimeTemporalColumn, sqliteDurationStringColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteNowExpressionFor, sqliteRealColumn, sqliteTextColumn, sqliteTimeStringColumn, sqliteTimeTemporalColumn };
|
package/dist/target__control.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import { c as sqliteError } from "./errors-D9vZNPSI-DoNmdfv7.mjs";
|
|
|
2
2
|
import { n as sqliteTargetDescriptorMeta, t as sqliteScalarTypeConstructors } from "./descriptor-meta-BwJWbIVt-B24ey04f.mjs";
|
|
3
3
|
import { r as quoteIdentifier } from "./sql-utils-C9blmi9x-B90QedVA.mjs";
|
|
4
4
|
import { t as SqliteContractSerializer } from "./sqlite-contract-view-DJhc7pI7-Db5l4qrA.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { b as verifySqliteDatabaseSchema, h as sqliteContractToSchema, o as diffSqliteSchema } from "./sqlite-migration-
|
|
7
|
-
import { n as createSqliteMigrationPlanner, r as
|
|
5
|
+
import { C as holdingStoredValue, E as rebuiltTableName, S as conversionCopyOf, y as affinityStorageClasses } from "./op-factory-call-Dxsyn5gF-CvHmM-h_.mjs";
|
|
6
|
+
import { b as verifySqliteDatabaseSchema, h as sqliteContractToSchema, o as diffSqliteSchema } from "./sqlite-migration-B42dCAqX-DiSO-PeZ.mjs";
|
|
7
|
+
import { i as sqliteStoredValueCallClasses, n as createSqliteMigrationPlanner, r as sqliteMarkedRemoval } from "./planner-DgEGQuj9-Ca6jqWrd.mjs";
|
|
8
8
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
9
9
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
10
10
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
@@ -12,7 +12,7 @@ import { setFallbackTemporal } from "@prisma/orm-framework/type-implementations/
|
|
|
12
12
|
import { APP_SPACE_ID, failedPostcheckWhy, failedPrecheckWhy, schemaCheckWhy, withDatabaseUnchanged, withFailingSpace } from "@prisma/orm-framework/components/control";
|
|
13
13
|
import { SqlStorage } from "@prisma/orm-family-sql/contract/types";
|
|
14
14
|
import { SqlSchemaVerifierBase } from "@prisma/orm-family-sql/family/ir";
|
|
15
|
-
import { convertedColumnOf, fieldOfColumn, requiredColumnsOfMigration,
|
|
15
|
+
import { convertedColumnOf, fieldOfColumn, keepRowsEdit, removalsOfMigration, requiredColumnsOfMigration, rowsHoldingValueFailure, rowsHoldingValueOf, rowsWithoutValueFailure, runnerFailure, runnerSuccess, sqlTypeLookupsOf, unconvertedFieldOf } from "@prisma/orm-family-sql/family/control";
|
|
16
16
|
import { relationalNodeEntityKind, relationalNodeGranularity } from "@prisma/orm-family-sql/schema-ir/types";
|
|
17
17
|
import { notOk, ok, okVoid } from "@prisma/orm-framework/utils/result";
|
|
18
18
|
import { Temporal } from "temporal-polyfill/full/implementation";
|
|
@@ -169,7 +169,7 @@ var SqliteMigrationRunner = class {
|
|
|
169
169
|
const result = await driver.query("PRAGMA foreign_key_check");
|
|
170
170
|
if (result.rows.length === 0) return okVoid();
|
|
171
171
|
return runnerFailure("MIGRATION.FOREIGN_KEY_VIOLATION", `Foreign key integrity check failed after migration: ${result.rows.length} violation(s).`, {
|
|
172
|
-
why:
|
|
172
|
+
why: `PRAGMA foreign_key_check reported violations after the migration ran with foreign keys off: ${violatedReferences(result.rows)} rows that a recreate-table or deleteRows operation removed, and no cascade ran. Delete or change the referencing rows first.`,
|
|
173
173
|
meta: { violations: result.rows }
|
|
174
174
|
});
|
|
175
175
|
}
|
|
@@ -192,7 +192,9 @@ var SqliteMigrationRunner = class {
|
|
|
192
192
|
if (runPrechecks) {
|
|
193
193
|
const precheckResult = await this.runExpectationSteps(driver, operation.precheck, operation, "precheck", {
|
|
194
194
|
contract: options.destinationContract,
|
|
195
|
-
operationIndex: ops.indexOf(operation)
|
|
195
|
+
operationIndex: ops.indexOf(operation),
|
|
196
|
+
operations: ops,
|
|
197
|
+
edges: options.migrationEdges
|
|
196
198
|
});
|
|
197
199
|
if (!precheckResult.ok) return precheckResult;
|
|
198
200
|
}
|
|
@@ -206,7 +208,9 @@ var SqliteMigrationRunner = class {
|
|
|
206
208
|
if (runPostchecks) {
|
|
207
209
|
const postcheckResult = await this.runExpectationSteps(driver, operation.postcheck, operation, "postcheck", {
|
|
208
210
|
contract: options.destinationContract,
|
|
209
|
-
operationIndex: ops.indexOf(operation)
|
|
211
|
+
operationIndex: ops.indexOf(operation),
|
|
212
|
+
operations: ops,
|
|
213
|
+
edges: options.migrationEdges
|
|
210
214
|
});
|
|
211
215
|
if (!postcheckResult.ok) return postcheckResult;
|
|
212
216
|
}
|
|
@@ -239,12 +243,12 @@ var SqliteMigrationRunner = class {
|
|
|
239
243
|
description: step.description,
|
|
240
244
|
...ifDefined("expectation", step.expectation)
|
|
241
245
|
};
|
|
242
|
-
const holding = phase === "precheck" && plan !== void 0 ? await this.rowsHoldingValue(driver, step, operation, plan
|
|
246
|
+
const holding = phase === "precheck" && plan !== void 0 ? await this.rowsHoldingValue(driver, step, operation, plan) : void 0;
|
|
243
247
|
if (holding !== void 0) return runnerFailure(code, holding.summary, {
|
|
244
248
|
why: `Operation ${operation.id} failed during ${phase}: ${step.description}`,
|
|
245
249
|
meta: {
|
|
246
250
|
failedCheck,
|
|
247
|
-
rowsHoldingValue: holding.
|
|
251
|
+
rowsHoldingValue: holding.reports
|
|
248
252
|
}
|
|
249
253
|
});
|
|
250
254
|
const unconverted = converted === void 0 ? void 0 : await this.unconvertedValueText(driver, converted);
|
|
@@ -271,31 +275,28 @@ var SqliteMigrationRunner = class {
|
|
|
271
275
|
}
|
|
272
276
|
/**
|
|
273
277
|
* Counts the rows that hold the stored value a removal check guards, as `rowsHoldingValueMeta`
|
|
274
|
-
* marks the check
|
|
278
|
+
* marks the check, then those of every other removal of its migration whose check fails. A count
|
|
279
|
+
* of the failed check that fails leaves the failure without it.
|
|
275
280
|
*/
|
|
276
|
-
|
|
281
|
+
rowsHoldingValue(driver, step, operation, plan) {
|
|
277
282
|
const mark = rowsHoldingValueOf(step);
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
operationIndex,
|
|
296
|
-
keepDataEdit: keepRowsEdit(details.table, details.name, mark)
|
|
297
|
-
}
|
|
298
|
-
};
|
|
283
|
+
if (mark === void 0) return Promise.resolve(void 0);
|
|
284
|
+
return rowsHoldingValueFailure({
|
|
285
|
+
failed: {
|
|
286
|
+
operation,
|
|
287
|
+
operationIndex: plan.operationIndex,
|
|
288
|
+
check: step,
|
|
289
|
+
mark
|
|
290
|
+
},
|
|
291
|
+
others: removalsOfMigration(plan.operations, plan.edges, plan.operationIndex),
|
|
292
|
+
checkFails: async ({ check }) => !this.stepResultIsTrue((await driver.query(check.sql, check.params ?? [])).rows),
|
|
293
|
+
count: async ({ mark: counted }) => {
|
|
294
|
+
const holding = holdingStoredValue(counted.column, counted.storedValue, counted.path);
|
|
295
|
+
const rows = await driver.query(`SELECT COUNT(*) AS rows FROM ${quoteIdentifier(counted.table)} WHERE ${holding.condition}`, holding.params);
|
|
296
|
+
return Number(rows.rows[0]?.rows ?? 0);
|
|
297
|
+
},
|
|
298
|
+
keepDataEdit: ({ mark: kept }) => keepRowsEdit(sqliteMarkedRemoval(kept), kept, sqliteStoredValueCallClasses)
|
|
299
|
+
});
|
|
299
300
|
}
|
|
300
301
|
/** Names the first value of a retyped column that kept a storage class its new type does not hold. */
|
|
301
302
|
async unconvertedValueText(driver, cast) {
|
|
@@ -544,6 +545,25 @@ var SqliteMigrationRunner = class {
|
|
|
544
545
|
await driver.query(statement.sql, statement.params);
|
|
545
546
|
}
|
|
546
547
|
};
|
|
548
|
+
/** The rows `PRAGMA foreign_key_check` reports, as how many rows of each table reference rows of another. */
|
|
549
|
+
function violatedReferences(rows) {
|
|
550
|
+
const counts = /* @__PURE__ */ new Map();
|
|
551
|
+
for (const row of rows) {
|
|
552
|
+
const table = String(row["table"]);
|
|
553
|
+
const parent = String(row["parent"]);
|
|
554
|
+
const key = JSON.stringify([table, parent]);
|
|
555
|
+
const counted = counts.get(key) ?? {
|
|
556
|
+
table,
|
|
557
|
+
parent,
|
|
558
|
+
rows: 0
|
|
559
|
+
};
|
|
560
|
+
counts.set(key, {
|
|
561
|
+
...counted,
|
|
562
|
+
rows: counted.rows + 1
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
return [...counts.values()].map(({ table, parent, rows: count }) => `${count} ${count === 1 ? "row" : "rows"} of "${table}" ${count === 1 ? "references" : "reference"} "${parent}"`).join(", ");
|
|
566
|
+
}
|
|
547
567
|
/**
|
|
548
568
|
* SQLite target `SchemaVerifier` concretion. Mirrors the Postgres
|
|
549
569
|
* shape: hooks return the empty list pending the call-site migration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target__control.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/control.mjs"],"sourcesContent":["import { c as sqliteError } from \"./errors-D9vZNPSI.mjs\";\nimport { n as sqliteScalarTypeConstructors, t as sqliteTargetDescriptorMeta } from \"./descriptor-meta-BwJWbIVt.mjs\";\nimport { r as quoteIdentifier } from \"./sql-utils-C9blmi9x.mjs\";\nimport { n as SqliteContractSerializer } from \"./sqlite-contract-view-DJhc7pI7.mjs\";\nimport { _ as diffSqliteSchema, b as verifySqliteDatabaseSchema, y as sqliteContractToSchema } from \"./sqlite-migration-BxQ65pKq.mjs\";\nimport { b as rebuiltTableName, g as affinityStorageClasses, y as conversionCopyOf } from \"./op-factory-call-BQYECylm.mjs\";\nimport { n as createSqliteMigrationPlanner, r as keepRowsEdit } from \"./planner-DNwf8s8s.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { setFallbackTemporal } from \"@internal/type-implementations/temporal\";\nimport { APP_SPACE_ID, failedPostcheckWhy, failedPrecheckWhy, schemaCheckWhy, withDatabaseUnchanged, withFailingSpace } from \"@internal/framework-components/control\";\nimport { convertedColumnOf, fieldOfColumn, requiredColumnsOfMigration, rowsHoldingValueOf, rowsHoldingValueSummary, rowsWithoutValueFailure, runnerFailure, runnerSuccess, sqlTypeLookupsOf, unconvertedFieldOf } from \"@internal/family-sql/control\";\nimport { SqlStorage } from \"@internal/sql-contract/types\";\nimport { relationalNodeEntityKind, relationalNodeGranularity } from \"@internal/sql-schema-ir/types\";\nimport { Temporal } from \"temporal-polyfill/full/implementation\";\nimport { SqlSchemaVerifierBase } from \"@internal/family-sql/ir\";\nimport { notOk, ok, okVoid } from \"@internal/utils/result\";\nimport { SqlConnectionError, SqlQueryError } from \"@internal/sql-errors\";\n//#region src/core/migrations/runner.ts\nconst NOT_NULL_VIOLATION_SQLSTATE = \"23502\";\nfunction createSqliteMigrationRunner(family) {\n\treturn new SqliteMigrationRunner(family);\n}\nvar SqliteMigrationRunner = class {\n\tfamily;\n\tconstructor(family) {\n\t\tthis.family = family;\n\t}\n\t/**\n\t* Apply the plan against an already-open connection without managing\n\t* the transaction lifecycle. The caller ({@link SqliteMigrationRunner.execute})\n\t* owns BEGIN/COMMIT/ROLLBACK and any connection-level setup (FK pragma\n\t* toggle, FK integrity check).\n\t*/\n\tasync executeOnConnection(options) {\n\t\tconst driver = options.driver;\n\t\tif (options.space !== void 0 && options.space !== options.plan.spaceId) throw sqliteError(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", `SqlMigrationRunner: options.space (${options.space}) does not match plan.spaceId (${options.plan.spaceId})`, { meta: {\n\t\t\tspace: options.space,\n\t\t\tplanSpaceId: options.plan.spaceId\n\t\t} });\n\t\tconst space = options.plan.spaceId;\n\t\tconst planOps = blindCast(await Promise.all(options.plan.operations));\n\t\tconst destinationCheck = this.ensurePlanMatchesDestinationContract(options.plan.destination, options.destinationContract);\n\t\tif (!destinationCheck.ok) return destinationCheck;\n\t\tconst policyCheck = this.enforcePolicyCompatibility(options.policy, planOps);\n\t\tif (!policyCheck.ok) return policyCheck;\n\t\tconst ensureResult = await this.ensureControlTables(driver, options.destinationContract);\n\t\tif (!ensureResult.ok) return ensureResult;\n\t\tconst existingMarker = await this.family.readMarker({\n\t\t\tdriver,\n\t\t\tspace\n\t\t});\n\t\tconst markerCheck = this.ensureMarkerCompatibility(existingMarker, options.plan);\n\t\tif (!markerCheck.ok) return markerCheck;\n\t\tconst markerAtDestination = this.markerMatchesDestination(existingMarker, options.plan);\n\t\tconst isSelfEdge = options.plan.origin?.storageHash === options.plan.destination.storageHash;\n\t\tconst skipOperations = markerAtDestination && options.plan.origin != null && !isSelfEdge;\n\t\tlet operationsExecuted;\n\t\tlet executedOperations;\n\t\tif (skipOperations) {\n\t\t\toperationsExecuted = 0;\n\t\t\texecutedOperations = [];\n\t\t} else {\n\t\t\tconst applyResult = await this.applyPlan(driver, options, planOps);\n\t\t\tif (!applyResult.ok) return applyResult;\n\t\t\toperationsExecuted = applyResult.value.operationsExecuted;\n\t\t\texecutedOperations = applyResult.value.executedOperations;\n\t\t}\n\t\tif (space === APP_SPACE_ID) {\n\t\t\tconst schemaNode = await this.family.introspect({\n\t\t\t\tdriver,\n\t\t\t\tcontract: options.destinationContract\n\t\t\t});\n\t\t\tconst schemaVerifyResult = verifySqliteDatabaseSchema({\n\t\t\t\tcontract: options.destinationContract,\n\t\t\t\tactualSchema: schemaNode,\n\t\t\t\tstrict: options.strictVerification ?? true,\n\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t});\n\t\t\tif (!schemaVerifyResult.ok) return runnerFailure(\"MIGRATION.SCHEMA_VERIFY_FAILED\", schemaVerifyResult.summary, {\n\t\t\t\twhy: schemaCheckWhy(schemaVerifyResult.schema.issues),\n\t\t\t\tmeta: { schemaIssues: schemaVerifyResult.schema.issues }\n\t\t\t});\n\t\t}\n\t\tconst incomingInvariants = options.plan.providedInvariants;\n\t\tconst existingInvariants = new Set(existingMarker?.invariants ?? []);\n\t\tconst incomingIsSubsetOfExisting = incomingInvariants.every((id) => existingInvariants.has(id));\n\t\tif (!(isSelfEdge && operationsExecuted === 0 && incomingIsSubsetOfExisting)) {\n\t\t\tconst markerResult = await this.upsertMarker(driver, options, existingMarker, space);\n\t\t\tif (!markerResult.ok) return markerResult;\n\t\t\tawait this.recordLedgerEntries(driver, options, executedOperations);\n\t\t}\n\t\treturn runnerSuccess({\n\t\t\toperationsPlanned: planOps.length,\n\t\t\toperationsExecuted\n\t\t});\n\t}\n\tasync execute(options) {\n\t\tconst driver = options.driver;\n\t\tconst perSpaceOptions = options.perSpaceOptions;\n\t\tif (perSpaceOptions.length === 0) return ok({ perSpaceResults: [] });\n\t\tconst fkWasEnabled = await this.readForeignKeysEnabled(driver);\n\t\tif (fkWasEnabled) await driver.query(\"PRAGMA foreign_keys = OFF\");\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await this.executeInTransaction(driver, perSpaceOptions, fkWasEnabled);\n\t\t} catch (error) {\n\t\t\tif (fkWasEnabled) await this.afterFailure(driver.query(\"PRAGMA foreign_keys = ON\"));\n\t\t\tthrow error;\n\t\t}\n\t\tif (fkWasEnabled) {\n\t\t\tconst restore = driver.query(\"PRAGMA foreign_keys = ON\");\n\t\t\tawait (result.ok ? restore : this.afterFailure(restore));\n\t\t}\n\t\treturn result;\n\t}\n\tasync executeInTransaction(driver, perSpaceOptions, fkWasEnabled) {\n\t\tawait this.beginExclusiveTransaction(driver);\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await this.executeSpaces(driver, perSpaceOptions, fkWasEnabled);\n\t\t} catch (error) {\n\t\t\tawait this.afterFailure(this.rollbackTransaction(driver));\n\t\t\tthrow error;\n\t\t}\n\t\tif (!result.ok) {\n\t\t\tawait this.afterFailure(this.rollbackTransaction(driver));\n\t\t\treturn notOk(withDatabaseUnchanged(result.failure, true));\n\t\t}\n\t\ttry {\n\t\t\tawait this.commitTransaction(driver);\n\t\t} catch (error) {\n\t\t\tawait this.afterFailure(this.rollbackTransaction(driver));\n\t\t\tthrow error;\n\t\t}\n\t\treturn result;\n\t}\n\tasync afterFailure(cleanup) {\n\t\tawait cleanup.catch(() => void 0);\n\t}\n\tasync executeSpaces(driver, perSpaceOptions, fkWasEnabled) {\n\t\tconst perSpaceResults = [];\n\t\tlet lastProcessedSpace;\n\t\tfor (const spaceOptions of perSpaceOptions) {\n\t\t\tconst space = spaceOptions.space ?? spaceOptions.plan.spaceId;\n\t\t\tconst result = await this.executeOnConnection({\n\t\t\t\t...spaceOptions,\n\t\t\t\tdriver,\n\t\t\t\tspace\n\t\t\t});\n\t\t\tif (!result.ok) return notOk(withFailingSpace(result.failure, space));\n\t\t\tperSpaceResults.push({\n\t\t\t\tspace,\n\t\t\t\tvalue: result.value\n\t\t\t});\n\t\t\tlastProcessedSpace = space;\n\t\t}\n\t\tif (fkWasEnabled) {\n\t\t\tconst fkIntegrityCheck = await this.verifyForeignKeyIntegrity(driver);\n\t\t\tif (!fkIntegrityCheck.ok) return notOk(withFailingSpace(fkIntegrityCheck.failure, lastProcessedSpace ?? APP_SPACE_ID));\n\t\t}\n\t\treturn ok({ perSpaceResults });\n\t}\n\tasync readForeignKeysEnabled(driver) {\n\t\treturn (await driver.query(\"PRAGMA foreign_keys\")).rows[0]?.foreign_keys === 1;\n\t}\n\tasync verifyForeignKeyIntegrity(driver) {\n\t\tconst result = await driver.query(\"PRAGMA foreign_key_check\");\n\t\tif (result.rows.length === 0) return okVoid();\n\t\treturn runnerFailure(\"MIGRATION.FOREIGN_KEY_VIOLATION\", `Foreign key integrity check failed after migration: ${result.rows.length} violation(s).`, {\n\t\t\twhy: \"PRAGMA foreign_key_check reported violations after applying recreate-table operations.\",\n\t\t\tmeta: { violations: result.rows }\n\t\t});\n\t}\n\tasync applyPlan(driver, options, ops) {\n\t\tconst checks = options.executionChecks;\n\t\tconst runPrechecks = checks?.prechecks !== false;\n\t\tconst runPostchecks = checks?.postchecks !== false;\n\t\tconst runIdempotency = checks?.idempotencyChecks !== false;\n\t\tlet operationsExecuted = 0;\n\t\tconst executedOperations = [];\n\t\tfor (const operation of ops) {\n\t\t\toptions.callbacks?.onOperationStart?.(operation);\n\t\t\ttry {\n\t\t\t\tif (runPostchecks && runIdempotency) {\n\t\t\t\t\tif (await this.expectationsAreSatisfied(driver, operation.postcheck)) {\n\t\t\t\t\t\texecutedOperations.push(this.createSkipRecord(operation));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (runPrechecks) {\n\t\t\t\t\tconst precheckResult = await this.runExpectationSteps(driver, operation.precheck, operation, \"precheck\", {\n\t\t\t\t\t\tcontract: options.destinationContract,\n\t\t\t\t\t\toperationIndex: ops.indexOf(operation)\n\t\t\t\t\t});\n\t\t\t\t\tif (!precheckResult.ok) return precheckResult;\n\t\t\t\t}\n\t\t\t\tconst executeResult = await this.runExecuteSteps(driver, operation.execute, operation, {\n\t\t\t\t\tcontract: options.destinationContract,\n\t\t\t\t\toperationIndex: ops.indexOf(operation),\n\t\t\t\t\toperations: ops,\n\t\t\t\t\tedges: options.migrationEdges\n\t\t\t\t});\n\t\t\t\tif (!executeResult.ok) return executeResult;\n\t\t\t\tif (runPostchecks) {\n\t\t\t\t\tconst postcheckResult = await this.runExpectationSteps(driver, operation.postcheck, operation, \"postcheck\", {\n\t\t\t\t\t\tcontract: options.destinationContract,\n\t\t\t\t\t\toperationIndex: ops.indexOf(operation)\n\t\t\t\t\t});\n\t\t\t\t\tif (!postcheckResult.ok) return postcheckResult;\n\t\t\t\t}\n\t\t\t\texecutedOperations.push(operation);\n\t\t\t\toperationsExecuted += 1;\n\t\t\t} finally {\n\t\t\t\toptions.callbacks?.onOperationComplete?.(operation);\n\t\t\t}\n\t\t}\n\t\treturn ok({\n\t\t\toperationsExecuted,\n\t\t\texecutedOperations\n\t\t});\n\t}\n\tasync ensureControlTables(driver, contract) {\n\t\tconst lowererContext = { contract };\n\t\tfor (const query of this.family.bootstrapControlTableQueries()) await this.executeStatement(driver, await this.family.lowerAst(query, lowererContext));\n\t\treturn okVoid();\n\t}\n\tasync runExpectationSteps(driver, steps, operation, phase, plan) {\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) {\n\t\t\t\tconst code = phase === \"precheck\" ? \"MIGRATION.PRECHECK_FAILED\" : \"MIGRATION.POSTCHECK_FAILED\";\n\t\t\t\tconst field = plan === void 0 ? void 0 : unconvertedFieldOf(step, plan.contract);\n\t\t\t\tconst converted = convertedColumnOf(step);\n\t\t\t\tconst failedCheck = {\n\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\tphase,\n\t\t\t\t\tdescription: step.description,\n\t\t\t\t\t...ifDefined(\"expectation\", step.expectation)\n\t\t\t\t};\n\t\t\t\tconst holding = phase === \"precheck\" && plan !== void 0 ? await this.rowsHoldingValue(driver, step, operation, plan.operationIndex) : void 0;\n\t\t\t\tif (holding !== void 0) return runnerFailure(code, holding.summary, {\n\t\t\t\t\twhy: `Operation ${operation.id} failed during ${phase}: ${step.description}`,\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tfailedCheck,\n\t\t\t\t\t\trowsHoldingValue: holding.report\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tconst unconverted = converted === void 0 ? void 0 : await this.unconvertedValueText(driver, converted);\n\t\t\t\treturn runnerFailure(code, `Operation ${operation.id} failed during ${phase}: ${step.description}`, {\n\t\t\t\t\t...ifDefined(\"why\", unconverted ?? (phase === \"precheck\" ? failedPrecheckWhy(failedCheck) : failedPostcheckWhy(failedCheck))),\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tfailedCheck,\n\t\t\t\t\t\t...ifDefined(\"failedTypeChange\", field === void 0 || plan === void 0 || converted === void 0 ? void 0 : converted.by === \"conversion\" ? {\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tby: \"conversion\",\n\t\t\t\t\t\t\treason: \"invalidResult\",\n\t\t\t\t\t\t\toperationIndex: plan.operationIndex\n\t\t\t\t\t\t} : {\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tby: \"cast\",\n\t\t\t\t\t\t\treason: \"value\",\n\t\t\t\t\t\t\toperationIndex: plan.operationIndex\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn okVoid();\n\t}\n\t/**\n\t* Counts the rows that hold the stored value a removal check guards, as `rowsHoldingValueMeta`\n\t* marks the check. A count that fails leaves the failure without it.\n\t*/\n\tasync rowsHoldingValue(driver, step, operation, operationIndex) {\n\t\tconst mark = rowsHoldingValueOf(step);\n\t\tconst details = operation.target.details;\n\t\tconst stored = step.params?.[0];\n\t\tif (mark === void 0 || details?.table === void 0) return void 0;\n\t\tif (typeof stored !== \"string\" && typeof stored !== \"number\") return void 0;\n\t\tlet rows;\n\t\ttry {\n\t\t\tconst counted = await driver.query(`SELECT COUNT(*) AS rows FROM ${quoteIdentifier(details.table)} WHERE ${quoteIdentifier(details.name)} = ?`, [stored]);\n\t\t\trows = Number(counted.rows[0]?.rows ?? 0);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t\treturn {\n\t\t\tsummary: rowsHoldingValueSummary(details.table, details.name, stored, rows),\n\t\t\treport: {\n\t\t\t\tenumValue: mark.enumValue,\n\t\t\t\tvalue: stored,\n\t\t\t\trows,\n\t\t\t\toperationIndex,\n\t\t\t\tkeepDataEdit: keepRowsEdit(details.table, details.name, mark)\n\t\t\t}\n\t\t};\n\t}\n\t/** Names the first value of a retyped column that kept a storage class its new type does not hold. */\n\tasync unconvertedValueText(driver, cast) {\n\t\tconst typeSql = (await driver.query(\"SELECT type FROM pragma_table_info(?) WHERE name = ?\", [cast.table, cast.column])).rows[0]?.type;\n\t\tif (typeSql === void 0) return void 0;\n\t\tconst column = quoteIdentifier(cast.column);\n\t\tconst classes = [\"null\", ...affinityStorageClasses(typeSql)];\n\t\tconst row = (await driver.query(`SELECT quote(${column}) AS value, typeof(${column}) AS storageClass FROM ${quoteIdentifier(cast.table)} WHERE typeof(${column}) NOT IN (${classes.map(() => \"?\").join(\", \")}) LIMIT 1`, classes)).rows[0];\n\t\tif (row === void 0) return void 0;\n\t\treturn `The value ${row.value.length > 40 ? `${row.value.slice(0, 40)}…` : row.value} of column \"${cast.column}\" on \"${cast.table}\" is still stored as ${row.storageClass}, which ${typeSql} cannot hold.`;\n\t}\n\tasync runExecuteSteps(driver, steps, operation, plan) {\n\t\tfor (const step of steps) try {\n\t\t\tawait driver.query(step.sql, step.params ?? []);\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tconst failed = `Operation ${operation.id} failed during execution: ${step.description}`;\n\t\t\tif (SqlConnectionError.is(error)) return runnerFailure(\"MIGRATION.EXECUTION_FAILED\", failed, {\n\t\t\t\twhy: message,\n\t\t\t\tmeta: {\n\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\tstepDescription: step.description,\n\t\t\t\t\tsql: step.sql,\n\t\t\t\t\tconnectionLost: error.transient === false,\n\t\t\t\t\ttransient: error.transient\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst rowsWithoutValue = await this.rowsWithoutValue(driver, error, plan);\n\t\t\tconst failedConversion = rowsWithoutValue === void 0 ? await this.failedConversion(driver, step, error, plan) : void 0;\n\t\t\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", rowsWithoutValue?.summary ?? failed, {\n\t\t\t\twhy: rowsWithoutValue === void 0 ? message : `${failed}: ${message}`,\n\t\t\t\tmeta: {\n\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\tstepDescription: step.description,\n\t\t\t\t\tsql: step.sql,\n\t\t\t\t\t...ifDefined(\"rowsWithoutValue\", rowsWithoutValue?.reports),\n\t\t\t\t\t...ifDefined(\"failedTypeChange\", failedConversion)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn okVoid();\n\t}\n\t/**\n\t* The conversion that failed, when the failed step is the copy of a rebuild that converts columns\n\t* and there is evidence for it: a copy expression that fails on its own has an error in its\n\t* expression, and a constraint of the new table that names a converted column was broken by a\n\t* value the conversion produced. Any other failure of the copy is not the conversion's.\n\t*/\n\tasync failedConversion(driver, step, error, plan) {\n\t\tconst copy = conversionCopyOf(step);\n\t\tif (copy === void 0) return void 0;\n\t\tconst columns = Object.keys(copy.expressions);\n\t\tconst failed = async (column) => {\n\t\t\ttry {\n\t\t\t\tawait driver.query(`SELECT ${copy.expressions[column]} FROM ${quoteIdentifier(copy.table)}`);\n\t\t\t\treturn false;\n\t\t\t} catch {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\t\tfor (const column of columns) if (await failed(column)) return this.conversionOf(plan, copy.table, column, \"expressionError\");\n\t\tconst constrainedList = SqlQueryError.is(error) ? error.constraint : void 0;\n\t\tif (constrainedList === void 0) return void 0;\n\t\tconst constrained = new Set(constrainedList.split(\", \"));\n\t\tconst column = columns.find((name) => constrained.has(`${rebuiltTableName(copy.table)}.${name}`));\n\t\treturn column === void 0 ? void 0 : this.conversionOf(plan, copy.table, column, \"invalidResult\");\n\t}\n\tconversionOf(plan, table, column, reason) {\n\t\tconst field = fieldOfColumn(plan.contract, table, column);\n\t\treturn field === void 0 ? void 0 : {\n\t\t\tfield,\n\t\t\tby: \"conversion\",\n\t\t\treason,\n\t\t\toperationIndex: plan.operationIndex\n\t\t};\n\t}\n\t/**\n\t* The rows a table rebuild found no value for, when its copy failed on a NOT NULL column of the\n\t* new table: the columns the rebuild's postchecks mark as becoming required are counted, the\n\t* rebuild's own first, then those of every other operation of its migration.\n\t*/\n\trowsWithoutValue(driver, error, plan) {\n\t\tif (!(SqlQueryError.is(error) && error.sqlState === NOT_NULL_VIOLATION_SQLSTATE)) return Promise.resolve(void 0);\n\t\tconst marks = requiredColumnsOfMigration(plan.operations, plan.edges, plan.operationIndex);\n\t\treturn rowsWithoutValueFailure({\n\t\t\tfailed: marks.filter((mark) => mark.operationIndex === plan.operationIndex),\n\t\t\tothers: marks,\n\t\t\tcount: async ({ required }) => {\n\t\t\t\tconst where = required.reason !== \"newField\" ? ` WHERE ${quoteIdentifier(required.column)} IS NULL` : \"\";\n\t\t\t\treturn (await driver.query(`SELECT COUNT(*) AS rows FROM ${quoteIdentifier(required.table)}${where}`)).rows[0]?.rows ?? 0;\n\t\t\t},\n\t\t\tcontract: plan.contract\n\t\t});\n\t}\n\tstepResultIsTrue(rows) {\n\t\tif (!rows || rows.length === 0) return false;\n\t\tconst firstRow = rows[0];\n\t\tconst firstValue = firstRow ? Object.values(firstRow)[0] : void 0;\n\t\tif (typeof firstValue === \"number\") return firstValue !== 0;\n\t\tif (typeof firstValue === \"boolean\") return firstValue;\n\t\tif (typeof firstValue === \"string\") {\n\t\t\tconst lower = firstValue.toLowerCase();\n\t\t\tif (lower === \"true\" || lower === \"1\") return true;\n\t\t\tif (lower === \"false\" || lower === \"0\") return false;\n\t\t\treturn firstValue.length > 0;\n\t\t}\n\t\treturn Boolean(firstValue);\n\t}\n\tasync expectationsAreSatisfied(driver, steps) {\n\t\tif (steps.length === 0) return false;\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tcreateSkipRecord(operation) {\n\t\treturn Object.freeze({\n\t\t\tid: operation.id,\n\t\t\tlabel: operation.label,\n\t\t\t...ifDefined(\"summary\", operation.summary),\n\t\t\toperationClass: operation.operationClass,\n\t\t\ttarget: operation.target,\n\t\t\tprecheck: Object.freeze([]),\n\t\t\texecute: Object.freeze([]),\n\t\t\tpostcheck: Object.freeze([...operation.postcheck]),\n\t\t\tmeta: Object.freeze({\n\t\t\t\t...operation.meta ?? {},\n\t\t\t\trunner: Object.freeze({\n\t\t\t\t\tskipped: true,\n\t\t\t\t\treason: \"postcheck_pre_satisfied\"\n\t\t\t\t})\n\t\t\t})\n\t\t});\n\t}\n\tmarkerMatchesDestination(marker, plan) {\n\t\tif (!marker) return false;\n\t\tif (marker.storageHash !== plan.destination.storageHash) return false;\n\t\tif (plan.destination.profileHash && marker.profileHash !== plan.destination.profileHash) return false;\n\t\treturn true;\n\t}\n\tenforcePolicyCompatibility(policy, operations) {\n\t\tconst allowedClasses = new Set(policy.allowedOperationClasses);\n\t\tfor (const operation of operations) if (!allowedClasses.has(operation.operationClass)) return runnerFailure(\"MIGRATION.POLICY_VIOLATION\", `Operation ${operation.id} has class \"${operation.operationClass}\" which is not allowed by policy.`, {\n\t\t\twhy: `Policy only allows: ${policy.allowedOperationClasses.join(\", \")}.`,\n\t\t\tmeta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\toperationClass: operation.operationClass,\n\t\t\t\tallowedClasses: policy.allowedOperationClasses\n\t\t\t}\n\t\t});\n\t\treturn okVoid();\n\t}\n\tensureMarkerCompatibility(marker, plan) {\n\t\tconst origin = plan.origin ?? null;\n\t\tif (!origin) return okVoid();\n\t\tif (!marker) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Missing contract marker: expected origin storage hash ${origin.storageHash}.`, { meta: { expectedOriginStorageHash: origin.storageHash } });\n\t\tif (marker.storageHash !== origin.storageHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker (${marker.storageHash}) does not match plan origin (${origin.storageHash}).`, { meta: {\n\t\t\tmarkerStorageHash: marker.storageHash,\n\t\t\texpectedOriginStorageHash: origin.storageHash\n\t\t} });\n\t\tif (origin.profileHash && marker.profileHash !== origin.profileHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker profile hash (${marker.profileHash}) does not match plan origin profile hash (${origin.profileHash}).`, { meta: {\n\t\t\tmarkerProfileHash: marker.profileHash,\n\t\t\texpectedOriginProfileHash: origin.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tensurePlanMatchesDestinationContract(destination, contract) {\n\t\tif (destination.storageHash !== contract.storage.storageHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination storage hash (${destination.storageHash}) does not match provided contract storage hash (${contract.storage.storageHash}).`, { meta: {\n\t\t\tplanStorageHash: destination.storageHash,\n\t\t\tcontractStorageHash: contract.storage.storageHash\n\t\t} });\n\t\tif (destination.profileHash && contract.profileHash && destination.profileHash !== contract.profileHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination profile hash (${destination.profileHash}) does not match provided contract profile hash (${contract.profileHash}).`, { meta: {\n\t\t\tplanProfileHash: destination.profileHash,\n\t\t\tcontractProfileHash: contract.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tasync upsertMarker(driver, options, existingMarker, space) {\n\t\tconst destination = {\n\t\t\tstorageHash: options.plan.destination.storageHash,\n\t\t\tprofileHash: options.plan.destination.profileHash ?? options.destinationContract.profileHash ?? options.plan.destination.storageHash,\n\t\t\tinvariants: options.plan.providedInvariants ?? []\n\t\t};\n\t\tif (!existingMarker) {\n\t\t\tawait this.family.initMarker({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tdestination\n\t\t\t});\n\t\t\treturn okVoid();\n\t\t}\n\t\tif (!await this.family.updateMarker({\n\t\t\tdriver,\n\t\t\tspace,\n\t\t\texpectedFrom: existingMarker.storageHash,\n\t\t\tdestination\n\t\t})) {\n\t\t\tconst found = await this.family.readMarker({\n\t\t\t\tdriver,\n\t\t\t\tspace\n\t\t\t});\n\t\t\treturn runnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\t\t\tspace,\n\t\t\t\texpectedStorageHash: existingMarker.storageHash,\n\t\t\t\tfoundStorageHash: found?.storageHash ?? null,\n\t\t\t\tdestinationStorageHash: options.plan.destination.storageHash\n\t\t\t} });\n\t\t}\n\t\treturn okVoid();\n\t}\n\tasync recordLedgerEntries(driver, options, executedOperations) {\n\t\tconst plan = options.plan;\n\t\tconst space = plan.spaceId;\n\t\tconst edges = options.migrationEdges;\n\t\tconst totalEdgeOps = edges.reduce((sum, edge) => sum + edge.operationCount, 0);\n\t\tif (totalEdgeOps !== plan.operations.length) throw new InternalError(`Ledger write: plan.operations length (${plan.operations.length}) does not match sum of migrationEdges operationCount (${totalEdgeOps})`);\n\t\tlet offset = 0;\n\t\tfor (const edge of edges) {\n\t\t\tconst edgeOps = executedOperations.slice(offset, offset + edge.operationCount);\n\t\t\toffset += edge.operationCount;\n\t\t\tawait this.family.writeLedgerEntry({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tentry: {\n\t\t\t\t\tedgeId: `${edge.from}->${edge.to}`,\n\t\t\t\t\tfrom: edge.from,\n\t\t\t\t\tto: edge.to,\n\t\t\t\t\tmigrationName: edge.dirName,\n\t\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\t\toperations: edgeOps\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tasync beginExclusiveTransaction(driver) {\n\t\tawait driver.query(\"BEGIN EXCLUSIVE\");\n\t}\n\tasync commitTransaction(driver) {\n\t\tawait driver.query(\"COMMIT\");\n\t}\n\tasync rollbackTransaction(driver) {\n\t\tawait driver.query(\"ROLLBACK\");\n\t}\n\tasync executeStatement(driver, statement) {\n\t\tawait driver.query(statement.sql, statement.params);\n\t}\n};\n//#endregion\n//#region src/core/migrations/sqlite-schema-verifier.ts\n/**\n* SQLite target `SchemaVerifier` concretion. Mirrors the Postgres\n* shape: hooks return the empty list pending the call-site migration\n* that routes the existing verifier behaviour through the SPI.\n*/\nvar SqliteSchemaVerifier = class extends SqlSchemaVerifierBase {\n\tverifyCommonSqlSchema(_options) {\n\t\treturn [];\n\t}\n\tverifyTargetExtensions(_options) {\n\t\treturn [];\n\t}\n};\n//#endregion\n//#region src/core/migrations/control-target.ts\nfunction isSqlContract(contract) {\n\treturn contract === null || contract.storage instanceof SqlStorage;\n}\nfunction createSqliteControlTargetDescriptor() {\n\tsetFallbackTemporal(Temporal);\n\treturn {\n\t\t...sqliteTargetDescriptorMeta,\n\t\tcontractSerializer: new SqliteContractSerializer(),\n\t\tschemaVerifier: new SqliteSchemaVerifier(),\n\t\tdiffSchema(input) {\n\t\t\treturn diffSqliteSchema(input);\n\t\t},\n\t\tclassifySubjectGranularity: relationalNodeGranularity,\n\t\tclassifyEntityKind: relationalNodeEntityKind,\n\t\tmigrations: {\n\t\t\tcreatePlanner(adapter) {\n\t\t\t\treturn createSqliteMigrationPlanner(adapter);\n\t\t\t},\n\t\t\tcreateRunner(family) {\n\t\t\t\treturn createSqliteMigrationRunner(family);\n\t\t\t},\n\t\t\tcontractToSchema(contract, frameworkComponents) {\n\t\t\t\tif (!isSqlContract(contract)) throw sqliteError(\"CONTRACT.TARGET_MISMATCH\", \"sqliteControlTargetDescriptor.contractToSchema received a non-SQL contract; expected Contract<SqlStorage>\");\n\t\t\t\treturn sqliteContractToSchema(contract, sqlTypeLookupsOf(frameworkComponents));\n\t\t\t}\n\t\t},\n\t\tcreate() {\n\t\t\treturn {\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"sqlite\"\n\t\t\t};\n\t\t},\n\t\tcreatePlanner(adapter) {\n\t\t\treturn createSqliteMigrationPlanner(adapter);\n\t\t},\n\t\tcreateRunner(family) {\n\t\t\treturn createSqliteMigrationRunner(family);\n\t\t}\n\t};\n}\nconst sqliteControlTargetDescriptor = createSqliteControlTargetDescriptor();\n//#endregion\nexport { sqliteControlTargetDescriptor as default, sqliteScalarTypeConstructors };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,8BAA8B;AACpC,SAAS,4BAA4B,QAAQ;CAC5C,OAAO,IAAI,sBAAsB,MAAM;AACxC;AACA,IAAI,wBAAwB,MAAM;CACjC;CACA,YAAY,QAAQ;EACnB,KAAK,SAAS;CACf;;;;;;;CAOA,MAAM,oBAAoB,SAAS;EAClC,MAAM,SAAS,QAAQ;EACvB,IAAI,QAAQ,UAAU,KAAK,KAAK,QAAQ,UAAU,QAAQ,KAAK,SAAS,MAAM,YAAY,sCAAsC,sCAAsC,QAAQ,MAAM,iCAAiC,QAAQ,KAAK,QAAQ,IAAI,EAAE,MAAM;GACrP,OAAO,QAAQ;GACf,aAAa,QAAQ,KAAK;EAC3B,EAAE,CAAC;EACH,MAAM,QAAQ,QAAQ,KAAK;EAC3B,MAAM,UAAU,UAAU,MAAM,QAAQ,IAAI,QAAQ,KAAK,UAAU,CAAC;EACpE,MAAM,mBAAmB,KAAK,qCAAqC,QAAQ,KAAK,aAAa,QAAQ,mBAAmB;EACxH,IAAI,CAAC,iBAAiB,IAAI,OAAO;EACjC,MAAM,cAAc,KAAK,2BAA2B,QAAQ,QAAQ,OAAO;EAC3E,IAAI,CAAC,YAAY,IAAI,OAAO;EAC5B,MAAM,eAAe,MAAM,KAAK,oBAAoB,QAAQ,QAAQ,mBAAmB;EACvF,IAAI,CAAC,aAAa,IAAI,OAAO;EAC7B,MAAM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QAAQ;IACpB,OAAO,4BAA4B,MAAM;GAC1C;GACA,iBAAiB,UAAU,qBAAqB;IAC/C,IAAI,CAAC,cAAc,QAAQ,GAAG,MAAM,YAAY,4BAA4B,2GAA2G;IACvL,OAAO,uBAAuB,UAAU,iBAAiB,mBAAmB,CAAC;GAC9E;EACD;EACA,SAAS;GACR,OAAO;IACN,UAAU;IACV,UAAU;GACX;EACD;EACA,cAAc,SAAS;GACtB,OAAO,6BAA6B,OAAO;EAC5C;EACA,aAAa,QAAQ;GACpB,OAAO,4BAA4B,MAAM;EAC1C;CACD;AACD;AACA,MAAM,gCAAgC,oCAAoC"}
|
|
1
|
+
{"version":3,"file":"target__control.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/control.mjs"],"sourcesContent":["import { c as sqliteError } from \"./errors-D9vZNPSI.mjs\";\nimport { n as sqliteScalarTypeConstructors, t as sqliteTargetDescriptorMeta } from \"./descriptor-meta-BwJWbIVt.mjs\";\nimport { r as quoteIdentifier } from \"./sql-utils-C9blmi9x.mjs\";\nimport { n as SqliteContractSerializer } from \"./sqlite-contract-view-DJhc7pI7.mjs\";\nimport { _ as diffSqliteSchema, b as verifySqliteDatabaseSchema, y as sqliteContractToSchema } from \"./sqlite-migration-B42dCAqX.mjs\";\nimport { C as conversionCopyOf, E as holdingStoredValue, b as affinityStorageClasses, w as rebuiltTableName } from \"./op-factory-call-Dxsyn5gF.mjs\";\nimport { i as sqliteStoredValueCallClasses, n as createSqliteMigrationPlanner, r as sqliteMarkedRemoval } from \"./planner-DgEGQuj9.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { setFallbackTemporal } from \"@internal/type-implementations/temporal\";\nimport { APP_SPACE_ID, failedPostcheckWhy, failedPrecheckWhy, schemaCheckWhy, withDatabaseUnchanged, withFailingSpace } from \"@internal/framework-components/control\";\nimport { convertedColumnOf, fieldOfColumn, keepRowsEdit, removalsOfMigration, requiredColumnsOfMigration, rowsHoldingValueFailure, rowsHoldingValueOf, rowsWithoutValueFailure, runnerFailure, runnerSuccess, sqlTypeLookupsOf, unconvertedFieldOf } from \"@internal/family-sql/control\";\nimport { SqlStorage } from \"@internal/sql-contract/types\";\nimport { relationalNodeEntityKind, relationalNodeGranularity } from \"@internal/sql-schema-ir/types\";\nimport { Temporal } from \"temporal-polyfill/full/implementation\";\nimport { SqlSchemaVerifierBase } from \"@internal/family-sql/ir\";\nimport { notOk, ok, okVoid } from \"@internal/utils/result\";\nimport { SqlConnectionError, SqlQueryError } from \"@internal/sql-errors\";\n//#region src/core/migrations/runner.ts\nconst NOT_NULL_VIOLATION_SQLSTATE = \"23502\";\nfunction createSqliteMigrationRunner(family) {\n\treturn new SqliteMigrationRunner(family);\n}\nvar SqliteMigrationRunner = class {\n\tfamily;\n\tconstructor(family) {\n\t\tthis.family = family;\n\t}\n\t/**\n\t* Apply the plan against an already-open connection without managing\n\t* the transaction lifecycle. The caller ({@link SqliteMigrationRunner.execute})\n\t* owns BEGIN/COMMIT/ROLLBACK and any connection-level setup (FK pragma\n\t* toggle, FK integrity check).\n\t*/\n\tasync executeOnConnection(options) {\n\t\tconst driver = options.driver;\n\t\tif (options.space !== void 0 && options.space !== options.plan.spaceId) throw sqliteError(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", `SqlMigrationRunner: options.space (${options.space}) does not match plan.spaceId (${options.plan.spaceId})`, { meta: {\n\t\t\tspace: options.space,\n\t\t\tplanSpaceId: options.plan.spaceId\n\t\t} });\n\t\tconst space = options.plan.spaceId;\n\t\tconst planOps = blindCast(await Promise.all(options.plan.operations));\n\t\tconst destinationCheck = this.ensurePlanMatchesDestinationContract(options.plan.destination, options.destinationContract);\n\t\tif (!destinationCheck.ok) return destinationCheck;\n\t\tconst policyCheck = this.enforcePolicyCompatibility(options.policy, planOps);\n\t\tif (!policyCheck.ok) return policyCheck;\n\t\tconst ensureResult = await this.ensureControlTables(driver, options.destinationContract);\n\t\tif (!ensureResult.ok) return ensureResult;\n\t\tconst existingMarker = await this.family.readMarker({\n\t\t\tdriver,\n\t\t\tspace\n\t\t});\n\t\tconst markerCheck = this.ensureMarkerCompatibility(existingMarker, options.plan);\n\t\tif (!markerCheck.ok) return markerCheck;\n\t\tconst markerAtDestination = this.markerMatchesDestination(existingMarker, options.plan);\n\t\tconst isSelfEdge = options.plan.origin?.storageHash === options.plan.destination.storageHash;\n\t\tconst skipOperations = markerAtDestination && options.plan.origin != null && !isSelfEdge;\n\t\tlet operationsExecuted;\n\t\tlet executedOperations;\n\t\tif (skipOperations) {\n\t\t\toperationsExecuted = 0;\n\t\t\texecutedOperations = [];\n\t\t} else {\n\t\t\tconst applyResult = await this.applyPlan(driver, options, planOps);\n\t\t\tif (!applyResult.ok) return applyResult;\n\t\t\toperationsExecuted = applyResult.value.operationsExecuted;\n\t\t\texecutedOperations = applyResult.value.executedOperations;\n\t\t}\n\t\tif (space === APP_SPACE_ID) {\n\t\t\tconst schemaNode = await this.family.introspect({\n\t\t\t\tdriver,\n\t\t\t\tcontract: options.destinationContract\n\t\t\t});\n\t\t\tconst schemaVerifyResult = verifySqliteDatabaseSchema({\n\t\t\t\tcontract: options.destinationContract,\n\t\t\t\tactualSchema: schemaNode,\n\t\t\t\tstrict: options.strictVerification ?? true,\n\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t});\n\t\t\tif (!schemaVerifyResult.ok) return runnerFailure(\"MIGRATION.SCHEMA_VERIFY_FAILED\", schemaVerifyResult.summary, {\n\t\t\t\twhy: schemaCheckWhy(schemaVerifyResult.schema.issues),\n\t\t\t\tmeta: { schemaIssues: schemaVerifyResult.schema.issues }\n\t\t\t});\n\t\t}\n\t\tconst incomingInvariants = options.plan.providedInvariants;\n\t\tconst existingInvariants = new Set(existingMarker?.invariants ?? []);\n\t\tconst incomingIsSubsetOfExisting = incomingInvariants.every((id) => existingInvariants.has(id));\n\t\tif (!(isSelfEdge && operationsExecuted === 0 && incomingIsSubsetOfExisting)) {\n\t\t\tconst markerResult = await this.upsertMarker(driver, options, existingMarker, space);\n\t\t\tif (!markerResult.ok) return markerResult;\n\t\t\tawait this.recordLedgerEntries(driver, options, executedOperations);\n\t\t}\n\t\treturn runnerSuccess({\n\t\t\toperationsPlanned: planOps.length,\n\t\t\toperationsExecuted\n\t\t});\n\t}\n\tasync execute(options) {\n\t\tconst driver = options.driver;\n\t\tconst perSpaceOptions = options.perSpaceOptions;\n\t\tif (perSpaceOptions.length === 0) return ok({ perSpaceResults: [] });\n\t\tconst fkWasEnabled = await this.readForeignKeysEnabled(driver);\n\t\tif (fkWasEnabled) await driver.query(\"PRAGMA foreign_keys = OFF\");\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await this.executeInTransaction(driver, perSpaceOptions, fkWasEnabled);\n\t\t} catch (error) {\n\t\t\tif (fkWasEnabled) await this.afterFailure(driver.query(\"PRAGMA foreign_keys = ON\"));\n\t\t\tthrow error;\n\t\t}\n\t\tif (fkWasEnabled) {\n\t\t\tconst restore = driver.query(\"PRAGMA foreign_keys = ON\");\n\t\t\tawait (result.ok ? restore : this.afterFailure(restore));\n\t\t}\n\t\treturn result;\n\t}\n\tasync executeInTransaction(driver, perSpaceOptions, fkWasEnabled) {\n\t\tawait this.beginExclusiveTransaction(driver);\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await this.executeSpaces(driver, perSpaceOptions, fkWasEnabled);\n\t\t} catch (error) {\n\t\t\tawait this.afterFailure(this.rollbackTransaction(driver));\n\t\t\tthrow error;\n\t\t}\n\t\tif (!result.ok) {\n\t\t\tawait this.afterFailure(this.rollbackTransaction(driver));\n\t\t\treturn notOk(withDatabaseUnchanged(result.failure, true));\n\t\t}\n\t\ttry {\n\t\t\tawait this.commitTransaction(driver);\n\t\t} catch (error) {\n\t\t\tawait this.afterFailure(this.rollbackTransaction(driver));\n\t\t\tthrow error;\n\t\t}\n\t\treturn result;\n\t}\n\tasync afterFailure(cleanup) {\n\t\tawait cleanup.catch(() => void 0);\n\t}\n\tasync executeSpaces(driver, perSpaceOptions, fkWasEnabled) {\n\t\tconst perSpaceResults = [];\n\t\tlet lastProcessedSpace;\n\t\tfor (const spaceOptions of perSpaceOptions) {\n\t\t\tconst space = spaceOptions.space ?? spaceOptions.plan.spaceId;\n\t\t\tconst result = await this.executeOnConnection({\n\t\t\t\t...spaceOptions,\n\t\t\t\tdriver,\n\t\t\t\tspace\n\t\t\t});\n\t\t\tif (!result.ok) return notOk(withFailingSpace(result.failure, space));\n\t\t\tperSpaceResults.push({\n\t\t\t\tspace,\n\t\t\t\tvalue: result.value\n\t\t\t});\n\t\t\tlastProcessedSpace = space;\n\t\t}\n\t\tif (fkWasEnabled) {\n\t\t\tconst fkIntegrityCheck = await this.verifyForeignKeyIntegrity(driver);\n\t\t\tif (!fkIntegrityCheck.ok) return notOk(withFailingSpace(fkIntegrityCheck.failure, lastProcessedSpace ?? APP_SPACE_ID));\n\t\t}\n\t\treturn ok({ perSpaceResults });\n\t}\n\tasync readForeignKeysEnabled(driver) {\n\t\treturn (await driver.query(\"PRAGMA foreign_keys\")).rows[0]?.foreign_keys === 1;\n\t}\n\tasync verifyForeignKeyIntegrity(driver) {\n\t\tconst result = await driver.query(\"PRAGMA foreign_key_check\");\n\t\tif (result.rows.length === 0) return okVoid();\n\t\treturn runnerFailure(\"MIGRATION.FOREIGN_KEY_VIOLATION\", `Foreign key integrity check failed after migration: ${result.rows.length} violation(s).`, {\n\t\t\twhy: `PRAGMA foreign_key_check reported violations after the migration ran with foreign keys off: ${violatedReferences(result.rows)} rows that a recreate-table or deleteRows operation removed, and no cascade ran. Delete or change the referencing rows first.`,\n\t\t\tmeta: { violations: result.rows }\n\t\t});\n\t}\n\tasync applyPlan(driver, options, ops) {\n\t\tconst checks = options.executionChecks;\n\t\tconst runPrechecks = checks?.prechecks !== false;\n\t\tconst runPostchecks = checks?.postchecks !== false;\n\t\tconst runIdempotency = checks?.idempotencyChecks !== false;\n\t\tlet operationsExecuted = 0;\n\t\tconst executedOperations = [];\n\t\tfor (const operation of ops) {\n\t\t\toptions.callbacks?.onOperationStart?.(operation);\n\t\t\ttry {\n\t\t\t\tif (runPostchecks && runIdempotency) {\n\t\t\t\t\tif (await this.expectationsAreSatisfied(driver, operation.postcheck)) {\n\t\t\t\t\t\texecutedOperations.push(this.createSkipRecord(operation));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (runPrechecks) {\n\t\t\t\t\tconst precheckResult = await this.runExpectationSteps(driver, operation.precheck, operation, \"precheck\", {\n\t\t\t\t\t\tcontract: options.destinationContract,\n\t\t\t\t\t\toperationIndex: ops.indexOf(operation),\n\t\t\t\t\t\toperations: ops,\n\t\t\t\t\t\tedges: options.migrationEdges\n\t\t\t\t\t});\n\t\t\t\t\tif (!precheckResult.ok) return precheckResult;\n\t\t\t\t}\n\t\t\t\tconst executeResult = await this.runExecuteSteps(driver, operation.execute, operation, {\n\t\t\t\t\tcontract: options.destinationContract,\n\t\t\t\t\toperationIndex: ops.indexOf(operation),\n\t\t\t\t\toperations: ops,\n\t\t\t\t\tedges: options.migrationEdges\n\t\t\t\t});\n\t\t\t\tif (!executeResult.ok) return executeResult;\n\t\t\t\tif (runPostchecks) {\n\t\t\t\t\tconst postcheckResult = await this.runExpectationSteps(driver, operation.postcheck, operation, \"postcheck\", {\n\t\t\t\t\t\tcontract: options.destinationContract,\n\t\t\t\t\t\toperationIndex: ops.indexOf(operation),\n\t\t\t\t\t\toperations: ops,\n\t\t\t\t\t\tedges: options.migrationEdges\n\t\t\t\t\t});\n\t\t\t\t\tif (!postcheckResult.ok) return postcheckResult;\n\t\t\t\t}\n\t\t\t\texecutedOperations.push(operation);\n\t\t\t\toperationsExecuted += 1;\n\t\t\t} finally {\n\t\t\t\toptions.callbacks?.onOperationComplete?.(operation);\n\t\t\t}\n\t\t}\n\t\treturn ok({\n\t\t\toperationsExecuted,\n\t\t\texecutedOperations\n\t\t});\n\t}\n\tasync ensureControlTables(driver, contract) {\n\t\tconst lowererContext = { contract };\n\t\tfor (const query of this.family.bootstrapControlTableQueries()) await this.executeStatement(driver, await this.family.lowerAst(query, lowererContext));\n\t\treturn okVoid();\n\t}\n\tasync runExpectationSteps(driver, steps, operation, phase, plan) {\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) {\n\t\t\t\tconst code = phase === \"precheck\" ? \"MIGRATION.PRECHECK_FAILED\" : \"MIGRATION.POSTCHECK_FAILED\";\n\t\t\t\tconst field = plan === void 0 ? void 0 : unconvertedFieldOf(step, plan.contract);\n\t\t\t\tconst converted = convertedColumnOf(step);\n\t\t\t\tconst failedCheck = {\n\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\tphase,\n\t\t\t\t\tdescription: step.description,\n\t\t\t\t\t...ifDefined(\"expectation\", step.expectation)\n\t\t\t\t};\n\t\t\t\tconst holding = phase === \"precheck\" && plan !== void 0 ? await this.rowsHoldingValue(driver, step, operation, plan) : void 0;\n\t\t\t\tif (holding !== void 0) return runnerFailure(code, holding.summary, {\n\t\t\t\t\twhy: `Operation ${operation.id} failed during ${phase}: ${step.description}`,\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tfailedCheck,\n\t\t\t\t\t\trowsHoldingValue: holding.reports\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tconst unconverted = converted === void 0 ? void 0 : await this.unconvertedValueText(driver, converted);\n\t\t\t\treturn runnerFailure(code, `Operation ${operation.id} failed during ${phase}: ${step.description}`, {\n\t\t\t\t\t...ifDefined(\"why\", unconverted ?? (phase === \"precheck\" ? failedPrecheckWhy(failedCheck) : failedPostcheckWhy(failedCheck))),\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tfailedCheck,\n\t\t\t\t\t\t...ifDefined(\"failedTypeChange\", field === void 0 || plan === void 0 || converted === void 0 ? void 0 : converted.by === \"conversion\" ? {\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tby: \"conversion\",\n\t\t\t\t\t\t\treason: \"invalidResult\",\n\t\t\t\t\t\t\toperationIndex: plan.operationIndex\n\t\t\t\t\t\t} : {\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tby: \"cast\",\n\t\t\t\t\t\t\treason: \"value\",\n\t\t\t\t\t\t\toperationIndex: plan.operationIndex\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn okVoid();\n\t}\n\t/**\n\t* Counts the rows that hold the stored value a removal check guards, as `rowsHoldingValueMeta`\n\t* marks the check, then those of every other removal of its migration whose check fails. A count\n\t* of the failed check that fails leaves the failure without it.\n\t*/\n\trowsHoldingValue(driver, step, operation, plan) {\n\t\tconst mark = rowsHoldingValueOf(step);\n\t\tif (mark === void 0) return Promise.resolve(void 0);\n\t\treturn rowsHoldingValueFailure({\n\t\t\tfailed: {\n\t\t\t\toperation,\n\t\t\t\toperationIndex: plan.operationIndex,\n\t\t\t\tcheck: step,\n\t\t\t\tmark\n\t\t\t},\n\t\t\tothers: removalsOfMigration(plan.operations, plan.edges, plan.operationIndex),\n\t\t\tcheckFails: async ({ check }) => !this.stepResultIsTrue((await driver.query(check.sql, check.params ?? [])).rows),\n\t\t\tcount: async ({ mark: counted }) => {\n\t\t\t\tconst holding = holdingStoredValue(counted.column, counted.storedValue, counted.path);\n\t\t\t\tconst rows = await driver.query(`SELECT COUNT(*) AS rows FROM ${quoteIdentifier(counted.table)} WHERE ${holding.condition}`, holding.params);\n\t\t\t\treturn Number(rows.rows[0]?.rows ?? 0);\n\t\t\t},\n\t\t\tkeepDataEdit: ({ mark: kept }) => keepRowsEdit(sqliteMarkedRemoval(kept), kept, sqliteStoredValueCallClasses)\n\t\t});\n\t}\n\t/** Names the first value of a retyped column that kept a storage class its new type does not hold. */\n\tasync unconvertedValueText(driver, cast) {\n\t\tconst typeSql = (await driver.query(\"SELECT type FROM pragma_table_info(?) WHERE name = ?\", [cast.table, cast.column])).rows[0]?.type;\n\t\tif (typeSql === void 0) return void 0;\n\t\tconst column = quoteIdentifier(cast.column);\n\t\tconst classes = [\"null\", ...affinityStorageClasses(typeSql)];\n\t\tconst row = (await driver.query(`SELECT quote(${column}) AS value, typeof(${column}) AS storageClass FROM ${quoteIdentifier(cast.table)} WHERE typeof(${column}) NOT IN (${classes.map(() => \"?\").join(\", \")}) LIMIT 1`, classes)).rows[0];\n\t\tif (row === void 0) return void 0;\n\t\treturn `The value ${row.value.length > 40 ? `${row.value.slice(0, 40)}…` : row.value} of column \"${cast.column}\" on \"${cast.table}\" is still stored as ${row.storageClass}, which ${typeSql} cannot hold.`;\n\t}\n\tasync runExecuteSteps(driver, steps, operation, plan) {\n\t\tfor (const step of steps) try {\n\t\t\tawait driver.query(step.sql, step.params ?? []);\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tconst failed = `Operation ${operation.id} failed during execution: ${step.description}`;\n\t\t\tif (SqlConnectionError.is(error)) return runnerFailure(\"MIGRATION.EXECUTION_FAILED\", failed, {\n\t\t\t\twhy: message,\n\t\t\t\tmeta: {\n\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\tstepDescription: step.description,\n\t\t\t\t\tsql: step.sql,\n\t\t\t\t\tconnectionLost: error.transient === false,\n\t\t\t\t\ttransient: error.transient\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst rowsWithoutValue = await this.rowsWithoutValue(driver, error, plan);\n\t\t\tconst failedConversion = rowsWithoutValue === void 0 ? await this.failedConversion(driver, step, error, plan) : void 0;\n\t\t\treturn runnerFailure(\"MIGRATION.EXECUTION_FAILED\", rowsWithoutValue?.summary ?? failed, {\n\t\t\t\twhy: rowsWithoutValue === void 0 ? message : `${failed}: ${message}`,\n\t\t\t\tmeta: {\n\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\tstepDescription: step.description,\n\t\t\t\t\tsql: step.sql,\n\t\t\t\t\t...ifDefined(\"rowsWithoutValue\", rowsWithoutValue?.reports),\n\t\t\t\t\t...ifDefined(\"failedTypeChange\", failedConversion)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn okVoid();\n\t}\n\t/**\n\t* The conversion that failed, when the failed step is the copy of a rebuild that converts columns\n\t* and there is evidence for it: a copy expression that fails on its own has an error in its\n\t* expression, and a constraint of the new table that names a converted column was broken by a\n\t* value the conversion produced. Any other failure of the copy is not the conversion's.\n\t*/\n\tasync failedConversion(driver, step, error, plan) {\n\t\tconst copy = conversionCopyOf(step);\n\t\tif (copy === void 0) return void 0;\n\t\tconst columns = Object.keys(copy.expressions);\n\t\tconst failed = async (column) => {\n\t\t\ttry {\n\t\t\t\tawait driver.query(`SELECT ${copy.expressions[column]} FROM ${quoteIdentifier(copy.table)}`);\n\t\t\t\treturn false;\n\t\t\t} catch {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\t\tfor (const column of columns) if (await failed(column)) return this.conversionOf(plan, copy.table, column, \"expressionError\");\n\t\tconst constrainedList = SqlQueryError.is(error) ? error.constraint : void 0;\n\t\tif (constrainedList === void 0) return void 0;\n\t\tconst constrained = new Set(constrainedList.split(\", \"));\n\t\tconst column = columns.find((name) => constrained.has(`${rebuiltTableName(copy.table)}.${name}`));\n\t\treturn column === void 0 ? void 0 : this.conversionOf(plan, copy.table, column, \"invalidResult\");\n\t}\n\tconversionOf(plan, table, column, reason) {\n\t\tconst field = fieldOfColumn(plan.contract, table, column);\n\t\treturn field === void 0 ? void 0 : {\n\t\t\tfield,\n\t\t\tby: \"conversion\",\n\t\t\treason,\n\t\t\toperationIndex: plan.operationIndex\n\t\t};\n\t}\n\t/**\n\t* The rows a table rebuild found no value for, when its copy failed on a NOT NULL column of the\n\t* new table: the columns the rebuild's postchecks mark as becoming required are counted, the\n\t* rebuild's own first, then those of every other operation of its migration.\n\t*/\n\trowsWithoutValue(driver, error, plan) {\n\t\tif (!(SqlQueryError.is(error) && error.sqlState === NOT_NULL_VIOLATION_SQLSTATE)) return Promise.resolve(void 0);\n\t\tconst marks = requiredColumnsOfMigration(plan.operations, plan.edges, plan.operationIndex);\n\t\treturn rowsWithoutValueFailure({\n\t\t\tfailed: marks.filter((mark) => mark.operationIndex === plan.operationIndex),\n\t\t\tothers: marks,\n\t\t\tcount: async ({ required }) => {\n\t\t\t\tconst where = required.reason !== \"newField\" ? ` WHERE ${quoteIdentifier(required.column)} IS NULL` : \"\";\n\t\t\t\treturn (await driver.query(`SELECT COUNT(*) AS rows FROM ${quoteIdentifier(required.table)}${where}`)).rows[0]?.rows ?? 0;\n\t\t\t},\n\t\t\tcontract: plan.contract\n\t\t});\n\t}\n\tstepResultIsTrue(rows) {\n\t\tif (!rows || rows.length === 0) return false;\n\t\tconst firstRow = rows[0];\n\t\tconst firstValue = firstRow ? Object.values(firstRow)[0] : void 0;\n\t\tif (typeof firstValue === \"number\") return firstValue !== 0;\n\t\tif (typeof firstValue === \"boolean\") return firstValue;\n\t\tif (typeof firstValue === \"string\") {\n\t\t\tconst lower = firstValue.toLowerCase();\n\t\t\tif (lower === \"true\" || lower === \"1\") return true;\n\t\t\tif (lower === \"false\" || lower === \"0\") return false;\n\t\t\treturn firstValue.length > 0;\n\t\t}\n\t\treturn Boolean(firstValue);\n\t}\n\tasync expectationsAreSatisfied(driver, steps) {\n\t\tif (steps.length === 0) return false;\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tcreateSkipRecord(operation) {\n\t\treturn Object.freeze({\n\t\t\tid: operation.id,\n\t\t\tlabel: operation.label,\n\t\t\t...ifDefined(\"summary\", operation.summary),\n\t\t\toperationClass: operation.operationClass,\n\t\t\ttarget: operation.target,\n\t\t\tprecheck: Object.freeze([]),\n\t\t\texecute: Object.freeze([]),\n\t\t\tpostcheck: Object.freeze([...operation.postcheck]),\n\t\t\tmeta: Object.freeze({\n\t\t\t\t...operation.meta ?? {},\n\t\t\t\trunner: Object.freeze({\n\t\t\t\t\tskipped: true,\n\t\t\t\t\treason: \"postcheck_pre_satisfied\"\n\t\t\t\t})\n\t\t\t})\n\t\t});\n\t}\n\tmarkerMatchesDestination(marker, plan) {\n\t\tif (!marker) return false;\n\t\tif (marker.storageHash !== plan.destination.storageHash) return false;\n\t\tif (plan.destination.profileHash && marker.profileHash !== plan.destination.profileHash) return false;\n\t\treturn true;\n\t}\n\tenforcePolicyCompatibility(policy, operations) {\n\t\tconst allowedClasses = new Set(policy.allowedOperationClasses);\n\t\tfor (const operation of operations) if (!allowedClasses.has(operation.operationClass)) return runnerFailure(\"MIGRATION.POLICY_VIOLATION\", `Operation ${operation.id} has class \"${operation.operationClass}\" which is not allowed by policy.`, {\n\t\t\twhy: `Policy only allows: ${policy.allowedOperationClasses.join(\", \")}.`,\n\t\t\tmeta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\toperationClass: operation.operationClass,\n\t\t\t\tallowedClasses: policy.allowedOperationClasses\n\t\t\t}\n\t\t});\n\t\treturn okVoid();\n\t}\n\tensureMarkerCompatibility(marker, plan) {\n\t\tconst origin = plan.origin ?? null;\n\t\tif (!origin) return okVoid();\n\t\tif (!marker) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Missing contract marker: expected origin storage hash ${origin.storageHash}.`, { meta: { expectedOriginStorageHash: origin.storageHash } });\n\t\tif (marker.storageHash !== origin.storageHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker (${marker.storageHash}) does not match plan origin (${origin.storageHash}).`, { meta: {\n\t\t\tmarkerStorageHash: marker.storageHash,\n\t\t\texpectedOriginStorageHash: origin.storageHash\n\t\t} });\n\t\tif (origin.profileHash && marker.profileHash !== origin.profileHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker profile hash (${marker.profileHash}) does not match plan origin profile hash (${origin.profileHash}).`, { meta: {\n\t\t\tmarkerProfileHash: marker.profileHash,\n\t\t\texpectedOriginProfileHash: origin.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tensurePlanMatchesDestinationContract(destination, contract) {\n\t\tif (destination.storageHash !== contract.storage.storageHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination storage hash (${destination.storageHash}) does not match provided contract storage hash (${contract.storage.storageHash}).`, { meta: {\n\t\t\tplanStorageHash: destination.storageHash,\n\t\t\tcontractStorageHash: contract.storage.storageHash\n\t\t} });\n\t\tif (destination.profileHash && contract.profileHash && destination.profileHash !== contract.profileHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination profile hash (${destination.profileHash}) does not match provided contract profile hash (${contract.profileHash}).`, { meta: {\n\t\t\tplanProfileHash: destination.profileHash,\n\t\t\tcontractProfileHash: contract.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tasync upsertMarker(driver, options, existingMarker, space) {\n\t\tconst destination = {\n\t\t\tstorageHash: options.plan.destination.storageHash,\n\t\t\tprofileHash: options.plan.destination.profileHash ?? options.destinationContract.profileHash ?? options.plan.destination.storageHash,\n\t\t\tinvariants: options.plan.providedInvariants ?? []\n\t\t};\n\t\tif (!existingMarker) {\n\t\t\tawait this.family.initMarker({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tdestination\n\t\t\t});\n\t\t\treturn okVoid();\n\t\t}\n\t\tif (!await this.family.updateMarker({\n\t\t\tdriver,\n\t\t\tspace,\n\t\t\texpectedFrom: existingMarker.storageHash,\n\t\t\tdestination\n\t\t})) {\n\t\t\tconst found = await this.family.readMarker({\n\t\t\t\tdriver,\n\t\t\t\tspace\n\t\t\t});\n\t\t\treturn runnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\t\t\tspace,\n\t\t\t\texpectedStorageHash: existingMarker.storageHash,\n\t\t\t\tfoundStorageHash: found?.storageHash ?? null,\n\t\t\t\tdestinationStorageHash: options.plan.destination.storageHash\n\t\t\t} });\n\t\t}\n\t\treturn okVoid();\n\t}\n\tasync recordLedgerEntries(driver, options, executedOperations) {\n\t\tconst plan = options.plan;\n\t\tconst space = plan.spaceId;\n\t\tconst edges = options.migrationEdges;\n\t\tconst totalEdgeOps = edges.reduce((sum, edge) => sum + edge.operationCount, 0);\n\t\tif (totalEdgeOps !== plan.operations.length) throw new InternalError(`Ledger write: plan.operations length (${plan.operations.length}) does not match sum of migrationEdges operationCount (${totalEdgeOps})`);\n\t\tlet offset = 0;\n\t\tfor (const edge of edges) {\n\t\t\tconst edgeOps = executedOperations.slice(offset, offset + edge.operationCount);\n\t\t\toffset += edge.operationCount;\n\t\t\tawait this.family.writeLedgerEntry({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tentry: {\n\t\t\t\t\tedgeId: `${edge.from}->${edge.to}`,\n\t\t\t\t\tfrom: edge.from,\n\t\t\t\t\tto: edge.to,\n\t\t\t\t\tmigrationName: edge.dirName,\n\t\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\t\toperations: edgeOps\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tasync beginExclusiveTransaction(driver) {\n\t\tawait driver.query(\"BEGIN EXCLUSIVE\");\n\t}\n\tasync commitTransaction(driver) {\n\t\tawait driver.query(\"COMMIT\");\n\t}\n\tasync rollbackTransaction(driver) {\n\t\tawait driver.query(\"ROLLBACK\");\n\t}\n\tasync executeStatement(driver, statement) {\n\t\tawait driver.query(statement.sql, statement.params);\n\t}\n};\n/** The rows `PRAGMA foreign_key_check` reports, as how many rows of each table reference rows of another. */\nfunction violatedReferences(rows) {\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const row of rows) {\n\t\tconst table = String(row[\"table\"]);\n\t\tconst parent = String(row[\"parent\"]);\n\t\tconst key = JSON.stringify([table, parent]);\n\t\tconst counted = counts.get(key) ?? {\n\t\t\ttable,\n\t\t\tparent,\n\t\t\trows: 0\n\t\t};\n\t\tcounts.set(key, {\n\t\t\t...counted,\n\t\t\trows: counted.rows + 1\n\t\t});\n\t}\n\treturn [...counts.values()].map(({ table, parent, rows: count }) => `${count} ${count === 1 ? \"row\" : \"rows\"} of \"${table}\" ${count === 1 ? \"references\" : \"reference\"} \"${parent}\"`).join(\", \");\n}\n//#endregion\n//#region src/core/migrations/sqlite-schema-verifier.ts\n/**\n* SQLite target `SchemaVerifier` concretion. Mirrors the Postgres\n* shape: hooks return the empty list pending the call-site migration\n* that routes the existing verifier behaviour through the SPI.\n*/\nvar SqliteSchemaVerifier = class extends SqlSchemaVerifierBase {\n\tverifyCommonSqlSchema(_options) {\n\t\treturn [];\n\t}\n\tverifyTargetExtensions(_options) {\n\t\treturn [];\n\t}\n};\n//#endregion\n//#region src/core/migrations/control-target.ts\nfunction isSqlContract(contract) {\n\treturn contract === null || contract.storage instanceof SqlStorage;\n}\nfunction createSqliteControlTargetDescriptor() {\n\tsetFallbackTemporal(Temporal);\n\treturn {\n\t\t...sqliteTargetDescriptorMeta,\n\t\tcontractSerializer: new SqliteContractSerializer(),\n\t\tschemaVerifier: new SqliteSchemaVerifier(),\n\t\tdiffSchema(input) {\n\t\t\treturn diffSqliteSchema(input);\n\t\t},\n\t\tclassifySubjectGranularity: relationalNodeGranularity,\n\t\tclassifyEntityKind: relationalNodeEntityKind,\n\t\tmigrations: {\n\t\t\tcreatePlanner(adapter) {\n\t\t\t\treturn createSqliteMigrationPlanner(adapter);\n\t\t\t},\n\t\t\tcreateRunner(family) {\n\t\t\t\treturn createSqliteMigrationRunner(family);\n\t\t\t},\n\t\t\tcontractToSchema(contract, frameworkComponents) {\n\t\t\t\tif (!isSqlContract(contract)) throw sqliteError(\"CONTRACT.TARGET_MISMATCH\", \"sqliteControlTargetDescriptor.contractToSchema received a non-SQL contract; expected Contract<SqlStorage>\");\n\t\t\t\treturn sqliteContractToSchema(contract, sqlTypeLookupsOf(frameworkComponents));\n\t\t\t}\n\t\t},\n\t\tcreate() {\n\t\t\treturn {\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"sqlite\"\n\t\t\t};\n\t\t},\n\t\tcreatePlanner(adapter) {\n\t\t\treturn createSqliteMigrationPlanner(adapter);\n\t\t},\n\t\tcreateRunner(family) {\n\t\t\treturn createSqliteMigrationRunner(family);\n\t\t}\n\t};\n}\nconst sqliteControlTargetDescriptor = createSqliteControlTargetDescriptor();\n//#endregion\nexport { sqliteControlTargetDescriptor as default, sqliteScalarTypeConstructors };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,8BAA8B;AACpC,SAAS,4BAA4B,QAAQ;CAC5C,OAAO,IAAI,sBAAsB,MAAM;AACxC;AACA,IAAI,wBAAwB,MAAM;CACjC;CACA,YAAY,QAAQ;EACnB,KAAK,SAAS;CACf;;;;;;;CAOA,MAAM,oBAAoB,SAAS;EAClC,MAAM,SAAS,QAAQ;EACvB,IAAI,QAAQ,UAAU,KAAK,KAAK,QAAQ,UAAU,QAAQ,KAAK,SAAS,MAAM,YAAY,sCAAsC,sCAAsC,QAAQ,MAAM,iCAAiC,QAAQ,KAAK,QAAQ,IAAI,EAAE,MAAM;GACrP,OAAO,QAAQ;GACf,aAAa,QAAQ,KAAK;EAC3B,EAAE,CAAC;EACH,MAAM,QAAQ,QAAQ,KAAK;EAC3B,MAAM,UAAU,UAAU,MAAM,QAAQ,IAAI,QAAQ,KAAK,UAAU,CAAC;EACpE,MAAM,mBAAmB,KAAK,qCAAqC,QAAQ,KAAK,aAAa,QAAQ,mBAAmB;EACxH,IAAI,CAAC,iBAAiB,IAAI,OAAO;EACjC,MAAM,cAAc,KAAK,2BAA2B,QAAQ,QAAQ,OAAO;EAC3E,IAAI,CAAC,YAAY,IAAI,OAAO;EAC5B,MAAM,eAAe,MAAM,KAAK,oBAAoB,QAAQ,QAAQ,mBAAmB;EACvF,IAAI,CAA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-
|
|
2
|
-
import { a as fn, c as placeholder, d as sql, f as unique, i as dataTransform, l as primaryKey, n as MigrationCLI, o as foreignKey, r as col, s as lit, t as DataTransformOptions, u as rawSql } from "./migration-
|
|
1
|
+
import { t as SqliteMigration } from "./sqlite-migration-C_9TPlLD-DtKN8bi9.mjs";
|
|
2
|
+
import { a as fn, c as placeholder, d as sql, f as unique, i as dataTransform, l as primaryKey, n as MigrationCLI, o as foreignKey, r as col, s as lit, t as DataTransformOptions, u as rawSql } from "./migration-Dekon_QC.mjs";
|
|
3
3
|
export { type DataTransformOptions, SqliteMigration as Migration, MigrationCLI, col, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, sql, unique };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as SqliteMigration } from "./sqlite-migration-
|
|
2
|
-
import { a as foreignKey, c as primaryKey, d as unique, i as fn, l as rawSql, n as col, o as lit, r as dataTransform, s as placeholder, t as MigrationCLI, u as sql } from "./migration-
|
|
1
|
+
import { t as SqliteMigration } from "./sqlite-migration-B42dCAqX-DiSO-PeZ.mjs";
|
|
2
|
+
import { a as foreignKey, c as primaryKey, d as unique, i as fn, l as rawSql, n as col, o as lit, r as dataTransform, s as placeholder, t as MigrationCLI, u as sql } from "./migration-DBqx2jWN.mjs";
|
|
3
3
|
export { SqliteMigration as Migration, MigrationCLI, col, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, sql, unique };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { AddColumnCall, CreateIndexCall, CreateTableCall, DataTransformCall, DropColumnCall, DropIndexCall, DropTableCall, RawSqlCall, RecreateTableCall, RemoveStoredValueCall, RenameColumnCall, RenameTableCall, ReplaceStoredValueCall, type SqliteOpFactoryCall };
|
|
1
|
+
import { _ as ReplaceStoredValueCall, a as DeleteRowsCall, c as DropTableCall, d as RecreateTableCall, f as RemoveStoredKeyCall, g as RenameTableCall, h as RenameStoredKeyCall, i as DataTransformCall, l as FillStoredKeyCall, m as RenameColumnCall, n as CreateIndexCall, o as DropColumnCall, p as RemoveStoredValueCall, r as CreateTableCall, s as DropIndexCall, t as AddColumnCall, u as RawSqlCall, v as SqliteOpFactoryCall } from "./op-factory-call-gQ5ddSys.mjs";
|
|
2
|
+
export { AddColumnCall, CreateIndexCall, CreateTableCall, DataTransformCall, DeleteRowsCall, DropColumnCall, DropIndexCall, DropTableCall, FillStoredKeyCall, RawSqlCall, RecreateTableCall, RemoveStoredKeyCall, RemoveStoredValueCall, RenameColumnCall, RenameStoredKeyCall, RenameTableCall, ReplaceStoredValueCall, type SqliteOpFactoryCall };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { AddColumnCall, CreateIndexCall, CreateTableCall, DataTransformCall, DropColumnCall, DropIndexCall, DropTableCall, RawSqlCall, RecreateTableCall, RemoveStoredValueCall, RenameColumnCall, RenameTableCall, ReplaceStoredValueCall };
|
|
1
|
+
import { _ as RenameTableCall, a as DeleteRowsCall, c as DropTableCall, d as RawSqlCall, f as RecreateTableCall, g as RenameStoredKeyCall, h as RenameColumnCall, i as DataTransformCall, l as FillStoredKeyCall, m as RemoveStoredValueCall, n as CreateIndexCall, o as DropColumnCall, p as RemoveStoredKeyCall, r as CreateTableCall, s as DropIndexCall, t as AddColumnCall, v as ReplaceStoredValueCall } from "./op-factory-call-Dxsyn5gF-CvHmM-h_.mjs";
|
|
2
|
+
export { AddColumnCall, CreateIndexCall, CreateTableCall, DataTransformCall, DeleteRowsCall, DropColumnCall, DropIndexCall, DropTableCall, FillStoredKeyCall, RawSqlCall, RecreateTableCall, RemoveStoredKeyCall, RemoveStoredValueCall, RenameColumnCall, RenameStoredKeyCall, RenameTableCall, ReplaceStoredValueCall };
|
package/dist/target__pack.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as sqliteTargetDescriptorMeta } from "./pack-
|
|
1
|
+
import { t as sqliteTargetDescriptorMeta } from "./pack-D3gC0XlT.mjs";
|
|
2
2
|
export { sqliteTargetDescriptorMeta as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as TypeScriptRenderableSqliteMigration, t as SqliteMigrationDestinationInfo } from "./planner-produced-sqlite-migration-
|
|
2
|
-
import "./planner-produced-sqlite-migration-
|
|
1
|
+
import { n as TypeScriptRenderableSqliteMigration, t as SqliteMigrationDestinationInfo } from "./planner-produced-sqlite-migration-BHH_ftCV-CndNmTrH.mjs";
|
|
2
|
+
import "./planner-produced-sqlite-migration-_n61WaiD.mjs";
|
|
3
3
|
export { type SqliteMigrationDestinationInfo, TypeScriptRenderableSqliteMigration };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-
|
|
1
|
+
import { t as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-BMogETJ0-COe4tate.mjs";
|
|
2
2
|
export { TypeScriptRenderableSqliteMigration };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SqlitePlanResult, r as createSqliteMigrationPlanner, t as SqliteMigrationPlanner } from "./planner-
|
|
1
|
+
import { n as SqlitePlanResult, r as createSqliteMigrationPlanner, t as SqliteMigrationPlanner } from "./planner-ccevdpwf.mjs";
|
|
2
2
|
export { SqliteMigrationPlanner, type SqlitePlanResult, createSqliteMigrationPlanner };
|
package/dist/target__planner.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createSqliteMigrationPlanner, t as SqliteMigrationPlanner } from "./planner-
|
|
1
|
+
import { n as createSqliteMigrationPlanner, t as SqliteMigrationPlanner } from "./planner-DgEGQuj9-Ca6jqWrd.mjs";
|
|
2
2
|
export { SqliteMigrationPlanner, createSqliteMigrationPlanner };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as renderOps } from "./render-ops-
|
|
1
|
+
import { t as renderOps } from "./render-ops-BUk3wlAR-Awdho1_L.mjs";
|
|
2
2
|
export { renderOps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import "./types-RJMd2PlL-BTGAJrBQ.mjs";
|
|
2
|
-
import "./codecs-
|
|
2
|
+
import "./codecs-CX5BZUdO.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-target-sqlite",
|
|
3
|
-
"version": "8.0.0-rc.22-dev.
|
|
3
|
+
"version": "8.0.0-rc.22-dev.9",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,21 +9,21 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@prisma/orm-family-sql": "8.0.0-rc.22-dev.
|
|
13
|
-
"@prisma/orm-framework": "8.0.0-rc.22-dev.
|
|
14
|
-
"@prisma/orm-toolchain": "8.0.0-rc.22-dev.
|
|
12
|
+
"@prisma/orm-family-sql": "8.0.0-rc.22-dev.9",
|
|
13
|
+
"@prisma/orm-framework": "8.0.0-rc.22-dev.9",
|
|
14
|
+
"@prisma/orm-toolchain": "8.0.0-rc.22-dev.9",
|
|
15
15
|
"@standard-schema/spec": "1.1.0",
|
|
16
16
|
"arktype": "^2.2.2",
|
|
17
17
|
"pathe": "^2.0.3",
|
|
18
18
|
"temporal-spec": "1.0.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@internal/adapter-sqlite": "8.0.0-rc.22-dev.
|
|
22
|
-
"@internal/driver-sqlite": "8.0.0-rc.22-dev.
|
|
23
|
-
"@internal/target-sqlite": "8.0.0-rc.22-dev.
|
|
24
|
-
"@repo/test-utils": "8.0.0-rc.22-dev.
|
|
25
|
-
"@repo/tsconfig": "8.0.0-rc.22-dev.
|
|
26
|
-
"@repo/tsdown": "8.0.0-rc.22-dev.
|
|
21
|
+
"@internal/adapter-sqlite": "8.0.0-rc.22-dev.9",
|
|
22
|
+
"@internal/driver-sqlite": "8.0.0-rc.22-dev.9",
|
|
23
|
+
"@internal/target-sqlite": "8.0.0-rc.22-dev.9",
|
|
24
|
+
"@repo/test-utils": "8.0.0-rc.22-dev.9",
|
|
25
|
+
"@repo/tsconfig": "8.0.0-rc.22-dev.9",
|
|
26
|
+
"@repo/tsdown": "8.0.0-rc.22-dev.9",
|
|
27
27
|
"tsdown": "0.22.14",
|
|
28
28
|
"typescript": "5.9.3",
|
|
29
29
|
"vitest": "5.0.0-rc.2"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./codec-types-YpVaNlY0.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codecs-BqOj4EKm-BaGeNd2m.d.mts","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/codecs-BqOj4EKm.d.mts"],"mappings":";;;;;;;;;;;;;KAYK;YACO,cAAc;aACb;;;KAGR,mBAAmB,KAAK;KACxB,sBAAsB,gBAAgB;iBAC1B,4BAA4B,QAAQ,kBAAkB,YAAY,cAAc,oBAAoB;iBACpG,sCAAsC,4BAA4B,6BAA6B;;;;;;iBAM/F,kCAAkC;;;;cAIrC,oCAAoC,iBAAiB,oFAAoF,SAAS;EAC9J,OAAO,OAAO,SAAS,SAAS,MAAM,mBAAmB;EACzD,SAAS,uBAAuB,MAAM,mBAAmB,QAAQ,SAAS;EAC1E,kBAAkB,OAAO,wBAAwB,SAAS;EAC1D,gBAAgB,OAAO,SAAS,UAAU;;cAE9B,yCAAyC;YAC3C,eAAe,YAAY,iBAAiB;WAC7C,yDAAyD;WACzD;WACA;WACA;EACT,YAAY,KAAK,yBAAyB;;cAE9B,mFAAmF,WAAW;;cAE9F,kCAAkC,iBAAiB;EAC/D,OAAO,eAAe,MAAM,mBAAmB;EAC/C,SAAS,uBAAuB,MAAM,mBAAmB;EACzD,kBAAkB,OAAO;EACzB,gBAAgB,gBAAgB;;cAEpB,uCAAuC;YACz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AAK,yBAAyB;;cAE9B,yEAAyE,WAAW;;;;;;;;cAQpF,gCAAgC,iBAAiB;EAC7D,OAAO,eAAe,MAAM,mBAAmB;;;;;;EAM/C,SAAS,gCAAgC,MAAM,mBAAmB;EAClE,kBAAkB,OAAO;EACzB,gBAAgB,gBAAgB;;cAEpB,qCAAqC;YACvC,eAAe,YAAY,iBAAiB;WAC7C,yDAAyD;WACzD;WACA;WACA;EACT,mBAAmB,OAAO;EAC1B,YAAY,KAAK,yBAAyB;;cAE9B,+EAA+E,WAAW;;;;cAI1F;;;;iBAIG,uBAAuB;;;;;;;;cAQ1B,qBAAqB;cACrB,+BAA+B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./codecs-BqOj4EKm-BaGeNd2m.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"op-factory-call-B8bJlvkP.d.mts","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/op-factory-call.d.mts"],"mappings":";;;;;;;;;KAQK,KAAK,0BAA0B;uBACb,gCAAgC,wBAAwB;oBAC3D;oBACA,gBAAgB;oBAChB;WACT,KAAK,UAAU,UAAU,KAAK,QAAQ;;EAE/C,MAAM,UAAU,kCAAkC,KAAK,QAAQ;EAC/D,+BAA+B;YACrB;;cAEE,wBAAwB;;WAE3B;WACA;WACA;WACA,kBAAkB;WAClB,sBAAsB;WACtB;EACT,YAAY,mBAAmB,kBAAkB,aAAa,uBAAuB;EACrF,KAAK,UAAU,wBAAwB,QAAQ;EAC/C;EACA,+BAA+B;;cAEnB,sBAAsB;WACzB;WACA;WACA;WACA;EACT,YAAY;EACZ,KAAK,UAAU,wBAAwB,QAAQ;EAC/C;EACA,+BAA+B;;;UAGvB;WACC,MAAM;WACN,QAAQ;;;KAGd,sBAAsB,gBAAgB;cAC7B,wBAAwB;WAC3B;WACA;WACA;;WAEA;WACA;;WAEA,4BAA4B;;;;;WAK5B,qBAAqB;EAC9B,YAAY,sBAAsB,mBAAmB,4BAA4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