@prisma/orm-target-sqlite 8.0.0-rc.22-dev.8 → 8.0.0-rc.22-dev.10
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,13 +1,13 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { _ as sqliteSchemaTables, a as createWorkingSchema, c as issueNode, d as renameTableByHandStatements, f as renderRenameTableCall, g as sqlitePlannerStrategies, i as conflictForDisallowedCall, l as pairIndexReplacements, m as sqliteColumnRenameCall, n as buildSqlitePlanDiff, p as sqliteActualSchema, r as coalesceSubtreeIssues, s as indexNameCaseChange, u as planIssues, v as sqliteTableRenameByHand, y as sqliteTableRenameCall } from "./sqlite-migration-
|
|
3
|
-
import { t as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-
|
|
1
|
+
import { a as DeleteRowsCall, c as DropTableCall, d as RawSqlCall, f as RecreateTableCall, g as RenameStoredKeyCall, l as FillStoredKeyCall, m as RemoveStoredValueCall, o as DropColumnCall, p as RemoveStoredKeyCall, v as ReplaceStoredValueCall } from "./op-factory-call-Dxsyn5gF-CvHmM-h_.mjs";
|
|
2
|
+
import { _ as sqliteSchemaTables, a as createWorkingSchema, c as issueNode, d as renameTableByHandStatements, f as renderRenameTableCall, g as sqlitePlannerStrategies, i as conflictForDisallowedCall, l as pairIndexReplacements, m as sqliteColumnRenameCall, n as buildSqlitePlanDiff, p as sqliteActualSchema, r as coalesceSubtreeIssues, s as indexNameCaseChange, u as planIssues, v as sqliteTableRenameByHand, y as sqliteTableRenameCall } from "./sqlite-migration-B42dCAqX-DiSO-PeZ.mjs";
|
|
3
|
+
import { t as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-BMogETJ0-COe4tate.mjs";
|
|
4
4
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
5
5
|
import { enumValueCoordinateJson, isRenameStatement, issueOutcome } from "@prisma/orm-framework/components/control";
|
|
6
6
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
7
|
-
import { appliedStatementsInOrder, backfillOfDefaultedField, columnTakesTemporaryValue, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldStatementColumns,
|
|
7
|
+
import { UnfilledValue, appliedStatementsInOrder, backfillOfDefaultedField, columnTakesTemporaryValue, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldStatementColumns, planFieldEventCalls, planStatements, planStoredRewrites, plannerFailure, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, unknownCallNames } from "@prisma/orm-family-sql/family/control";
|
|
8
8
|
import { RelationalSchemaNodeKind, SqlTableIR } from "@prisma/orm-family-sql/schema-ir/types";
|
|
9
9
|
import { ok } from "@prisma/orm-framework/utils/result";
|
|
10
|
-
//#region ../../../3-targets/sqlite/1-target/dist/planner-
|
|
10
|
+
//#region ../../../3-targets/sqlite/1-target/dist/planner-DgEGQuj9.mjs
|
|
11
11
|
function lost(target, loss = "drop") {
|
|
12
12
|
return {
|
|
13
13
|
...target,
|
|
@@ -62,13 +62,17 @@ function temporaryValuesOf(call) {
|
|
|
62
62
|
value: expression.sql
|
|
63
63
|
}]);
|
|
64
64
|
}
|
|
65
|
+
/** What to do about the rows of `tables` that reference deleted rows, which the SQLite runner does not delete. */
|
|
66
|
+
function referencedRowsAdvice(tables) {
|
|
67
|
+
return `SQLite migrations run with foreign keys off, so deleting these rows does not delete the rows of ${tables.map((table) => `"${table}"`).join(", ")} that reference them: the apply then fails at PRAGMA foreign_key_check. Delete or change those rows first.`;
|
|
68
|
+
}
|
|
65
69
|
/**
|
|
66
70
|
* What each call of a SQLite plan loses. A recreate that leaves a column out loses its values
|
|
67
71
|
* itself, so a later drop of that column is not listed again.
|
|
68
72
|
*/
|
|
69
|
-
function sqliteCallSubjects(calls, fieldEvents, storedValues = /* @__PURE__ */ new Map()) {
|
|
73
|
+
function sqliteCallSubjects(calls, fieldEvents, storedValues = /* @__PURE__ */ new Map(), storedKeys = /* @__PURE__ */ new Map(), variantRows = /* @__PURE__ */ new Map(), referencingTables = () => []) {
|
|
70
74
|
const lostColumns = /* @__PURE__ */ new Set();
|
|
71
|
-
const unknownNames = unknownCallNames(calls.filter((call) => call.operationClass === "destructive" && !(call instanceof RecreateTableCall) && !(call instanceof DropColumnCall) && !(call instanceof DropTableCall) && !(call instanceof RawSqlCall) && !(call instanceof RemoveStoredValueCall) && !fieldEvents.has(call)));
|
|
75
|
+
const unknownNames = unknownCallNames(calls.filter((call) => call.operationClass === "destructive" && !(call instanceof RecreateTableCall) && !(call instanceof DropColumnCall) && !(call instanceof DropTableCall) && !(call instanceof RawSqlCall) && !(call instanceof RemoveStoredValueCall) && !(call instanceof RemoveStoredKeyCall) && !(call instanceof DeleteRowsCall) && !fieldEvents.has(call)));
|
|
72
76
|
return calls.map((call) => {
|
|
73
77
|
const operationCount = operationCountOf(call);
|
|
74
78
|
const { label } = call;
|
|
@@ -90,6 +94,31 @@ function sqliteCallSubjects(calls, fieldEvents, storedValues = /* @__PURE__ */ n
|
|
|
90
94
|
accessChanges: [],
|
|
91
95
|
temporaryValues: []
|
|
92
96
|
};
|
|
97
|
+
if (call instanceof DeleteRowsCall) {
|
|
98
|
+
const cascaded = new Set(call.cascade.map(({ table }) => table));
|
|
99
|
+
const referencing = referencingTables(call.tableName).filter((table) => !cascaded.has(table));
|
|
100
|
+
return {
|
|
101
|
+
operationCount,
|
|
102
|
+
label,
|
|
103
|
+
dataLoss: [{
|
|
104
|
+
...lost(tableTarget(call.tableName)),
|
|
105
|
+
...ifDefined("model", variantRows.get(call)),
|
|
106
|
+
...ifDefined("keepDataAdvice", referencing.length === 0 ? void 0 : referencedRowsAdvice(referencing))
|
|
107
|
+
}],
|
|
108
|
+
accessChanges: [],
|
|
109
|
+
temporaryValues: []
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
if (call instanceof RemoveStoredKeyCall) return {
|
|
113
|
+
operationCount,
|
|
114
|
+
label,
|
|
115
|
+
dataLoss: [{
|
|
116
|
+
...lost(columnTarget(call.tableName, call.columnName)),
|
|
117
|
+
...ifDefined("valueObjectField", storedKeys.get(call))
|
|
118
|
+
}],
|
|
119
|
+
accessChanges: [],
|
|
120
|
+
temporaryValues: []
|
|
121
|
+
};
|
|
93
122
|
if (call instanceof RemoveStoredValueCall) {
|
|
94
123
|
const subject = storedValues.get(call);
|
|
95
124
|
return {
|
|
@@ -111,6 +140,21 @@ function sqliteCallSubjects(calls, fieldEvents, storedValues = /* @__PURE__ */ n
|
|
|
111
140
|
accessChanges: [],
|
|
112
141
|
temporaryValues: []
|
|
113
142
|
};
|
|
143
|
+
if (call instanceof FillStoredKeyCall) {
|
|
144
|
+
const valueObjectField = storedKeys.get(call);
|
|
145
|
+
return {
|
|
146
|
+
operationCount,
|
|
147
|
+
label,
|
|
148
|
+
dataLoss: [],
|
|
149
|
+
accessChanges: [],
|
|
150
|
+
temporaryValues: call.value instanceof UnfilledValue || valueObjectField === void 0 ? [] : [{
|
|
151
|
+
table: call.tableName,
|
|
152
|
+
column: call.columnName,
|
|
153
|
+
value: JSON.stringify(call.value),
|
|
154
|
+
valueObjectField
|
|
155
|
+
}]
|
|
156
|
+
};
|
|
157
|
+
}
|
|
114
158
|
if (call.operationClass !== "destructive") return {
|
|
115
159
|
operationCount,
|
|
116
160
|
label,
|
|
@@ -137,63 +181,52 @@ function sqliteCallSubjects(calls, fieldEvents, storedValues = /* @__PURE__ */ n
|
|
|
137
181
|
/** The calls that carry out a plan's stored value rewrites, each with the rewrite it carries out. */
|
|
138
182
|
function sqliteStoredValueCalls(rewrites, codecs) {
|
|
139
183
|
return new Map(rewrites.map((rewrite) => {
|
|
140
|
-
const codec = {
|
|
184
|
+
const codec = rewrite.codecRef === void 0 ? void 0 : {
|
|
141
185
|
codecRef: rewrite.codecRef,
|
|
142
186
|
codecs
|
|
143
187
|
};
|
|
144
|
-
|
|
188
|
+
const { member } = rewrite;
|
|
189
|
+
return [rewrite.to === void 0 ? new RemoveStoredValueCall(rewrite.table, rewrite.column, rewrite.from, codec, enumValueCoordinateJson(rewrite.enumValue), member?.path, member?.nullable === true ? true : void 0) : new ReplaceStoredValueCall(rewrite.table, rewrite.column, rewrite.from, rewrite.to, codec, member?.path), rewrite];
|
|
145
190
|
}));
|
|
146
191
|
}
|
|
147
|
-
/** The
|
|
148
|
-
function
|
|
149
|
-
return
|
|
150
|
-
remove: call.renderTypeScript(),
|
|
151
|
-
replaceWith: replacements.map(({ from, to }) => new ReplaceStoredValueCall(call.tableName, call.columnName, from, to, call.codec).renderTypeScript()).join(", ")
|
|
152
|
-
};
|
|
192
|
+
/** The calls that carry out a plan's key rewrites of value object fields, each with the rewrite it carries out. */
|
|
193
|
+
function sqliteStoredKeyCalls(rewrites) {
|
|
194
|
+
return new Map(rewrites.map((rewrite) => [rewrite.to === void 0 ? new RemoveStoredKeyCall(rewrite.table, rewrite.column, rewrite.path) : new RenameStoredKeyCall(rewrite.table, rewrite.column, rewrite.path, rewrite.to), rewrite]));
|
|
153
195
|
}
|
|
154
|
-
/**
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
196
|
+
/** The calls that carry out a plan's fills of value object fields, each with the fill it carries out. */
|
|
197
|
+
function sqliteStoredKeyFillCalls(fills) {
|
|
198
|
+
return new Map(fills.map((fill) => [new FillStoredKeyCall(fill.table, fill.column, fill.path, fill.value, {
|
|
199
|
+
text: fill.field,
|
|
200
|
+
check: void 0
|
|
201
|
+
}), fill]));
|
|
202
|
+
}
|
|
203
|
+
/** The calls that carry out a plan's row rewrites of variants, each with the rewrite it carries out. */
|
|
204
|
+
function sqliteVariantRowCalls(rewrites, codecs) {
|
|
205
|
+
return new Map(rewrites.map((rewrite) => {
|
|
206
|
+
const codec = {
|
|
207
|
+
codecRef: rewrite.codecRef,
|
|
208
|
+
codecs
|
|
209
|
+
};
|
|
210
|
+
return [rewrite.to === void 0 ? new DeleteRowsCall(rewrite.table, rewrite.column, rewrite.from, codec, rewrite.cascadingTable === void 0 ? [] : [{
|
|
211
|
+
table: rewrite.cascadingTable.table,
|
|
212
|
+
columns: rewrite.cascadingTable.columns,
|
|
213
|
+
references: rewrite.cascadingTable.references
|
|
214
|
+
}]) : new ReplaceStoredValueCall(rewrite.table, rewrite.column, rewrite.from, rewrite.to, codec), rewrite];
|
|
215
|
+
}));
|
|
171
216
|
}
|
|
217
|
+
/** How the family's stored value code tells SQLite removals apart and builds replacements. */
|
|
218
|
+
const sqliteStoredValueCallClasses = {
|
|
219
|
+
isRemoval: (call) => call instanceof RemoveStoredValueCall,
|
|
220
|
+
replacementOf: (removal, { from, to }) => new ReplaceStoredValueCall(removal.tableName, removal.columnName, from, to, removal.codec, removal.path?.text)
|
|
221
|
+
};
|
|
172
222
|
const RENDER_ONLY_CODECS = { descriptorFor: () => void 0 };
|
|
173
|
-
/**
|
|
174
|
-
|
|
175
|
-
* operation's column: the removal as `migration.ts` writes it, replaced by a replacement whose new
|
|
176
|
-
* value is the placeholder `"<stored value>"`.
|
|
177
|
-
*/
|
|
178
|
-
function keepRowsEdit(table, column, mark) {
|
|
223
|
+
/** The removal a failed check's mark describes, as `migration.ts` writes it. */
|
|
224
|
+
function sqliteMarkedRemoval(mark) {
|
|
179
225
|
const codec = mark.codecRef === void 0 ? void 0 : {
|
|
180
226
|
codecRef: mark.codecRef,
|
|
181
227
|
codecs: RENDER_ONLY_CODECS
|
|
182
228
|
};
|
|
183
|
-
return
|
|
184
|
-
from: mark.value,
|
|
185
|
-
to: "<stored value>"
|
|
186
|
-
}]);
|
|
187
|
-
}
|
|
188
|
-
/** The positions, among the plan's operations, of the operations that carry out `statement`. */
|
|
189
|
-
function storedValueOperationIndexes(planCalls, calls, statement) {
|
|
190
|
-
const indexes = [];
|
|
191
|
-
let position = 0;
|
|
192
|
-
for (const call of planCalls) {
|
|
193
|
-
if ((call instanceof ReplaceStoredValueCall || call instanceof RemoveStoredValueCall ? calls.get(call) : void 0)?.statement === statement) indexes.push(position);
|
|
194
|
-
position += "companions" in call && Array.isArray(call.companions) ? 1 + call.companions.length : 1;
|
|
195
|
-
}
|
|
196
|
-
return indexes;
|
|
229
|
+
return new RemoveStoredValueCall(mark.table, mark.column, mark.value, codec, mark.enumValue, mark.path);
|
|
197
230
|
}
|
|
198
231
|
function createSqliteMigrationPlanner(lowerer) {
|
|
199
232
|
return new SqliteMigrationPlanner(lowerer);
|
|
@@ -254,17 +287,25 @@ var SqliteMigrationPlanner = class {
|
|
|
254
287
|
const defaultedBackfill = backfillOfDefaultedField(options.statements, options.fromContract, options.contract);
|
|
255
288
|
if (defaultedBackfill !== void 0) return plannerFailure([defaultedBackfill]);
|
|
256
289
|
const codecHooks = extractCodecControlHooks(options.frameworkComponents);
|
|
257
|
-
const
|
|
258
|
-
const
|
|
290
|
+
const types = sqlTypeLookupsOf(options.frameworkComponents);
|
|
291
|
+
const { codecLookup } = types;
|
|
292
|
+
const storedRewrites = planStoredRewrites({
|
|
259
293
|
statements: options.statements,
|
|
260
294
|
fromContract: options.fromContract,
|
|
261
295
|
contract: options.contract,
|
|
262
296
|
tables: sqliteSchemaTables(statements.value.schema),
|
|
263
|
-
|
|
297
|
+
types,
|
|
298
|
+
policy: options.policy,
|
|
299
|
+
calls: {
|
|
300
|
+
storedKeyCalls: sqliteStoredKeyCalls,
|
|
301
|
+
storedKeyFillCalls: (fills) => sqliteStoredKeyFillCalls(fills),
|
|
302
|
+
storedValueCalls: (rewrites) => sqliteStoredValueCalls(rewrites, codecLookup),
|
|
303
|
+
variantRowCalls: (rewrites) => sqliteVariantRowCalls(rewrites, codecLookup),
|
|
304
|
+
storedValueClasses: sqliteStoredValueCallClasses
|
|
305
|
+
}
|
|
264
306
|
});
|
|
265
|
-
if (!
|
|
266
|
-
const
|
|
267
|
-
const disallowedStoredValueCalls = [...storedValueCalls.keys()].filter((call) => !options.policy.allowedOperationClasses.includes(call.operationClass));
|
|
307
|
+
if (!storedRewrites.ok) return plannerFailure([storedRewrites.failure]);
|
|
308
|
+
const disallowedStoredValueCalls = storedRewrites.value.calls.filter((call) => !options.policy.allowedOperationClasses.includes(call.operationClass));
|
|
268
309
|
if (disallowedStoredValueCalls.length > 0) return plannerFailure(disallowedStoredValueCalls.map((call) => conflictForDisallowedCall(call, options.policy.allowedOperationClasses)));
|
|
269
310
|
const result = planIssues({
|
|
270
311
|
issues,
|
|
@@ -294,7 +335,7 @@ var SqliteMigrationPlanner = class {
|
|
|
294
335
|
...statements.value.calls,
|
|
295
336
|
...replacedIndexes.calls,
|
|
296
337
|
...result.value.calls,
|
|
297
|
-
...
|
|
338
|
+
...storedRewrites.value.calls,
|
|
298
339
|
...fieldEventOps
|
|
299
340
|
];
|
|
300
341
|
const destination = {
|
|
@@ -307,12 +348,13 @@ var SqliteMigrationPlanner = class {
|
|
|
307
348
|
from: options.origin?.storageHash ?? null,
|
|
308
349
|
to: options.contract.storage.storageHash
|
|
309
350
|
}, options.spaceId, options.snapshotsImportPath, destination, this.#lowerer),
|
|
310
|
-
appliedStatements:
|
|
311
|
-
...subjectsOfCalls(sqliteCallSubjects(calls, new Map(fieldEventCalls.map((fieldEvent) => [fieldEvent.call, fieldEvent])),
|
|
351
|
+
appliedStatements: appliedStatementsInOrder(options.statements, statements.value.plannedStatements, (statement) => storedRewrites.value.operationIndexes(calls, statement)),
|
|
352
|
+
...subjectsOfCalls(sqliteCallSubjects(calls, new Map(fieldEventCalls.map((fieldEvent) => [fieldEvent.call, fieldEvent])), storedRewrites.value.storedValues, storedRewrites.value.storedKeys, storedRewrites.value.variantRows, (table) => tablesReferencing(options.contract, table)), {
|
|
312
353
|
fromContract: options.fromContract,
|
|
313
354
|
contract: options.contract,
|
|
314
355
|
origins: statements.value.origins,
|
|
315
|
-
byHand: sqliteTableRenameByHand
|
|
356
|
+
byHand: sqliteTableRenameByHand,
|
|
357
|
+
removedVariants: storedRewrites.value.removedVariants
|
|
316
358
|
})
|
|
317
359
|
};
|
|
318
360
|
}
|
|
@@ -445,7 +487,12 @@ function retainUnownedExtras(issues, ownership) {
|
|
|
445
487
|
});
|
|
446
488
|
});
|
|
447
489
|
}
|
|
490
|
+
/** The tables of `contract` with a foreign key to `table`. */
|
|
491
|
+
function tablesReferencing(contract, table) {
|
|
492
|
+
const tables = contract.storage.namespaces[UNBOUND_NAMESPACE_ID]?.entries.table ?? {};
|
|
493
|
+
return Object.entries(tables).flatMap(([name, candidate]) => candidate.foreignKeys.some(({ target }) => target.tableName === table) ? [name] : []);
|
|
494
|
+
}
|
|
448
495
|
//#endregion
|
|
449
|
-
export { createSqliteMigrationPlanner as n,
|
|
496
|
+
export { sqliteStoredValueCallClasses as i, createSqliteMigrationPlanner as n, sqliteMarkedRemoval as r, SqliteMigrationPlanner as t };
|
|
450
497
|
|
|
451
|
-
//# sourceMappingURL=planner-
|
|
498
|
+
//# sourceMappingURL=planner-DgEGQuj9-Ca6jqWrd.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-DgEGQuj9-Ca6jqWrd.mjs","names":["#lowerer"],"sources":["../../../../3-targets/sqlite/1-target/dist/planner-DgEGQuj9.mjs"],"sourcesContent":["import { a as sqliteTableRenameByHand, c as sqliteSchemaTables, d as coalesceSubtreeIssues, f as conflictForDisallowedCall, g as buildSqlitePlanDiff, h as sqlitePlannerStrategies, i as sqliteColumnRenameCall, l as indexNameCaseChange, m as planIssues, n as renameTableByHandStatements, o as sqliteTableRenameCall, p as issueNode, r as renderRenameTableCall, s as createWorkingSchema, u as pairIndexReplacements, v as sqliteActualSchema } from \"./sqlite-migration-B42dCAqX.mjs\";\nimport { _ as ReplaceStoredValueCall, a as DeleteRowsCall, c as DropTableCall, d as RecreateTableCall, f as RemoveStoredKeyCall, h as RenameStoredKeyCall, l as FillStoredKeyCall, o as DropColumnCall, p as RemoveStoredValueCall, u as RawSqlCall } from \"./op-factory-call-Dxsyn5gF.mjs\";\nimport { t as TypeScriptRenderableSqliteMigration } from \"./planner-produced-sqlite-migration-BMogETJ0.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { enumValueCoordinateJson, isRenameStatement, issueOutcome } from \"@internal/framework-components/control\";\nimport { UnfilledValue, appliedStatementsInOrder, backfillOfDefaultedField, columnTakesTemporaryValue, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldStatementColumns, planFieldEventCalls, planStatements, planStoredRewrites, plannerFailure, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, unknownCallNames } from \"@internal/family-sql/control\";\nimport { RelationalSchemaNodeKind, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { ok } from \"@internal/utils/result\";\n//#region src/core/migrations/operation-subjects.ts\nfunction lost(target, loss = \"drop\") {\n\treturn {\n\t\t...target,\n\t\tloss\n\t};\n}\nfunction tableTarget(table) {\n\treturn {\n\t\tstorageName: table,\n\t\ttable: {\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\ttable,\n\t\t\tcolumn: void 0\n\t\t}\n\t};\n}\nfunction columnTarget(table, column) {\n\treturn {\n\t\tstorageName: `${table}.${column}`,\n\t\ttable: {\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\ttable,\n\t\t\tcolumn\n\t\t}\n\t};\n}\nfunction operationCountOf(call) {\n\treturn \"companions\" in call && Array.isArray(call.companions) ? 1 + call.companions.length : 1;\n}\n/**\n* The columns a recreate loses: those the new table leaves out, whose values the copy drops, and,\n* when the recreate is destructive, those whose type it changes with no copy expression to convert them.\n*/\nfunction recreateLosses(call) {\n\tconst kept = new Set(call.contractTable.columns.map((column) => column.name));\n\tconst dropped = call.schemaColumnNames.filter((column) => !kept.has(column));\n\tconst retyped = call.operationClass === \"destructive\" ? call.retypedColumns.filter((column) => !Object.hasOwn(call.copyExpressions, column)) : [];\n\treturn [...dropped.map((column) => ({\n\t\tcolumn,\n\t\tloss: \"drop\"\n\t})), ...retyped.map((column) => ({\n\t\tcolumn,\n\t\tloss: \"typeChange\"\n\t}))];\n}\n/** The columns a recreate adds with a value its copy writes into every existing row. */\nfunction temporaryValuesOf(call) {\n\tconst copied = new Set(call.schemaColumnNames);\n\treturn Object.entries(call.temporaryValues).flatMap(([column, expression]) => copied.has(column) || expression.kind !== \"sql\" ? [] : [{\n\t\ttable: call.tableName,\n\t\tcolumn,\n\t\tvalue: expression.sql\n\t}]);\n}\n/** What to do about the rows of `tables` that reference deleted rows, which the SQLite runner does not delete. */\nfunction referencedRowsAdvice(tables) {\n\treturn `SQLite migrations run with foreign keys off, so deleting these rows does not delete the rows of ${tables.map((table) => `\"${table}\"`).join(\", \")} that reference them: the apply then fails at PRAGMA foreign_key_check. Delete or change those rows first.`;\n}\n/**\n* What each call of a SQLite plan loses. A recreate that leaves a column out loses its values\n* itself, so a later drop of that column is not listed again.\n*/\nfunction sqliteCallSubjects(calls, fieldEvents, storedValues = /* @__PURE__ */ new Map(), storedKeys = /* @__PURE__ */ new Map(), variantRows = /* @__PURE__ */ new Map(), referencingTables = () => []) {\n\tconst lostColumns = /* @__PURE__ */ new Set();\n\tconst unknownNames = unknownCallNames(calls.filter((call) => call.operationClass === \"destructive\" && !(call instanceof RecreateTableCall) && !(call instanceof DropColumnCall) && !(call instanceof DropTableCall) && !(call instanceof RawSqlCall) && !(call instanceof RemoveStoredValueCall) && !(call instanceof RemoveStoredKeyCall) && !(call instanceof DeleteRowsCall) && !fieldEvents.has(call)));\n\treturn calls.map((call) => {\n\t\tconst operationCount = operationCountOf(call);\n\t\tconst { label } = call;\n\t\tif (call instanceof RecreateTableCall) {\n\t\t\tconst columns = recreateLosses(call);\n\t\t\tfor (const { column } of columns) lostColumns.add(`${call.tableName}.${column}`);\n\t\t\treturn {\n\t\t\t\toperationCount,\n\t\t\t\tlabel,\n\t\t\t\tdataLoss: columns.length === 0 && call.operationClass === \"destructive\" ? [lost(tableTarget(call.tableName))] : columns.map(({ column, loss }) => lost(columnTarget(call.tableName, column), loss)),\n\t\t\t\taccessChanges: [],\n\t\t\t\ttemporaryValues: temporaryValuesOf(call)\n\t\t\t};\n\t\t}\n\t\tif (call instanceof DropColumnCall) return {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: lostColumns.has(`${call.tableName}.${call.columnName}`) ? [] : [lost(columnTarget(call.tableName, call.columnName))],\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tif (call instanceof DeleteRowsCall) {\n\t\t\tconst cascaded = new Set(call.cascade.map(({ table }) => table));\n\t\t\tconst referencing = referencingTables(call.tableName).filter((table) => !cascaded.has(table));\n\t\t\treturn {\n\t\t\t\toperationCount,\n\t\t\t\tlabel,\n\t\t\t\tdataLoss: [{\n\t\t\t\t\t...lost(tableTarget(call.tableName)),\n\t\t\t\t\t...ifDefined(\"model\", variantRows.get(call)),\n\t\t\t\t\t...ifDefined(\"keepDataAdvice\", referencing.length === 0 ? void 0 : referencedRowsAdvice(referencing))\n\t\t\t\t}],\n\t\t\t\taccessChanges: [],\n\t\t\t\ttemporaryValues: []\n\t\t\t};\n\t\t}\n\t\tif (call instanceof RemoveStoredKeyCall) return {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: [{\n\t\t\t\t...lost(columnTarget(call.tableName, call.columnName)),\n\t\t\t\t...ifDefined(\"valueObjectField\", storedKeys.get(call))\n\t\t\t}],\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tif (call instanceof RemoveStoredValueCall) {\n\t\t\tconst subject = storedValues.get(call);\n\t\t\treturn {\n\t\t\t\toperationCount,\n\t\t\t\tlabel,\n\t\t\t\tdataLoss: [{\n\t\t\t\t\t...lost(columnTarget(call.tableName, call.columnName)),\n\t\t\t\t\t...ifDefined(\"enumValue\", subject?.enumValue),\n\t\t\t\t\t...ifDefined(\"keepDataEdit\", subject?.keepDataEdit)\n\t\t\t\t}],\n\t\t\t\taccessChanges: [],\n\t\t\t\ttemporaryValues: []\n\t\t\t};\n\t\t}\n\t\tif (call instanceof DropTableCall) return {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: [lost(tableTarget(call.tableName))],\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tif (call instanceof FillStoredKeyCall) {\n\t\t\tconst valueObjectField = storedKeys.get(call);\n\t\t\treturn {\n\t\t\t\toperationCount,\n\t\t\t\tlabel,\n\t\t\t\tdataLoss: [],\n\t\t\t\taccessChanges: [],\n\t\t\t\ttemporaryValues: call.value instanceof UnfilledValue || valueObjectField === void 0 ? [] : [{\n\t\t\t\t\ttable: call.tableName,\n\t\t\t\t\tcolumn: call.columnName,\n\t\t\t\t\tvalue: JSON.stringify(call.value),\n\t\t\t\t\tvalueObjectField\n\t\t\t\t}]\n\t\t\t};\n\t\t}\n\t\tif (call.operationClass !== \"destructive\") return {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: [],\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t\tconst fieldEvent = fieldEvents.get(call);\n\t\treturn {\n\t\t\toperationCount,\n\t\t\tlabel,\n\t\t\tdataLoss: [lost(call instanceof RawSqlCall ? {\n\t\t\t\tstorageName: storageNameOfOperation(call.op),\n\t\t\t\ttable: void 0\n\t\t\t} : fieldEvent !== void 0 ? fieldEventStorage(fieldEvent) : {\n\t\t\t\tstorageName: unknownNames.get(call) ?? call.factoryName,\n\t\t\t\ttable: void 0\n\t\t\t})],\n\t\t\taccessChanges: [],\n\t\t\ttemporaryValues: []\n\t\t};\n\t});\n}\n//#endregion\n//#region src/core/migrations/stored-value-calls.ts\n/** The calls that carry out a plan's stored value rewrites, each with the rewrite it carries out. */\nfunction sqliteStoredValueCalls(rewrites, codecs) {\n\treturn new Map(rewrites.map((rewrite) => {\n\t\tconst codec = rewrite.codecRef === void 0 ? void 0 : {\n\t\t\tcodecRef: rewrite.codecRef,\n\t\t\tcodecs\n\t\t};\n\t\tconst { member } = rewrite;\n\t\treturn [rewrite.to === void 0 ? new RemoveStoredValueCall(rewrite.table, rewrite.column, rewrite.from, codec, enumValueCoordinateJson(rewrite.enumValue), member?.path, member?.nullable === true ? true : void 0) : new ReplaceStoredValueCall(rewrite.table, rewrite.column, rewrite.from, rewrite.to, codec, member?.path), rewrite];\n\t}));\n}\n/** The calls that carry out a plan's key rewrites of value object fields, each with the rewrite it carries out. */\nfunction sqliteStoredKeyCalls(rewrites) {\n\treturn new Map(rewrites.map((rewrite) => [rewrite.to === void 0 ? new RemoveStoredKeyCall(rewrite.table, rewrite.column, rewrite.path) : new RenameStoredKeyCall(rewrite.table, rewrite.column, rewrite.path, rewrite.to), rewrite]));\n}\n/** The calls that carry out a plan's fills of value object fields, each with the fill it carries out. */\nfunction sqliteStoredKeyFillCalls(fills) {\n\treturn new Map(fills.map((fill) => [new FillStoredKeyCall(fill.table, fill.column, fill.path, fill.value, {\n\t\ttext: fill.field,\n\t\tcheck: void 0\n\t}), fill]));\n}\n/** The calls that carry out a plan's row rewrites of variants, each with the rewrite it carries out. */\nfunction sqliteVariantRowCalls(rewrites, codecs) {\n\treturn new Map(rewrites.map((rewrite) => {\n\t\tconst codec = {\n\t\t\tcodecRef: rewrite.codecRef,\n\t\t\tcodecs\n\t\t};\n\t\treturn [rewrite.to === void 0 ? new DeleteRowsCall(rewrite.table, rewrite.column, rewrite.from, codec, rewrite.cascadingTable === void 0 ? [] : [{\n\t\t\ttable: rewrite.cascadingTable.table,\n\t\t\tcolumns: rewrite.cascadingTable.columns,\n\t\t\treferences: rewrite.cascadingTable.references\n\t\t}]) : new ReplaceStoredValueCall(rewrite.table, rewrite.column, rewrite.from, rewrite.to, codec), rewrite];\n\t}));\n}\n/** How the family's stored value code tells SQLite removals apart and builds replacements. */\nconst sqliteStoredValueCallClasses = {\n\tisRemoval: (call) => call instanceof RemoveStoredValueCall,\n\treplacementOf: (removal, { from, to }) => new ReplaceStoredValueCall(removal.tableName, removal.columnName, from, to, removal.codec, removal.path?.text)\n};\nconst RENDER_ONLY_CODECS = { descriptorFor: () => void 0 };\n/** The removal a failed check's mark describes, as `migration.ts` writes it. */\nfunction sqliteMarkedRemoval(mark) {\n\tconst codec = mark.codecRef === void 0 ? void 0 : {\n\t\tcodecRef: mark.codecRef,\n\t\tcodecs: RENDER_ONLY_CODECS\n\t};\n\treturn new RemoveStoredValueCall(mark.table, mark.column, mark.value, codec, mark.enumValue, mark.path);\n}\n//#endregion\n//#region src/core/migrations/planner.ts\nfunction createSqliteMigrationPlanner(lowerer) {\n\treturn new SqliteMigrationPlanner(lowerer);\n}\n/**\n* SQLite migration planner — a thin wrapper over `planIssues`.\n*\n* `plan()` diffs the live schema against the target contract via the one\n* differ (`buildSqlitePlanDiff`, producing node-typed `SchemaDiffIssue[]`)\n* and delegates to `planIssues` with the registered strategies. Strategies\n* absorb groups of related issues into composite recipes (e.g. recreating a\n* table to apply type/nullability/default/constraint changes at once);\n* anything not absorbed by a strategy flows through `mapNodeIssueToCall` in\n* the issue planner as a one-off call.\n*\n* FK-backing indexes are already merged into the expected table node's\n* `indexes` at derivation (`contractToSchemaIR`'s `convertTable`), so\n* `mapNodeIssueToCall` handles them uniformly alongside user-declared\n* indexes — no separate expansion step in the planner.\n*/\nvar SqliteMigrationPlanner = class {\n\t#lowerer;\n\tconstructor(lowerer) {\n\t\tthis.#lowerer = lowerer;\n\t}\n\tplan(options) {\n\t\treturn this.planSql(options);\n\t}\n\temptyMigration(context, spaceId) {\n\t\treturn new TypeScriptRenderableSqliteMigration([], {\n\t\t\tfrom: context.fromHash,\n\t\t\tto: context.toHash\n\t\t}, spaceId, context.snapshotsImportPath, void 0, this.#lowerer);\n\t}\n\tplanSql(options) {\n\t\tconst policyResult = this.ensureAdditivePolicy(options.policy);\n\t\tif (policyResult) return policyResult;\n\t\tconst statements = this.planStatements(options);\n\t\tif (!statements.ok) return plannerFailure([statements.failure]);\n\t\tconst { expected, actual, issues: diffIssues } = this.collectSchemaIssues(options, statements.value.schema);\n\t\tconst replacedIndexes = pairIndexReplacements(diffIssues, indexNameCaseChange);\n\t\tconst disallowedIndexCalls = replacedIndexes.calls.filter((call) => !options.policy.allowedOperationClasses.includes(call.operationClass));\n\t\tif (disallowedIndexCalls.length > 0) return plannerFailure(disallowedIndexCalls.map((call) => conflictForDisallowedCall(call, options.policy.allowedOperationClasses)));\n\t\tconst issues = diffIssues.filter((issue) => !replacedIndexes.consumed.has(issue));\n\t\tconst caseChangeConflicts = detectTableNameCaseChanges({\n\t\t\tissues,\n\t\t\ttableOf: (issue) => {\n\t\t\t\tconst node = issueNode(issue);\n\t\t\t\treturn node instanceof SqlTableIR ? node : void 0;\n\t\t\t},\n\t\t\tnamespaceIdOf: () => UNBOUND_NAMESPACE_ID,\n\t\t\trenameByHandStatements: renameTableByHandStatements,\n\t\t\trenameTableCall: renderRenameTableCall,\n\t\t\tcontract: options.contract,\n\t\t\tdefaultNamespaceId: UNBOUND_NAMESPACE_ID\n\t\t});\n\t\tif (caseChangeConflicts.length > 0) return plannerFailure(caseChangeConflicts);\n\t\tconst defaultedBackfill = backfillOfDefaultedField(options.statements, options.fromContract, options.contract);\n\t\tif (defaultedBackfill !== void 0) return plannerFailure([defaultedBackfill]);\n\t\tconst codecHooks = extractCodecControlHooks(options.frameworkComponents);\n\t\tconst types = sqlTypeLookupsOf(options.frameworkComponents);\n\t\tconst { codecLookup } = types;\n\t\tconst storedRewrites = planStoredRewrites({\n\t\t\tstatements: options.statements,\n\t\t\tfromContract: options.fromContract,\n\t\t\tcontract: options.contract,\n\t\t\ttables: sqliteSchemaTables(statements.value.schema),\n\t\t\ttypes,\n\t\t\tpolicy: options.policy,\n\t\t\tcalls: {\n\t\t\t\tstoredKeyCalls: sqliteStoredKeyCalls,\n\t\t\t\tstoredKeyFillCalls: (fills) => sqliteStoredKeyFillCalls(fills),\n\t\t\t\tstoredValueCalls: (rewrites) => sqliteStoredValueCalls(rewrites, codecLookup),\n\t\t\t\tvariantRowCalls: (rewrites) => sqliteVariantRowCalls(rewrites, codecLookup),\n\t\t\t\tstoredValueClasses: sqliteStoredValueCallClasses\n\t\t\t}\n\t\t});\n\t\tif (!storedRewrites.ok) return plannerFailure([storedRewrites.failure]);\n\t\tconst disallowedStoredValueCalls = storedRewrites.value.calls.filter((call) => !options.policy.allowedOperationClasses.includes(call.operationClass));\n\t\tif (disallowedStoredValueCalls.length > 0) return plannerFailure(disallowedStoredValueCalls.map((call) => conflictForDisallowedCall(call, options.policy.allowedOperationClasses)));\n\t\tconst result = planIssues({\n\t\t\tissues,\n\t\t\texpected,\n\t\t\tactual,\n\t\t\tpolicy: options.policy,\n\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\tstatementColumns: fieldStatementColumns(options.statements, options.contract),\n\t\t\toriginCodecId: (table, column) => options.fromContract?.storage.namespaces[UNBOUND_NAMESPACE_ID]?.entries.table?.[table]?.columns[column]?.codecId,\n\t\t\ttakesTemporaryValue: (table, column) => {\n\t\t\t\tconst storageTable = options.contract.storage.namespaces[UNBOUND_NAMESPACE_ID]?.entries.table?.[table];\n\t\t\t\treturn storageTable !== void 0 && columnTakesTemporaryValue(storageTable, column);\n\t\t\t},\n\t\t\tstrategies: sqlitePlannerStrategies\n\t\t});\n\t\tif (!result.ok) return plannerFailure(result.failure);\n\t\tconst fieldEventCalls = planFieldEventCalls({\n\t\t\tpriorContract: options.origin === null ? null : options.fromContract,\n\t\t\tnewContract: options.contract,\n\t\t\tcodecHooks,\n\t\t\ttableRenames: statements.value.tableRenames,\n\t\t\tcolumnRenames: statements.value.columnRenames,\n\t\t\tdataTypes: sqlTypeLookupsOf(options.frameworkComponents).dataTypeLookup\n\t\t});\n\t\tconst fieldEventOps = fieldEventCalls.map(({ call }) => call);\n\t\tconst calls = [\n\t\t\t...statements.value.calls,\n\t\t\t...replacedIndexes.calls,\n\t\t\t...result.value.calls,\n\t\t\t...storedRewrites.value.calls,\n\t\t\t...fieldEventOps\n\t\t];\n\t\tconst destination = {\n\t\t\tstorageHash: options.contract.storage.storageHash,\n\t\t\t...options.contract.profileHash !== void 0 ? { profileHash: options.contract.profileHash } : {}\n\t\t};\n\t\treturn {\n\t\t\tkind: \"success\",\n\t\t\tplan: new TypeScriptRenderableSqliteMigration(calls, {\n\t\t\t\tfrom: options.origin?.storageHash ?? null,\n\t\t\t\tto: options.contract.storage.storageHash\n\t\t\t}, options.spaceId, options.snapshotsImportPath, destination, this.#lowerer),\n\t\t\tappliedStatements: appliedStatementsInOrder(options.statements, statements.value.plannedStatements, (statement) => storedRewrites.value.operationIndexes(calls, statement)),\n\t\t\t...subjectsOfCalls(sqliteCallSubjects(calls, new Map(fieldEventCalls.map((fieldEvent) => [fieldEvent.call, fieldEvent])), storedRewrites.value.storedValues, storedRewrites.value.storedKeys, storedRewrites.value.variantRows, (table) => tablesReferencing(options.contract, table)), {\n\t\t\t\tfromContract: options.fromContract,\n\t\t\t\tcontract: options.contract,\n\t\t\t\torigins: statements.value.origins,\n\t\t\t\tbyHand: sqliteTableRenameByHand,\n\t\t\t\tremovedVariants: storedRewrites.value.removedVariants\n\t\t\t})\n\t\t};\n\t}\n\t/**\n\t* Plans the statements against a working copy of the schema the plan starts from, in order, so\n\t* each rename's index replacements are computed against the schema the earlier statements left.\n\t* The diff then runs on that schema.\n\t*/\n\tplanStatements(options) {\n\t\tconst working = createWorkingSchema(sqliteActualSchema(options.schema));\n\t\tconst planned = planStatements({\n\t\t\tstatements: options.statements.filter(isRenameStatement),\n\t\t\tfromContract: options.fromContract,\n\t\t\tcontract: options.contract,\n\t\t\tpolicy: options.policy,\n\t\t\ttarget: {\n\t\t\t\ttables: () => sqliteSchemaTables(working.current),\n\t\t\t\trenameTableCall: (rename) => sqliteTableRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\trenameColumnCall: (rename) => sqliteColumnRenameCall({\n\t\t\t\t\tprevious: working.current,\n\t\t\t\t\tcontract: options.contract,\n\t\t\t\t\trename,\n\t\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t\t}),\n\t\t\t\tapply: (call) => working.apply(call),\n\t\t\t\t...sqliteTableRenameByHand\n\t\t\t}\n\t\t});\n\t\tif (!planned.ok) return planned;\n\t\treturn ok({\n\t\t\t...planned.value,\n\t\t\tschema: working.current\n\t\t});\n\t}\n\tensureAdditivePolicy(policy) {\n\t\tif (!policy.allowedOperationClasses.includes(\"additive\")) return plannerFailure([{\n\t\t\tkind: \"unsupportedOperation\",\n\t\t\tsummary: \"Migration planner requires additive operations be allowed\",\n\t\t\twhy: \"The planner requires the \\\"additive\\\" operation class to be allowed in the policy.\"\n\t\t}]);\n\t\treturn null;\n\t}\n\t/**\n\t* Diffs the target contract against the live schema via the one differ\n\t* (the same tree-building `diffSqliteSchema` uses, plus the\n\t* op-render stamper) and prepares the issue list `planIssues` consumes.\n\t*\n\t* Three passes, in order:\n\t* 1. Subtree coalescing — the differ is total (a missing/extra table also\n\t* emits an issue for every column/constraint under it); those nested\n\t* issues are redundant once the table-level `CreateTable`/`DropTable`\n\t* call already accounts for the whole subtree. Runs FIRST, over the\n\t* complete diff: a sibling-owned extra table's column issues must\n\t* collapse into its one table-level issue before the ownership pass,\n\t* because a bare column node carries no table reference — if coalescing\n\t* ran after ownership dropped the table-level issue, the orphaned column\n\t* issues would survive and the planner would emit drops against a\n\t* sibling space's table.\n\t* 2. Ownership — a live extra is only this plan's to drop when no contract\n\t* space owns it. The differ ran against THIS space's contract, so a\n\t* table a sibling owns surfaces here as `not-expected`; the planner asks\n\t* the ownership oracle (the passive aggregate) whether any space declares\n\t* it and, if so, leaves it alone. A table no space owns stays a genuine\n\t* extra. Ownership lives in the aggregate; the planner only asks. No\n\t* oracle (single-space) keeps every extra.\n\t* 3. Strict-mode extras gating — `not-expected` (extra table/column/\n\t* constraint) issues are dropped entirely outside strict mode, mirroring\n\t* the retired coordinate walk's `if (strict) { ...extra_* } }` guards:\n\t* an additive-only plan must never even consider dropping an unclaimed\n\t* object, not just refuse to emit the drop.\n\t*/\n\tcollectSchemaIssues(options, schema) {\n\t\tconst allowed = options.policy.allowedOperationClasses;\n\t\tconst strict = allowed.includes(\"widening\") || allowed.includes(\"destructive\");\n\t\tconst { expected, actual, issues: rawIssues } = buildSqlitePlanDiff({\n\t\t\tcontract: options.contract,\n\t\t\tactualSchema: schema,\n\t\t\tframeworkComponents: options.frameworkComponents\n\t\t});\n\t\tconst owned = retainUnownedExtras(coalesceSubtreeIssues(rawIssues), options.ownership);\n\t\treturn {\n\t\t\texpected,\n\t\t\tactual,\n\t\t\tissues: strict ? owned : owned.filter((issue) => issueOutcome(issue) !== \"not-expected\")\n\t\t};\n\t}\n};\n/**\n* Drops a `not-expected` issue when it is a whole extra TABLE that some\n* contract space owns, asking the ownership oracle per node.\n*\n* The consultation applies ONLY to table-level extras — a live table this\n* space's contract lacks — identified by asking the issue's own node\n* (`nodeKind === table`), never by counting path segments. SQLite is a\n* single-namespace target, so every coordinate is qualified with the shared\n* `UNBOUND_NAMESPACE_ID` sentinel (the same one the aggregate's declared\n* entities carry for this target). `entityKind` is the literal `'table'`:\n* this function only ever asks about a node already confirmed to be\n* `RelationalSchemaNodeKind.table` (checked just above), and that's a\n* diff-tree `nodeKind` spelling (`'sql-table'`) distinct from the storage\n* `entries` vocabulary `elementCoordinates` walks (`'table'`) — the literal\n* is that storage-entries spelling. `declaresEntity` answers over the whole\n* composition (self included), so a positive answer on such a table means\n* another space owns it (a table this space owned would be in its expected\n* tree, never an extra): leave it. A negative answer means no space owns\n* it — a genuine orphan to drop.\n*\n* A DEEPER extra (an extra column/constraint on a table this space DOES own —\n* only the child drifted, so the table is in the expected tree) is this\n* space's own drift and is always kept for dropping; asking the oracle there\n* would wrongly suppress it, because the owned table answers `true`. No oracle\n* ⇒ every extra is kept (single-space plan).\n*/\nfunction retainUnownedExtras(issues, ownership) {\n\tif (ownership === void 0) return issues;\n\treturn issues.filter((issue) => {\n\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\tconst node = issueNode(issue);\n\t\tif (node === void 0 || node.nodeKind !== RelationalSchemaNodeKind.table) return true;\n\t\tconst tableName = issue.path[1];\n\t\treturn tableName === void 0 || !ownership.declaresEntity({\n\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: tableName\n\t\t});\n\t});\n}\n/** The tables of `contract` with a foreign key to `table`. */\nfunction tablesReferencing(contract, table) {\n\tconst tables = contract.storage.namespaces[UNBOUND_NAMESPACE_ID]?.entries.table ?? {};\n\treturn Object.entries(tables).flatMap(([name, candidate]) => candidate.foreignKeys.some(({ target }) => target.tableName === table) ? [name] : []);\n}\n//#endregion\nexport { sqliteStoredValueCallClasses as i, createSqliteMigrationPlanner as n, sqliteMarkedRemoval as r, SqliteMigrationPlanner as t };\n\n//# sourceMappingURL=planner-DgEGQuj9.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,KAAK,QAAQ,OAAO,QAAQ;CACpC,OAAO;EACN,GAAG;EACH;CACD;AACD;AACA,SAAS,YAAY,OAAO;CAC3B,OAAO;EACN,aAAa;EACb,OAAO;GACN,aAAa;GACb;GACA,QAAQ,KAAK;EACd;CACD;AACD;AACA,SAAS,aAAa,OAAO,QAAQ;CACpC,OAAO;EACN,aAAa,GAAG,MAAM,GAAG;EACzB,OAAO;GACN,aAAa;GACb;GACA;EACD;CACD;AACD;AACA,SAAS,iBAAiB,MAAM;CAC/B,OAAO,gBAAgB,QAAQ,MAAM,QAAQ,KAAK,UAAU,IAAI,IAAI,KAAK,WAAW,SAAS;AAC9F;;;;;AAK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UAAU,eAAe;GACxD,aAAa;GACb,YAAY;GACZ,YAAY;EACb,CAAC;CACF,CAAC;AACF;;AAEA,SAAS,kBAAkB,UAAU,OAAO;CAC3C,MAAM,SAAS,SAAS,QAAQ,WAAW,qBAAqB,EAAE,QAAQ,SAAS,CAAC;CACpF,OAAO,OAAO,QAAQ,MAAM,CAAC,CAAC,SAAS,CAAC,MAAM,eAAe,UAAU,YAAY,MAAM,EAAE,aAAa,OAAO,cAAc,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;AAClJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as SqlitePlanTargetDetails } from "./planner-target-details-B-qtfkmj-DIGpv7YQ.mjs";
|
|
2
|
-
import { n as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-
|
|
2
|
+
import { n as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-BHH_ftCV-CndNmTrH.mjs";
|
|
3
3
|
import { AppliedMigrationStatement, MigrationAccessChange, MigrationDataLoss, MigrationPlanner, MigrationScaffoldContext, MigrationTemporaryValue, PlanOrigin, ResolvedMigrationStatement, SchemaOwnership } from "@prisma/orm-framework/components/control";
|
|
4
4
|
import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
|
|
5
5
|
import { MigrationOperationPolicy, SqlMigrationPlanner, SqlPlannerFailureResult } from "@prisma/orm-family-sql/family/control";
|
|
@@ -112,4 +112,4 @@ declare class SqliteMigrationPlanner implements SqlMigrationPlanner<SqlitePlanTa
|
|
|
112
112
|
}
|
|
113
113
|
//#endregion
|
|
114
114
|
export { SqlitePlanResult as n, createSqliteMigrationPlanner as r, SqliteMigrationPlanner as t };
|
|
115
|
-
//# sourceMappingURL=planner-
|
|
115
|
+
//# sourceMappingURL=planner-ccevdpwf.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-
|
|
1
|
+
{"version":3,"file":"planner-ccevdpwf.d.mts","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/planner.d.mts"],"mappings":";;;;;;;;;iBAQiB,6BAA6B,SAAS,wBAAwB;KAC1E;WACM;WACA,MAAM;WACN,4BAA4B;WAC5B,mBAAmB;WACnB,wBAAwB;WACxB,0BAA0B;IACjC;;;;;;;;;;;;;;;;;cAiBU,kCAAkC,oBAAoB,0BAA0B;;EAE5F,YAAY,SAAS;EACrB,KAAK;aACM;aACA;aACA,QAAQ;;;;;;;;;aASR,cAAc;;aAEd,QAAQ;aACR,qBAAqB;aACrB,qBAAqB,cAAc;;;;;;aAMnC;;;;;aAKA,YAAY;;;;;;aAMZ;MACP;EACJ,eAAe,SAAS,0BAA0B,kBAAkB;UAC5D;;;;;;UAMA;UACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as SqlitePlanTargetDetails } from "./planner-target-details-B-qtfkmj-DIGpv7YQ.mjs";
|
|
2
|
-
import { t as SqliteMigration } from "./sqlite-migration-
|
|
2
|
+
import { t as SqliteMigration } from "./sqlite-migration-C_9TPlLD-DtKN8bi9.mjs";
|
|
3
3
|
import { MigrationPlanWithAuthoringSurface, OpFactoryCall } from "@prisma/orm-framework/components/control";
|
|
4
4
|
import { SqlMigrationPlanOperation } from "@prisma/orm-family-sql/family/control";
|
|
5
5
|
import { MigrationMeta } from "@prisma/orm-toolchain/migration-tools/migration";
|
|
6
6
|
import { ImportSpecifierResolver } from "@prisma/orm-framework/components/emission";
|
|
7
7
|
import { ExecuteRequestLowerer } from "@prisma/orm-family-sql/family/control-adapter";
|
|
8
|
-
//#region ../../../3-targets/sqlite/1-target/dist/planner-produced-sqlite-migration-
|
|
8
|
+
//#region ../../../3-targets/sqlite/1-target/dist/planner-produced-sqlite-migration-BHH_ftCV.d.mts
|
|
9
9
|
//#region src/core/migrations/planner-produced-sqlite-migration.d.ts
|
|
10
10
|
type Op = SqlMigrationPlanOperation<SqlitePlanTargetDetails>;
|
|
11
11
|
interface SqliteMigrationDestinationInfo {
|
|
@@ -28,4 +28,4 @@ declare class TypeScriptRenderableSqliteMigration extends SqliteMigration implem
|
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
30
|
export { TypeScriptRenderableSqliteMigration as n, SqliteMigrationDestinationInfo as t };
|
|
31
|
-
//# sourceMappingURL=planner-produced-sqlite-migration-
|
|
31
|
+
//# sourceMappingURL=planner-produced-sqlite-migration-BHH_ftCV-CndNmTrH.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-produced-sqlite-migration-BHH_ftCV-CndNmTrH.d.mts","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/planner-produced-sqlite-migration-BHH_ftCV.d.mts"],"mappings":";;;;;;;;;KAQK,KAAK,0BAA0B;UAC1B;WACC;WACA;;cAEG,4CAA4C,2BAA2B;;EAEnF,YAAY,gBAAgB,iBAAiB,MAAM,eAAe,iBAAiB,6BAA6B,cAAc,gCAAgC,UAAU;MACpK,wBAAwB,KAAK,QAAQ;EACzC,YAAY;MACR,eAAe;;;;;;MAMf;EACJ,iBAAiB,wBAAwB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as SqliteMigration } from "./sqlite-migration-
|
|
2
|
-
import { t as renderOps } from "./render-ops-
|
|
1
|
+
import { t as SqliteMigration } from "./sqlite-migration-B42dCAqX-DiSO-PeZ.mjs";
|
|
2
|
+
import { t as renderOps } from "./render-ops-BUk3wlAR-Awdho1_L.mjs";
|
|
3
3
|
import { contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier } from "@prisma/orm-framework/components/control";
|
|
4
4
|
import { renderImports } from "@prisma/orm-framework/ts-render";
|
|
5
5
|
import { resolveRequirementSpecifiers } from "@prisma/orm-framework/components/emission";
|
|
6
6
|
import { detectScaffoldRuntime, shebangLineFor } from "@prisma/orm-toolchain/migration-tools/migration-ts";
|
|
7
|
-
//#region ../../../3-targets/sqlite/1-target/dist/planner-produced-sqlite-migration-
|
|
7
|
+
//#region ../../../3-targets/sqlite/1-target/dist/planner-produced-sqlite-migration-BMogETJ0.mjs
|
|
8
8
|
/**
|
|
9
9
|
* Polymorphic TypeScript emitter for the SQLite migration IR. Mirrors the
|
|
10
10
|
* Postgres `render-typescript.ts` — different base-class + factory module
|
|
@@ -147,4 +147,4 @@ var TypeScriptRenderableSqliteMigration = class extends SqliteMigration {
|
|
|
147
147
|
//#endregion
|
|
148
148
|
export { TypeScriptRenderableSqliteMigration as t };
|
|
149
149
|
|
|
150
|
-
//# sourceMappingURL=planner-produced-sqlite-migration-
|
|
150
|
+
//# sourceMappingURL=planner-produced-sqlite-migration-BMogETJ0-COe4tate.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-produced-sqlite-migration-
|
|
1
|
+
{"version":3,"file":"planner-produced-sqlite-migration-BMogETJ0-COe4tate.mjs","names":["#calls","#meta","#spaceId","#snapshotsImportPath","#destination","#lowerer","#operationsCache"],"sources":["../../../../3-targets/sqlite/1-target/dist/planner-produced-sqlite-migration-BMogETJ0.mjs"],"sourcesContent":["import { t as SqliteMigration } from \"./sqlite-migration-B42dCAqX.mjs\";\nimport { t as renderOps } from \"./render-ops-BUk3wlAR.mjs\";\nimport { contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier } from \"@internal/framework-components/control\";\nimport { renderImports } from \"@internal/ts-render\";\nimport { resolveRequirementSpecifiers } from \"@internal/framework-components/emission\";\nimport { detectScaffoldRuntime, shebangLineFor } from \"@internal/migration-tools/migration-ts\";\n//#region src/core/migrations/render-typescript.ts\n/**\n* Polymorphic TypeScript emitter for the SQLite migration IR. Mirrors the\n* Postgres `render-typescript.ts` — different base-class + factory module\n* specifier, same overall shape.\n*/\n/**\n* Always-present base imports for the rendered scaffold. Both come from\n* `@internal/sqlite/migration` so an authored SQLite\n* `migration.ts` only needs a single dependency for its base class and\n* its CLI entrypoint. Mirrors Postgres's `BASE_IMPORTS`.\n*\n* - `Migration` — the facade re-export fixes the `SqlMigration`\n* generic to `SqlitePlanTargetDetails` and the abstract `targetId` to\n* `'sqlite'`.\n* - `MigrationCLI` — the migration-file CLI entrypoint, re-exported from\n* `@internal/cli/migration-cli`. Loads `prisma.config.ts`,\n* assembles a `ControlStack`, and instantiates the migration class.\n*/\nconst BASE_IMPORTS = [{\n\tmoduleSpecifier: \"@internal/sqlite/migration\",\n\tsymbol: \"Migration\"\n}, {\n\tmoduleSpecifier: \"@internal/sqlite/migration\",\n\tsymbol: \"MigrationCLI\"\n}];\nfunction renderCallsToTypeScript(calls, meta) {\n\tconst imports = buildImports(calls, meta);\n\tconst operationsBody = calls.map((c) => c.renderTypeScript()).join(\",\\n\");\n\tconst hasStart = meta.from !== null;\n\tconst startField = hasStart ? [\" override readonly startContractJson = startContract;\"] : [];\n\treturn [\n\t\tshebangLineFor(detectScaffoldRuntime()),\n\t\timports,\n\t\t\"\",\n\t\t`export default class M extends Migration<${hasStart ? \"Start\" : \"never\"}, End> {`,\n\t\t...startField,\n\t\t\" override readonly endContractJson = endContract;\",\n\t\t\"\",\n\t\t\" override get operations() {\",\n\t\t\" return [\",\n\t\tindent(operationsBody, 6),\n\t\t\" ];\",\n\t\t\" }\",\n\t\t\"}\",\n\t\t\"\",\n\t\t\"MigrationCLI.run(import.meta.url, M);\",\n\t\t\"\"\n\t].join(\"\\n\");\n}\nfunction buildImports(calls, meta) {\n\tconst requirements = [...BASE_IMPORTS, ...contractImports(meta)];\n\tfor (const call of calls) for (const req of call.importRequirements()) requirements.push(req);\n\treturn renderImports(resolveRequirementSpecifiers(requirements, meta.resolveImportSpecifier));\n}\n/**\n* The committed contract-JSON imports the scaffold reads its from/to identity\n* from, resolved to the deduplicated snapshot store under\n* `meta.snapshotsImportPath`. The end snapshot is always present; the start\n* snapshot is added only for a non-baseline migration (`meta.from !== null`).\n* The matching `Contract` type imports (aliased `Start`/`End`) feed the\n* `Migration<Start, End>` generics. Baseline emits `Migration<never, End>` with\n* no start imports — `never` is the honest \"no prior contract\" Start.\n*/\nfunction contractImports(meta) {\n\tconst reqs = [{\n\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"endContract\",\n\t\tkind: \"default\",\n\t\tattributes: { type: \"json\" }\n\t}, {\n\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.to),\n\t\tsymbol: \"Contract\",\n\t\talias: \"End\",\n\t\ttypeOnly: true\n\t}];\n\tif (meta.from !== null) {\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotJsonSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"startContract\",\n\t\t\tkind: \"default\",\n\t\t\tattributes: { type: \"json\" }\n\t\t});\n\t\treqs.push({\n\t\t\tmoduleSpecifier: contractSnapshotTypesSpecifier(meta.snapshotsImportPath, meta.from),\n\t\t\tsymbol: \"Contract\",\n\t\t\talias: \"Start\",\n\t\t\ttypeOnly: true\n\t\t});\n\t}\n\treturn reqs;\n}\nfunction indent(text, spaces) {\n\tconst pad = \" \".repeat(spaces);\n\treturn text.split(\"\\n\").map((line) => line.trim() ? `${pad}${line}` : line).join(\"\\n\");\n}\n//#endregion\n//#region src/core/migrations/planner-produced-sqlite-migration.ts\nvar TypeScriptRenderableSqliteMigration = class extends SqliteMigration {\n\t#calls;\n\t#meta;\n\t#destination;\n\t#spaceId;\n\t#snapshotsImportPath;\n\t#lowerer;\n\t#operationsCache;\n\tconstructor(calls, meta, spaceId, snapshotsImportPath, destination, lowerer) {\n\t\tsuper();\n\t\tthis.#calls = calls;\n\t\tthis.#meta = meta;\n\t\tthis.#spaceId = spaceId;\n\t\tthis.#snapshotsImportPath = snapshotsImportPath;\n\t\tthis.#destination = destination ?? { storageHash: meta.to };\n\t\tthis.#lowerer = lowerer;\n\t}\n\tget operations() {\n\t\tthis.#operationsCache ??= renderOps(this.#calls, this.#lowerer);\n\t\treturn this.#operationsCache;\n\t}\n\tdescribe() {\n\t\treturn this.#meta;\n\t}\n\tget destination() {\n\t\treturn this.#destination;\n\t}\n\t/**\n\t* Contract space this planner-produced plan applies to. Threaded\n\t* from {@link SqlMigrationPlannerPlanOptions.spaceId} so the runner\n\t* keys the marker row by the right space when executing the plan.\n\t*/\n\tget spaceId() {\n\t\treturn this.#spaceId;\n\t}\n\trenderTypeScript(resolveImportSpecifier) {\n\t\treturn renderCallsToTypeScript(this.#calls, {\n\t\t\tfrom: this.#meta.from,\n\t\t\tto: this.#meta.to,\n\t\t\tsnapshotsImportPath: this.#snapshotsImportPath,\n\t\t\tresolveImportSpecifier\n\t\t});\n\t}\n};\n//#endregion\nexport { TypeScriptRenderableSqliteMigration as t };\n\n//# sourceMappingURL=planner-produced-sqlite-migration-BMogETJ0.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,eAAe,CAAC;CACrB,iBAAiB;CACjB,QAAQ;AACT,GAAG;CACF,iBAAiB;CACjB,QAAQ;AACT,CAAC;AACD,SAAS,wBAAwB,OAAO,MAAM;CAC7C,MAAM,UAAU,aAAa,OAAO,IAAI;CACxC,MAAM,iBAAiB,MAAM,KAAK,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,KAAK;CACxE,MAAM,WAAW,KAAK,SAAS;CAC/B,MAAM,aAAa,WAAW,CAAC,wDAAwD,IAAI,CAAC;CAC5F,OAAO;EACN,eAAe,sBAAsB,CAAC;EACtC;EACA;EACA,4CAA4C,WAAW,UAAU,QAAQ;EACzE,GAAG;EACH;EACA;EACA;EACA;EACA,OAAO,gBAAgB,CAAC;EACxB;EACA;EACA;EACA;EACA;EACA;CACD,CAAC,CAAC,KAAK,IAAI;AACZ;AACA,SAAS,aAAa,OAAO,MAAM;CAClC,MAAM,eAAe,CAAC,GAAG,cAAc,GAAG,gBAAgB,IAAI,CAAC;CAC/D,KAAK,MAAM,QAAQ,OAAO,KAAK,MAAM,OAAO,KAAK,mBAAmB,GAAG,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;EACV,OAAO,KAAKL;CACb;CACA,IAAI,cAAc;EACjB,OAAO,KAAKG;CACb;;;;;;CAMA,IAAI,UAAU;EACb,OAAO,KAAKF;CACb;CACA,iBAAiB,wBAAwB;EACxC,OAAO,wBAAwB,KAAKF,QAAQ;GAC3C,MAAM,KAAKC,MAAM;GACjB,IAAI,KAAKA,MAAM;GACf,qBAAqB,KAAKE;GAC1B;EACD,CAAC;CACF;AACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./planner-produced-sqlite-migration-BHH_ftCV-CndNmTrH.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as sqliteError } from "./errors-D9vZNPSI-DoNmdfv7.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { T as isSqliteOpFactoryCall } from "./op-factory-call-Dxsyn5gF-CvHmM-h_.mjs";
|
|
3
3
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
4
4
|
import { isThenable } from "@prisma/orm-framework/utils/promise";
|
|
5
|
-
//#region ../../../3-targets/sqlite/1-target/dist/render-ops-
|
|
5
|
+
//#region ../../../3-targets/sqlite/1-target/dist/render-ops-BUk3wlAR.mjs
|
|
6
6
|
function assertSqliteOp(op, callFactoryName) {
|
|
7
7
|
const targetId = blindCast(op).target?.id;
|
|
8
8
|
if (targetId !== "sqlite") throw sqliteError("MIGRATION.TARGET_MISMATCH", `renderOps: expected sqlite op but got target.id="${String(targetId)}" for op.id="${op.id}" (factoryName="${callFactoryName}"). An OpFactoryCall produced an op for a different target on the sqlite planner path; check the call's target binding.`, { meta: {
|
|
@@ -31,4 +31,4 @@ function renderOps(calls, lowerer) {
|
|
|
31
31
|
//#endregion
|
|
32
32
|
export { renderOps as t };
|
|
33
33
|
|
|
34
|
-
//# sourceMappingURL=render-ops-
|
|
34
|
+
//# sourceMappingURL=render-ops-BUk3wlAR-Awdho1_L.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-ops-
|
|
1
|
+
{"version":3,"file":"render-ops-BUk3wlAR-Awdho1_L.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/render-ops-BUk3wlAR.mjs"],"sourcesContent":["import { c as sqliteError } from \"./errors-D9vZNPSI.mjs\";\nimport { y as isSqliteOpFactoryCall } from \"./op-factory-call-Dxsyn5gF.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { isThenable } from \"@internal/utils/promise\";\n//#region src/core/migrations/render-ops.ts\nfunction assertSqliteOp(op, callFactoryName) {\n\tconst targetId = blindCast(op).target?.id;\n\tif (targetId !== \"sqlite\") throw sqliteError(\"MIGRATION.TARGET_MISMATCH\", `renderOps: expected sqlite op but got target.id=\"${String(targetId)}\" for op.id=\"${op.id}\" (factoryName=\"${callFactoryName}\"). An OpFactoryCall produced an op for a different target on the sqlite planner path; check the call's target binding.`, { meta: {\n\t\topId: op.id,\n\t\ttargetId: String(targetId),\n\t\tfactoryName: callFactoryName\n\t} });\n}\nfunction checkedOp(opOrPromise, callFactoryName) {\n\tif (isThenable(opOrPromise)) {\n\t\tconst checked = opOrPromise.then((op) => {\n\t\t\tassertSqliteOp(op, callFactoryName);\n\t\t\treturn op;\n\t\t});\n\t\tchecked.catch(() => void 0);\n\t\treturn checked;\n\t}\n\tassertSqliteOp(opOrPromise, callFactoryName);\n\treturn opOrPromise;\n}\nfunction renderOps(calls, lowerer) {\n\treturn calls.flatMap((c) => {\n\t\treturn (isSqliteOpFactoryCall(c) ? c.toOps(lowerer) : [blindCast(c).toOp(lowerer)]).map((opOrPromise) => checkedOp(opOrPromise, c.factoryName));\n\t});\n}\n//#endregion\nexport { renderOps as t };\n\n//# sourceMappingURL=render-ops-BUk3wlAR.mjs.map"],"mappings":";;;;;AAKA,SAAS,eAAe,IAAI,iBAAiB;CAC5C,MAAM,WAAW,UAAU,EAAE,CAAC,CAAC,QAAQ;CACvC,IAAI,aAAa,UAAU,MAAM,YAAY,6BAA6B,oDAAoD,OAAO,QAAQ,EAAE,eAAe,GAAG,GAAG,kBAAkB,gBAAgB,0HAA0H,EAAE,MAAM;EACvU,MAAM,GAAG;EACT,UAAU,OAAO,QAAQ;EACzB,aAAa;CACd,EAAE,CAAC;AACJ;AACA,SAAS,UAAU,aAAa,iBAAiB;CAChD,IAAI,WAAW,WAAW,GAAG;EAC5B,MAAM,UAAU,YAAY,MAAM,OAAO;GACxC,eAAe,IAAI,eAAe;GAClC,OAAO;EACR,CAAC;EACD,QAAQ,YAAY,KAAK,CAAC;EAC1B,OAAO;CACR;CACA,eAAe,aAAa,eAAe;CAC3C,OAAO;AACR;AACA,SAAS,UAAU,OAAO,SAAS;CAClC,OAAO,MAAM,SAAS,MAAM;EAC3B,QAAQ,sBAAsB,CAAC,IAAI,EAAE,MAAM,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,EAAA,CAAG,KAAK,gBAAgB,UAAU,aAAa,EAAE,WAAW,CAAC;CAC/I,CAAC;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createSqliteAdapterWithCodecRegistry } from "./adapter-xFPDhkod-
|
|
1
|
+
import { n as createSqliteAdapterWithCodecRegistry } from "./adapter-xFPDhkod-DB6XDGgl.mjs";
|
|
2
2
|
import { SqlRuntimeAdapterDescriptor } from "@prisma/orm-family-sql/runtime";
|
|
3
3
|
import { RuntimeAdapterInstance } from "@prisma/orm-framework/components/execution";
|
|
4
4
|
//#region ../../../3-targets/sqlite/2-adapter/dist/runtime.d.mts
|
|
@@ -7,4 +7,4 @@ type SqliteRuntimeAdapterInstance = RuntimeAdapterInstance<'sql', 'sqlite'> & Re
|
|
|
7
7
|
declare const sqliteRuntimeAdapterDescriptor: SqlRuntimeAdapterDescriptor<'sqlite', SqliteRuntimeAdapterInstance>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { sqliteRuntimeAdapterDescriptor as n, SqliteRuntimeAdapterInstance as t };
|
|
10
|
-
//# sourceMappingURL=runtime-
|
|
10
|
+
//# sourceMappingURL=runtime-H_OgXoaz.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-
|
|
1
|
+
{"version":3,"file":"runtime-H_OgXoaz.d.mts","names":[],"sources":["../../../../3-targets/sqlite/2-adapter/dist/runtime.d.mts"],"mappings":";;;;;KAIK,+BAA+B,0CAA0C,kBAAkB;cAClF,gCAAgC,sCAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./adapter-xFPDhkod-DB6XDGgl.mjs";
|