@prisma/orm-target-sqlite 8.0.0-rc.1-dev.30 → 8.0.0-rc.1-dev.32
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-NeO612zv-B705D3Z8.mjs → adapter-BHzKEzqw-CPUu2tBl.mjs} +3 -3
- package/dist/adapter-BHzKEzqw-CPUu2tBl.mjs.map +1 -0
- package/dist/adapter.mjs +1 -1
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__control.mjs +1 -1
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +1 -1
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/{migration-BX7YeaQT.mjs → migration-BxcJYyhH.mjs} +2 -2
- package/dist/{migration-BX7YeaQT.mjs.map → migration-BxcJYyhH.mjs.map} +1 -1
- package/dist/{op-factory-call-CsNFRTPS-HuMdWaBX.mjs → op-factory-call-DPooV70K-CHz16zs8.mjs} +3 -3
- package/dist/op-factory-call-DPooV70K-CHz16zs8.mjs.map +1 -0
- package/dist/{planner-DuW2pz1t-DFhIqgV2.mjs → planner-9WgrN7Ax-Dh0zET4M.mjs} +18 -5
- package/dist/planner-9WgrN7Ax-Dh0zET4M.mjs.map +1 -0
- package/dist/{planner-produced-sqlite-migration-DB3xleco-C1ncLSxE.mjs → planner-produced-sqlite-migration-BGQ61EyB-DVKS_IQb.mjs} +3 -3
- package/dist/{planner-produced-sqlite-migration-DB3xleco-C1ncLSxE.mjs.map → planner-produced-sqlite-migration-BGQ61EyB-DVKS_IQb.mjs.map} +1 -1
- package/dist/{sqlite-migration-MGxXxUB4-zfSNsC-a.mjs → sqlite-migration-BNwiY-Um-7EhDn7Ni.mjs} +3 -3
- package/dist/{sqlite-migration-MGxXxUB4-zfSNsC-a.mjs.map → sqlite-migration-BNwiY-Um-7EhDn7Ni.mjs.map} +1 -1
- package/dist/target.mjs +5 -5
- package/dist/target__control.mjs +1 -1
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__planner-produced-sqlite-migration.mjs +1 -1
- package/dist/target__planner.mjs +1 -1
- package/package.json +9 -9
- package/dist/adapter-NeO612zv-B705D3Z8.mjs.map +0 -1
- package/dist/op-factory-call-CsNFRTPS-HuMdWaBX.mjs.map +0 -1
- package/dist/planner-DuW2pz1t-DFhIqgV2.mjs.map +0 -1
|
@@ -16,7 +16,7 @@ import { InternalError, assertNever } from "@prisma/orm-framework/utils/internal
|
|
|
16
16
|
import { parseMarkerRowSafely, withMarkerReadErrorHandling } from "@prisma/orm-framework/errors/execution";
|
|
17
17
|
import { parseContractMarkerRow } from "@prisma/orm-family-sql/family/verify";
|
|
18
18
|
import { createAstCodecRegistry, deriveParamMetadata, encodeParamsWithMetadata } from "@prisma/orm-family-sql/runtime";
|
|
19
|
-
//#region ../../../3-targets/6-adapters/sqlite/dist/adapter-
|
|
19
|
+
//#region ../../../3-targets/6-adapters/sqlite/dist/adapter-BHzKEzqw.mjs
|
|
20
20
|
function descriptorsFrom(contributors) {
|
|
21
21
|
return contributors.flatMap((contributor) => contributor.types?.codecTypes?.codecDescriptors ?? []);
|
|
22
22
|
}
|
|
@@ -531,7 +531,7 @@ function sqliteRenderDdlConstraint(constraint) {
|
|
|
531
531
|
if (constraint.name !== void 0) sql = `CONSTRAINT ${quoteIdentifier(constraint.name)} ${sql}`;
|
|
532
532
|
return sql;
|
|
533
533
|
}
|
|
534
|
-
if (constraint.kind === "check-expression") throw structuredError("CONTRACT.CONSTRAINT_INVALID", `SQLite does not support
|
|
534
|
+
if (constraint.kind === "check-expression") throw structuredError("CONTRACT.CONSTRAINT_INVALID", `The SQLite target does not support CHECK constraints (constraint "${constraint.name}"). The "checkConstraint" capability is Postgres-only — remove the "@@check" / "check()" declaration, or target Postgres.`, { meta: { constraintName: constraint.name } });
|
|
535
535
|
const cols = constraint.columns.map(quoteIdentifier).join(", ");
|
|
536
536
|
if (constraint.name !== void 0) return `CONSTRAINT ${quoteIdentifier(constraint.name)} UNIQUE (${cols})`;
|
|
537
537
|
return `UNIQUE (${cols})`;
|
|
@@ -1002,4 +1002,4 @@ function createSqliteAdapterWithCodecRegistry(codecRegistry) {
|
|
|
1002
1002
|
//#endregion
|
|
1003
1003
|
export { createSqliteBuiltinCodecLookup as a, sqliteRawCodecInferer as c, createSqliteAdapterWithCodecRegistry as i, assembleSqliteCodecRegistry as n, createSqliteCodecRegistryWithBuiltins as o, createSqliteAdapter as r, renderLoweredSql as s, SqliteControlAdapter as t };
|
|
1004
1004
|
|
|
1005
|
-
//# sourceMappingURL=adapter-
|
|
1005
|
+
//# sourceMappingURL=adapter-BHzKEzqw-CPUu2tBl.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter-BHzKEzqw-CPUu2tBl.mjs","names":["#codecs"],"sources":["../../../../3-targets/6-adapters/sqlite/dist/adapter-BHzKEzqw.mjs"],"sourcesContent":["import { APP_SPACE_ID, extractCodecLookup } from \"@internal/framework-components/control\";\nimport { RawExpr, isDdlNode } from \"@internal/sql-relational-core/ast\";\nimport { jsonDocumentRetag, sqliteCodecDescriptorRegistry, sqliteCodecRegistry } from \"@internal/target-sqlite/codecs\";\nimport { escapeLiteral, quoteIdentifier } from \"@internal/target-sqlite/sql-utils\";\nimport { InternalError, assertNever } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { buildSqliteCodecDescriptorRegistry } from \"@internal/target-sqlite/codec-descriptor\";\nimport { parseMarkerRowSafely, withMarkerReadErrorHandling } from \"@internal/errors/execution\";\nimport { parseContractMarkerRow } from \"@internal/family-sql/verify\";\nimport { REFERENTIAL_ACTION_SQL } from \"@internal/sql-contract/referential-action-sql\";\nimport { RelationalSchemaNodeKind, SqlSchemaIR, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries, datetime, integer, jsonText, sqliteTable, text } from \"@internal/target-sqlite/contract-free\";\nimport { parseSqliteDefault } from \"@internal/target-sqlite/default-normalizer\";\nimport { normalizeSqliteNativeType } from \"@internal/target-sqlite/native-type-normalizer\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { createAstCodecRegistry, deriveParamMetadata, encodeParamsWithMetadata } from \"@internal/sql-runtime\";\nimport { SQLITE_DATETIME_CODEC_ID } from \"@internal/target-sqlite/codec-ids\";\n//#region src/core/codec-lookup.ts\nfunction descriptorsFrom(contributors) {\n\treturn contributors.flatMap((contributor) => contributor.types?.codecTypes?.codecDescriptors ?? []);\n}\nfunction buildSqliteCodecRegistry(descriptors) {\n\tconst descriptorRegistry = buildSqliteCodecDescriptorRegistry(descriptors);\n\tconst registry = {\n\t\t...extractCodecLookup([{\n\t\t\tid: \"sqlite-codecs\",\n\t\t\ttypes: { codecTypes: { codecDescriptors: Array.from(descriptorRegistry.values()) } }\n\t\t}]),\n\t\tdescriptorFor: (codecId) => descriptorRegistry.descriptorFor(codecId),\n\t\tvalues: () => descriptorRegistry.values()\n\t};\n\treturn Object.freeze(registry);\n}\nfunction assembleSqliteCodecRegistry(target, extensions) {\n\treturn buildSqliteCodecRegistry([\n\t\t...descriptorsFrom([target]),\n\t\t...sqliteCodecDescriptorRegistry.values(),\n\t\t...descriptorsFrom(extensions)\n\t]);\n}\nfunction createSqliteCodecRegistryWithBuiltins(codecDescriptors = []) {\n\treturn buildSqliteCodecRegistry([...sqliteCodecDescriptorRegistry.values(), ...codecDescriptors]);\n}\n/**\n* Build a coherent SQLite codec registry populated with built-in descriptors only.\n*\n* The returned registry supports both ordinary codec materialization and SQLite target behavior. Stack-composed paths build the same combined registry from target, full adapter, and ordered extension contributions.\n*/\nfunction createSqliteBuiltinCodecLookup() {\n\treturn createSqliteCodecRegistryWithBuiltins();\n}\n//#endregion\n//#region ../../../1-framework/3-tooling/migration/dist/exports/ledger-origin.mjs\nfunction ledgerOriginFromStored(originCoreHash) {\n\tif (originCoreHash === null || originCoreHash === \"\" || originCoreHash === \"empty\") return null;\n\treturn originCoreHash;\n}\n//#endregion\n//#region src/core/control-codecs.ts\nconst CONTROL_CODECS = createAstCodecRegistry(sqliteCodecRegistry);\nasync function encodeControlQueryParams(lowered, ast, codecs = CONTROL_CODECS) {\n\treturn encodeParamsWithMetadata(lowered.params.map((slot) => {\n\t\tif (slot.kind === \"literal\") return slot.value;\n\t\tthrow new InternalError(`control query lowered to a bind slot '${slot.name}', which is unsupported`);\n\t}), deriveParamMetadata(ast), {}, codecs);\n}\n//#endregion\n//#region src/core/ledger-decode.ts\nconst DESIGNATOR_LESS_UTC_DATETIME = /^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$/;\nfunction coerceLedgerAppliedAt(value) {\n\tif (value instanceof Date) return value;\n\tif (DESIGNATOR_LESS_UTC_DATETIME.test(value)) return /* @__PURE__ */ new Date(`${value.replace(\" \", \"T\")}Z`);\n\treturn new Date(value);\n}\nfunction operationCountFromStored(operations) {\n\tif (Array.isArray(operations)) return operations.length;\n\tif (typeof operations === \"string\") try {\n\t\tconst parsed = JSON.parse(operations);\n\t\treturn Array.isArray(parsed) ? parsed.length : 0;\n\t} catch {\n\t\treturn 0;\n\t}\n\treturn 0;\n}\n//#endregion\n//#region src/core/marker-ledger.ts\nconst marker = sqliteTable(\"_prisma_marker\", {\n\tspace: text(),\n\tcore_hash: text(),\n\tprofile_hash: text(),\n\tcontract_json: jsonText({ nullable: true }),\n\tcanonical_version: integer({ nullable: true }),\n\tupdated_at: datetime(),\n\tapp_tag: text({ nullable: true }),\n\tmeta: jsonText({ nullable: true }),\n\tinvariants: jsonText()\n});\n/**\n* Writeable subset of `_prisma_ledger`. Omits the DB-generated `id`\n* (`INTEGER PRIMARY KEY AUTOINCREMENT`) and `created_at` (default\n* `strftime(...)`).\n*/\nconst ledger = sqliteTable(\"_prisma_ledger\", {\n\tspace: text(),\n\tmigration_name: text(),\n\tmigration_hash: text(),\n\torigin_core_hash: text({ nullable: true }),\n\tdestination_core_hash: text(),\n\toperations: jsonText()\n});\n/**\n* Read-side handle covering every column of `_prisma_ledger`, including\n* the DB-generated `id` (for ORDER BY) and `created_at`.\n*/\nconst ledgerReadShape = sqliteTable(\"_prisma_ledger\", {\n\tid: integer(),\n\tspace: text(),\n\tmigration_name: text(),\n\tmigration_hash: text(),\n\torigin_core_hash: text({ nullable: true }),\n\tdestination_core_hash: text(),\n\toperations: jsonText(),\n\tcreated_at: text()\n});\nconst sqliteCatalog = sqliteTable(\"sqlite_master\", {\n\ttype: text(),\n\tname: text()\n});\nconst NOW = new RawExpr({\n\tparts: [\"datetime('now')\"],\n\treturns: {\n\t\tcodecId: SQLITE_DATETIME_CODEC_ID,\n\t\tnullable: false\n\t}\n});\nfunction mergeInvariants(current, incoming) {\n\treturn [.../* @__PURE__ */ new Set([...current, ...incoming])].sort();\n}\nasync function execute(lower, driver, query) {\n\tconst lowered = lower(query);\n\tconst encoded = await encodeControlQueryParams(lowered, query);\n\treturn (await driver.query(lowered.sql, encoded)).rows;\n}\nfunction decodeSqliteMarkerRow(row) {\n\tif (typeof row !== \"object\" || row === null || !(\"invariants\" in row)) return row;\n\tconst record = row;\n\tif (typeof record.invariants !== \"string\") return row;\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(record.invariants);\n\t} catch (err) {\n\t\tconst detail = err instanceof Error ? err.message : String(err);\n\t\tthrow structuredError(\"CONTRACT.MARKER_ROW_CORRUPT\", `Invalid contract marker row: invariants is not valid JSON: ${detail}`, {\n\t\t\tmeta: { detail },\n\t\t\tcause: err\n\t\t});\n\t}\n\treturn {\n\t\t...record,\n\t\tinvariants: parsed\n\t};\n}\n//#endregion\n//#region src/core/control-adapter.ts\nconst SQLITE_MARKER_TABLE = \"_prisma_marker\";\nconst SQLITE_LEDGER_TABLE = \"_prisma_ledger\";\nvar SqliteControlAdapter = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"sqlite\";\n\tcodecRegistry;\n\tconstructor(codecRegistry) {\n\t\tthis.codecRegistry = codecRegistry;\n\t}\n\tnormalizeDefault = parseSqliteDefault;\n\tnormalizeNativeType = normalizeSqliteNativeType;\n\tbootstrapControlTableQueries() {\n\t\treturn buildControlTableBootstrapQueries();\n\t}\n\tbootstrapSignMarkerQueries() {\n\t\treturn buildSignMarkerBootstrapQueries();\n\t}\n\t/**\n\t* Lower a SQL query AST into a SQLite-flavored `{ sql, params }` payload.\n\t*\n\t* Delegates to the shared `renderLoweredSql` renderer so the control adapter\n\t* emits byte-identical SQL to `SqliteAdapterImpl.lower()` for the same AST\n\t* and contract. Used at migration plan/emit time (e.g. by `dataTransform`)\n\t* without instantiating the runtime adapter.\n\t*/\n\tlower(ast, context) {\n\t\tif (isDdlNode(ast)) throw structuredError(\"RUNTIME.DDL_UNSUPPORTED\", \"lower() cannot lower DDL: DDL default literals require inline codec encoding, which is async. Use lowerToExecuteRequest().\", { meta: { surface: \"control-adapter\" } });\n\t\treturn renderLoweredSql(ast, blindCast(context.contract), this.codecRegistry);\n\t}\n\t/**\n\t* Lower an AST all the way to a driver-ready statement. For DDL nodes,\n\t* literal column defaults are formatted as inline SQL with SQLite-specific\n\t* literal syntax (no cast suffix, boolean as 0/1, blob via X'hex'). For\n\t* query ASTs, params are kept as `?` placeholders; wire values go in\n\t* `params`. Does NOT call `this.lower()` — independent implementation.\n\t*/\n\tasync lowerToExecuteRequest(ast, context) {\n\t\tif (isDdlNode(ast)) return sqliteRenderDdlExecuteRequest(blindCast(ast), this.codecRegistry);\n\t\tconst lowered = renderLoweredSql(ast, blindCast(context?.contract), this.codecRegistry);\n\t\tconst params = await encodeControlQueryParams(lowered, ast, blindCast(this.codecRegistry));\n\t\treturn {\n\t\t\tsql: lowered.sql,\n\t\t\tparams\n\t\t};\n\t}\n\t/**\n\t* Reads the contract marker from `_prisma_marker`. Probes `sqlite_master`\n\t* first so a fresh database (no marker table) returns `null` instead of a\n\t* \"no such table\" error.\n\t*/\n\tasync readMarker(driver, space) {\n\t\tconst result = await this.readMarkerDiscriminated(driver, space);\n\t\treturn result.kind === \"present\" ? result.record : null;\n\t}\n\tasync readMarkerDiscriminated(driver, space) {\n\t\treturn withMarkerReadErrorHandling(() => this.readMarkerResult(driver, space), {\n\t\t\tspace,\n\t\t\tmarkerLocation: SQLITE_MARKER_TABLE\n\t\t});\n\t}\n\t/**\n\t* Reads every row from `_prisma_marker` and returns them keyed by\n\t* `space`. Mirrors the existence probe in {@link readMarker}: a\n\t* fresh database without the marker table returns an empty map.\n\t*/\n\tasync readAllMarkers(driver) {\n\t\treturn withMarkerReadErrorHandling(() => this.readAllMarkersResult(driver), {\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tmarkerLocation: SQLITE_MARKER_TABLE\n\t\t});\n\t}\n\tasync readAllMarkersResult(driver) {\n\t\tconst lower = (query) => this.lower(query, { contract: void 0 });\n\t\tif ((await execute(lower, driver, sqliteCatalog.select(sqliteCatalog.name).where(sqliteCatalog.type.eq(\"table\").and(sqliteCatalog.name.eq(\"_prisma_marker\"))).build())).length === 0) return /* @__PURE__ */ new Map();\n\t\tconst rows = blindCast(await execute(lower, driver, marker.select(marker.space, marker.core_hash, marker.profile_hash, marker.contract_json, marker.canonical_version, marker.updated_at, marker.app_tag, marker.meta, marker.invariants).build()));\n\t\tconst out = /* @__PURE__ */ new Map();\n\t\tfor (const row of rows) out.set(row.space, parseMarkerRowSafely(row, (raw) => parseContractMarkerRow(decodeSqliteMarkerRow(raw)), {\n\t\t\tspace: row.space,\n\t\t\tmarkerLocation: SQLITE_MARKER_TABLE\n\t\t}));\n\t\treturn out;\n\t}\n\t/**\n\t* Reads per-migration ledger rows from `_prisma_ledger` in apply order.\n\t* Probes `sqlite_master` first so a fresh database without the ledger\n\t* table returns `[]` instead of raising \"no such table\".\n\t*/\n\tasync readLedger(driver, space) {\n\t\treturn withMarkerReadErrorHandling(() => this.readLedgerResult(driver, space), {\n\t\t\tspace: space ?? \"*\",\n\t\t\tmarkerLocation: SQLITE_LEDGER_TABLE\n\t\t});\n\t}\n\tasync readLedgerResult(driver, space) {\n\t\tconst lower = (query) => this.lower(query, { contract: void 0 });\n\t\tif ((await execute(lower, driver, sqliteCatalog.select(sqliteCatalog.name).where(sqliteCatalog.type.eq(\"table\").and(sqliteCatalog.name.eq(\"_prisma_ledger\"))).build())).length === 0) return [];\n\t\tconst base = ledgerReadShape.select(ledgerReadShape.space, ledgerReadShape.migration_name, ledgerReadShape.migration_hash, ledgerReadShape.origin_core_hash, ledgerReadShape.destination_core_hash, ledgerReadShape.operations, ledgerReadShape.created_at);\n\t\treturn blindCast(await execute(lower, driver, (space !== void 0 ? base.where(ledgerReadShape.space.eq(space)) : base).orderBy(ledgerReadShape.id).build())).map((row) => ({\n\t\t\tspace: row.space,\n\t\t\tmigrationName: row.migration_name,\n\t\t\tmigrationHash: row.migration_hash,\n\t\t\tfrom: ledgerOriginFromStored(row.origin_core_hash),\n\t\t\tto: row.destination_core_hash,\n\t\t\tappliedAt: coerceLedgerAppliedAt(row.created_at),\n\t\t\toperationCount: operationCountFromStored(row.operations)\n\t\t}));\n\t}\n\t/**\n\t* Stamps the initial marker row for `space` via the shared contract-free DML\n\t* builder, lowered through {@link lower} and executed on the driver. See the\n\t* `SqlControlAdapter.initMarker` contract.\n\t*/\n\tasync insertMarker(driver, space, destination) {\n\t\tawait execute((query) => this.lower(query, { contract: void 0 }), driver, marker.insert({\n\t\t\tspace,\n\t\t\tcore_hash: destination.storageHash,\n\t\t\tprofile_hash: destination.profileHash,\n\t\t\tcontract_json: null,\n\t\t\tcanonical_version: null,\n\t\t\tupdated_at: NOW,\n\t\t\tapp_tag: null,\n\t\t\tmeta: {},\n\t\t\tinvariants: destination.invariants ?? []\n\t\t}).build());\n\t}\n\tasync initMarker(driver, space, destination) {\n\t\tawait execute((query) => this.lower(query, { contract: void 0 }), driver, marker.upsert({\n\t\t\tspace,\n\t\t\tcore_hash: destination.storageHash,\n\t\t\tprofile_hash: destination.profileHash,\n\t\t\tcontract_json: null,\n\t\t\tcanonical_version: null,\n\t\t\tupdated_at: NOW,\n\t\t\tapp_tag: null,\n\t\t\tmeta: {},\n\t\t\tinvariants: destination.invariants ?? []\n\t\t}).onConflict(marker.space).doUpdate((excluded) => ({\n\t\t\tcore_hash: excluded.core_hash,\n\t\t\tprofile_hash: excluded.profile_hash,\n\t\t\tcontract_json: excluded.contract_json,\n\t\t\tcanonical_version: excluded.canonical_version,\n\t\t\tupdated_at: NOW,\n\t\t\tapp_tag: excluded.app_tag,\n\t\t\tmeta: excluded.meta,\n\t\t\tinvariants: excluded.invariants\n\t\t})).build());\n\t}\n\t/**\n\t* Compare-and-swap advance of the marker row for `space`. See the\n\t* `SqlControlAdapter.updateMarker` contract.\n\t*/\n\tasync updateMarker(driver, space, expectedFrom, destination) {\n\t\tconst currentInvariants = destination.invariants === void 0 ? [] : (await this.readMarker(driver, space))?.invariants ?? [];\n\t\tconst mergedInvariants = destination.invariants === void 0 ? void 0 : mergeInvariants(currentInvariants, destination.invariants);\n\t\treturn (await execute((q) => this.lower(q, { contract: void 0 }), driver, marker.update().set({\n\t\t\tcore_hash: destination.storageHash,\n\t\t\tprofile_hash: destination.profileHash,\n\t\t\tupdated_at: NOW,\n\t\t\t...mergedInvariants !== void 0 ? { invariants: mergedInvariants } : {}\n\t\t}).where(marker.space.eq(space).and(marker.core_hash.eq(expectedFrom))).returning(marker.space).build())).length > 0;\n\t}\n\t/**\n\t* Appends a ledger entry for `space`. See the\n\t* `SqlControlAdapter.writeLedgerEntry` contract.\n\t*/\n\tasync writeLedgerEntry(driver, space, entry) {\n\t\tawait execute((query) => this.lower(query, { contract: void 0 }), driver, ledger.insert({\n\t\t\tspace,\n\t\t\tmigration_name: entry.migrationName,\n\t\t\tmigration_hash: entry.migrationHash,\n\t\t\torigin_core_hash: entry.from,\n\t\t\tdestination_core_hash: entry.to,\n\t\t\toperations: entry.operations\n\t\t}).build());\n\t}\n\tasync readMarkerResult(driver, space) {\n\t\tconst lower = (query) => this.lower(query, { contract: void 0 });\n\t\tif ((await execute(lower, driver, sqliteCatalog.select(sqliteCatalog.name).where(sqliteCatalog.type.eq(\"table\").and(sqliteCatalog.name.eq(\"_prisma_marker\"))).build())).length === 0) return { kind: \"no-table\" };\n\t\tconst row = (await execute(lower, driver, marker.select(marker.core_hash, marker.profile_hash, marker.contract_json, marker.canonical_version, marker.updated_at, marker.app_tag, marker.meta, marker.invariants).where(marker.space.eq(space)).build()))[0];\n\t\tif (!row) return { kind: \"absent\" };\n\t\treturn {\n\t\t\tkind: \"present\",\n\t\t\trecord: parseContractMarkerRow(decodeSqliteMarkerRow(row))\n\t\t};\n\t}\n\tasync introspect(driver, _contract) {\n\t\tconst tablesResult = await driver.query(`SELECT name FROM sqlite_master\n WHERE type = 'table'\n AND name NOT LIKE 'sqlite_%'\n AND name NOT IN ('_prisma_marker', '_prisma_ledger')\n ORDER BY name`);\n\t\tconst tables = {};\n\t\tfor (const tableRow of tablesResult.rows) {\n\t\t\tconst tableName = tableRow.name;\n\t\t\tconst columnsResult = await driver.query(`PRAGMA table_info(\"${escapePragmaArg(tableName)}\")`);\n\t\t\tconst fkResult = await driver.query(`PRAGMA foreign_key_list(\"${escapePragmaArg(tableName)}\")`);\n\t\t\tconst indexListResult = await driver.query(`PRAGMA index_list(\"${escapePragmaArg(tableName)}\")`);\n\t\t\tconst columns = {};\n\t\t\tconst pkColumns = [];\n\t\t\tfor (const col of columnsResult.rows) {\n\t\t\t\tconst resolvedNativeType = normalizeSqliteNativeType(col.type);\n\t\t\t\tconst rawDefault = col.dflt_value ?? void 0;\n\t\t\t\tcolumns[col.name] = {\n\t\t\t\t\tname: col.name,\n\t\t\t\t\tnativeType: col.type.toLowerCase(),\n\t\t\t\t\tnullable: col.notnull === 0 && col.pk === 0,\n\t\t\t\t\t...ifDefined(\"default\", rawDefault),\n\t\t\t\t\tresolvedNativeType,\n\t\t\t\t\t...ifDefined(\"resolvedDefault\", rawDefault !== void 0 ? parseSqliteDefault(rawDefault, resolvedNativeType) : void 0)\n\t\t\t\t};\n\t\t\t\tif (col.pk > 0) pkColumns.push({\n\t\t\t\t\tname: col.name,\n\t\t\t\t\tpk: col.pk\n\t\t\t\t});\n\t\t\t}\n\t\t\tpkColumns.sort((a, b) => a.pk - b.pk);\n\t\t\tconst primaryKey = pkColumns.length > 0 ? {\n\t\t\t\tcolumns: pkColumns.map((c) => c.name),\n\t\t\t\tdependsOn: flatColumnDependsOn(tableName, pkColumns.map((c) => c.name))\n\t\t\t} : void 0;\n\t\t\tconst fkMap = /* @__PURE__ */ new Map();\n\t\t\tfor (const fk of fkResult.rows) {\n\t\t\t\tconst existing = fkMap.get(fk.id);\n\t\t\t\tif (existing) {\n\t\t\t\t\texisting.columns.push(fk.from);\n\t\t\t\t\texisting.referencedColumns.push(fk.to);\n\t\t\t\t} else fkMap.set(fk.id, {\n\t\t\t\t\tcolumns: [fk.from],\n\t\t\t\t\treferencedTable: fk.table,\n\t\t\t\t\treferencedColumns: [fk.to],\n\t\t\t\t\tonDelete: fk.on_delete,\n\t\t\t\t\tonUpdate: fk.on_update\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst foreignKeys = Array.from(fkMap.values()).map((fk) => ({\n\t\t\t\tcolumns: Object.freeze([...fk.columns]),\n\t\t\t\treferencedTable: fk.referencedTable,\n\t\t\t\treferencedColumns: Object.freeze([...fk.referencedColumns]),\n\t\t\t\t...ifDefined(\"onDelete\", mapSqliteReferentialAction(fk.onDelete)),\n\t\t\t\t...ifDefined(\"onUpdate\", mapSqliteReferentialAction(fk.onUpdate)),\n\t\t\t\tdependsOn: [flatTableDependsOn(fk.referencedTable), ...flatColumnDependsOn(tableName, fk.columns)]\n\t\t\t}));\n\t\t\tconst uniques = [];\n\t\t\tconst indexes = [];\n\t\t\tfor (const idx of indexListResult.rows) {\n\t\t\t\tconst idxColumns = (await driver.query(`PRAGMA index_info(\"${escapePragmaArg(idx.name)}\")`)).rows.sort((a, b) => a.seqno - b.seqno).map((r) => r.name);\n\t\t\t\tif (idx.origin === \"u\") uniques.push({\n\t\t\t\t\tcolumns: Object.freeze([...idxColumns]),\n\t\t\t\t\tname: idx.name,\n\t\t\t\t\tdependsOn: flatColumnDependsOn(tableName, idxColumns)\n\t\t\t\t});\n\t\t\t\telse if (idx.origin === \"c\") indexes.push({\n\t\t\t\t\tnaming: {\n\t\t\t\t\t\tkind: \"exact\",\n\t\t\t\t\t\tname: idx.name\n\t\t\t\t\t},\n\t\t\t\t\tcolumns: Object.freeze([...idxColumns]),\n\t\t\t\t\twhere: void 0,\n\t\t\t\t\tunique: idx.unique === 1,\n\t\t\t\t\tpartial: idx.partial === 1,\n\t\t\t\t\ttype: void 0,\n\t\t\t\t\toptions: void 0,\n\t\t\t\t\tannotations: void 0,\n\t\t\t\t\tdependsOn: flatColumnDependsOn(tableName, idxColumns)\n\t\t\t\t});\n\t\t\t}\n\t\t\ttables[tableName] = new SqlTableIR({\n\t\t\t\tname: tableName,\n\t\t\t\tcolumns,\n\t\t\t\t...ifDefined(\"primaryKey\", primaryKey),\n\t\t\t\tforeignKeys,\n\t\t\t\tuniques,\n\t\t\t\tindexes\n\t\t\t});\n\t\t}\n\t\treturn new SqlSchemaIR({ tables });\n\t}\n};\nfunction escapePragmaArg(name) {\n\treturn name.replace(/\"/g, \"\\\"\\\"\");\n}\nconst SQLITE_REFERENTIAL_ACTION_MAP = {\n\t\"NO ACTION\": \"noAction\",\n\tRESTRICT: \"restrict\",\n\tCASCADE: \"cascade\",\n\t\"SET NULL\": \"setNull\",\n\t\"SET DEFAULT\": \"setDefault\"\n};\nfunction mapSqliteReferentialAction(rule) {\n\tconst normalized = rule.toUpperCase();\n\tconst mapped = SQLITE_REFERENTIAL_ACTION_MAP[normalized];\n\tif (mapped === void 0) throw structuredError(\"CONTRACT.INTROSPECTION_UNSUPPORTED\", `Unknown SQLite referential action rule: \"${rule}\". Expected one of: NO ACTION, RESTRICT, CASCADE, SET NULL, SET DEFAULT.`, { meta: { rule } });\n\tif (mapped === \"noAction\") return void 0;\n\treturn mapped;\n}\n/**\n* The referenced table's chain in the flat (single-schema) tree this\n* introspection builds: the root (`SqlSchemaIR`, fixed `'database'` id)\n* followed by the table's own id. Mirrors the expected-side derivation\n* (`contractToSchemaIR`'s `convertForeignKey`).\n*/\nfunction flatTableDependsOn(tableName) {\n\treturn [{\n\t\tnodeKind: RelationalSchemaNodeKind.schema,\n\t\tid: \"database\"\n\t}, {\n\t\tnodeKind: RelationalSchemaNodeKind.table,\n\t\tid: tableName\n\t}];\n}\n/**\n* The chains from a table-child object (foreign key, index, unique, primary\n* key) to each of the own columns it is built on — the introspection-side\n* mirror of `contractToSchemaIR`'s `flatColumnDependsOn`. An object is dropped\n* before the columns it covers.\n*/\nfunction flatColumnDependsOn(tableName, columns) {\n\treturn columns.map((column) => [...flatTableDependsOn(tableName), {\n\t\tnodeKind: RelationalSchemaNodeKind.column,\n\t\tid: `column:${column}`\n\t}]);\n}\nfunction sqliteInlineLiteral(wire) {\n\tif (wire === null) return \"NULL\";\n\tif (typeof wire === \"boolean\") return wire ? \"1\" : \"0\";\n\tif (typeof wire === \"number\") {\n\t\tif (!Number.isFinite(wire)) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", `sqliteRenderDdlExecuteRequest: non-finite number wire value ${String(wire)} cannot be emitted as a DEFAULT literal`);\n\t\treturn String(wire);\n\t}\n\tif (typeof wire === \"bigint\") return String(wire);\n\tif (wire instanceof Date) {\n\t\tif (Number.isNaN(wire.getTime())) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", \"sqliteRenderDdlExecuteRequest: invalid Date value cannot be emitted as a DEFAULT literal\");\n\t\treturn `'${escapeLiteral(wire.toISOString())}'`;\n\t}\n\tif (typeof wire === \"string\") return `'${escapeLiteral(wire)}'`;\n\tif (wire instanceof Uint8Array) return `X'${Array.from(wire).map((b) => b.toString(16).padStart(2, \"0\")).join(\"\")}'`;\n\tif (typeof wire === \"object\") return `'${escapeLiteral(JSON.stringify(wire))}'`;\n\tthrow structuredError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `sqliteRenderDdlExecuteRequest: unexpected wire type \"${typeof wire}\"`, { meta: { wireType: typeof wire } });\n}\nasync function sqliteRenderDdlColumnDefault(def, codecLookup, codecRef) {\n\tif (def.kind === \"function\") {\n\t\tif (def.expression === \"autoincrement()\") return \"\";\n\t\tif (def.expression === \"now()\") return \"DEFAULT (datetime('now'))\";\n\t\treturn `DEFAULT (${def.expression})`;\n\t}\n\tif (codecRef !== void 0) {\n\t\tconst codec = codecLookup.get(codecRef.codecId);\n\t\tif (codec !== void 0) {\n\t\t\tconst value = def.value instanceof Date ? def.value : codec.decodeJson(def.value);\n\t\t\treturn `DEFAULT ${sqliteInlineLiteral(await codec.encode(value, {}))}`;\n\t\t}\n\t}\n\treturn `DEFAULT ${sqliteInlineLiteral(def.value)}`;\n}\nasync function sqliteRenderDdlColumn(column, codecLookup) {\n\tif (column.type.includes(\"AUTOINCREMENT\")) return `${quoteIdentifier(column.name)} ${column.type}`;\n\tconst parts = [quoteIdentifier(column.name), column.type];\n\tif (column.notNull) parts.push(\"NOT NULL\");\n\tif (column.primaryKey) parts.push(\"PRIMARY KEY\");\n\tif (column.default) {\n\t\tconst clause = await sqliteRenderDdlColumnDefault(column.default, codecLookup, column.codecRef);\n\t\tif (clause.length > 0) parts.push(clause);\n\t}\n\treturn parts.join(\" \");\n}\nfunction sqliteRenderDdlConstraint(constraint) {\n\tif (constraint.kind === \"primary-key\") {\n\t\tconst cols = constraint.columns.map(quoteIdentifier).join(\", \");\n\t\tif (constraint.name !== void 0) return `CONSTRAINT ${quoteIdentifier(constraint.name)} PRIMARY KEY (${cols})`;\n\t\treturn `PRIMARY KEY (${cols})`;\n\t}\n\tif (constraint.kind === \"foreign-key\") {\n\t\tlet sql = `FOREIGN KEY (${constraint.columns.map(quoteIdentifier).join(\", \")}) REFERENCES ${constraint.refTable.split(\".\").map(quoteIdentifier).join(\".\")} (${constraint.refColumns.map(quoteIdentifier).join(\", \")})`;\n\t\tif (constraint.onDelete !== void 0) sql += ` ON DELETE ${REFERENTIAL_ACTION_SQL[constraint.onDelete]}`;\n\t\tif (constraint.onUpdate !== void 0) sql += ` ON UPDATE ${REFERENTIAL_ACTION_SQL[constraint.onUpdate]}`;\n\t\tif (constraint.name !== void 0) sql = `CONSTRAINT ${quoteIdentifier(constraint.name)} ${sql}`;\n\t\treturn sql;\n\t}\n\tif (constraint.kind === \"check-expression\") throw structuredError(\"CONTRACT.CONSTRAINT_INVALID\", `The SQLite target does not support CHECK constraints (constraint \"${constraint.name}\"). The \"checkConstraint\" capability is Postgres-only — remove the \"@@check\" / \"check()\" declaration, or target Postgres.`, { meta: { constraintName: constraint.name } });\n\tconst cols = constraint.columns.map(quoteIdentifier).join(\", \");\n\tif (constraint.name !== void 0) return `CONSTRAINT ${quoteIdentifier(constraint.name)} UNIQUE (${cols})`;\n\treturn `UNIQUE (${cols})`;\n}\nasync function sqliteRenderDdlExecuteRequest(ast, codecLookup) {\n\tconst node = blindCast(ast);\n\tconst ifNotExists = node.ifNotExists ? \"IF NOT EXISTS \" : \"\";\n\tconst tableRef = quoteIdentifier(node.table);\n\tconst columnDefs = await Promise.all(node.columns.map((col) => sqliteRenderDdlColumn(col, codecLookup)));\n\tconst constraintDefs = node.constraints !== void 0 ? node.constraints.map(sqliteRenderDdlConstraint) : [];\n\treturn {\n\t\tsql: `CREATE TABLE ${ifNotExists}${tableRef} (\\n ${[...columnDefs, ...constraintDefs].join(\",\\n \")}\\n)`,\n\t\tparams: []\n\t};\n}\n//#endregion\n//#region src/core/adapter.ts\nfunction nodeKind(value) {\n\tif (typeof value === \"object\" && value !== null && \"kind\" in value && typeof value.kind === \"string\") return value.kind;\n\treturn \"unknown\";\n}\nfunction unreachableKind(value) {\n\treturn nodeKind(value);\n}\nconst defaultCapabilities = Object.freeze({ sql: {\n\torderBy: true,\n\tlimit: true,\n\tlateral: false,\n\tjsonAgg: true,\n\treturning: true,\n\tenums: false\n} });\nvar SqliteAdapterImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"sqlite\";\n\tprofile;\n\t#codecs;\n\tconstructor(codecRegistry, profileId) {\n\t\tthis.#codecs = codecRegistry;\n\t\tconst controlAdapter = new SqliteControlAdapter(codecRegistry);\n\t\tthis.profile = Object.freeze({\n\t\t\tid: profileId ?? \"sqlite/default@1\",\n\t\t\ttarget: \"sqlite\",\n\t\t\tcapabilities: defaultCapabilities,\n\t\t\treadMarker: (queryable) => controlAdapter.readMarkerDiscriminated({\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"sqlite\",\n\t\t\t\tquery: async (sql, params) => {\n\t\t\t\t\tconst rows = [];\n\t\t\t\t\tfor await (const row of queryable.query({\n\t\t\t\t\t\tsql,\n\t\t\t\t\t\t...params === void 0 ? {} : { params }\n\t\t\t\t\t})) rows.push(row);\n\t\t\t\t\treturn { rows };\n\t\t\t\t},\n\t\t\t\tclose: async () => {}\n\t\t\t}, APP_SPACE_ID)\n\t\t});\n\t}\n\tlower(ast, context) {\n\t\tif (isDdlNode(ast)) throw structuredError(\"RUNTIME.DDL_UNSUPPORTED\", \"lower() does not lower DDL on the runtime adapter — DDL lowering is a control-plane concern handled by the control adapter.\", { meta: { surface: \"runtime-adapter\" } });\n\t\treturn renderLoweredSql(ast, context.contract, this.#codecs);\n\t}\n};\n/** Codec-id lookup for bare-literal interpolations used by `fns.raw` on a sqlite client. Contributed as the descriptor's static `rawCodecInferer` slot. */\nconst sqliteRawCodecInferer = { inferCodec(value) {\n\tswitch (typeof value) {\n\t\tcase \"number\": return Number.isSafeInteger(value) && value % 1 === 0 ? \"sqlite/integer@1\" : \"sqlite/real@1\";\n\t\tcase \"bigint\": return \"sqlite/bigint@1\";\n\t\tcase \"string\": return \"sqlite/text@1\";\n\t\tcase \"boolean\": return \"sqlite/integer@1\";\n\t\tcase \"object\": if (value instanceof Uint8Array) return \"sqlite/blob@1\";\n\t}\n\tthrow structuredError(\"RUNTIME.RAW_SQL_UNSUPPORTED_INTERPOLATION\", \"unsupported JS value type for raw-SQL interpolation: wrap this value in `param(...)` with an explicit codec\", { meta: { valueType: typeof value } });\n} };\n/**\n* Lower a SQL query AST into a SQLite-flavored `{ sql, params }` payload.\n*\n* Shared between the runtime adapter (`SqliteAdapterImpl.lower`) and the control adapter (`SqliteControlAdapter.lower`) so both produce byte-identical SQL for the same AST and contract.\n*/\nfunction renderLoweredSql(ast, contract, codecs) {\n\tconst ctx = {\n\t\tcontract,\n\t\tcodecs\n\t};\n\tconst collectedParamRefs = ast.collectParamRefs();\n\tconst params = [];\n\tfor (const ref of collectedParamRefs) params.push(ref.kind === \"prepared-param-ref\" ? {\n\t\tkind: \"bind\",\n\t\tname: ref.name\n\t} : {\n\t\tkind: \"literal\",\n\t\tvalue: ref.value\n\t});\n\tlet sql;\n\tconst node = ast;\n\tswitch (node.kind) {\n\t\tcase \"select\":\n\t\t\tsql = renderSelect(node, ctx);\n\t\t\tbreak;\n\t\tcase \"insert\":\n\t\t\tsql = renderInsert(node, ctx);\n\t\t\tbreak;\n\t\tcase \"update\":\n\t\t\tsql = renderUpdate(node, ctx);\n\t\t\tbreak;\n\t\tcase \"delete\":\n\t\t\tsql = renderDelete(node, ctx);\n\t\t\tbreak;\n\t\tdefault: throw new InternalError(`Unsupported AST node kind: ${nodeKind(node)}`);\n\t}\n\treturn Object.freeze({\n\t\tsql,\n\t\tparams\n\t});\n}\nfunction renderLimitOffset(keyword, value, ctx) {\n\tif (value === void 0) return \"\";\n\tif (typeof value === \"number\") return `${keyword} ${value}`;\n\treturn `${keyword} ${renderExpr(value, ctx)}`;\n}\nfunction renderSelect(ast, ctx) {\n\treturn [\n\t\t`SELECT ${ast.distinct ? \"DISTINCT \" : \"\"}${renderProjection(ast.projection, ctx)}`,\n\t\tast.from !== void 0 ? `FROM ${renderSource(ast.from, ctx)}` : \"\",\n\t\tast.joins?.length ? ast.joins.map((join) => renderJoin(join, ctx)).join(\" \") : \"\",\n\t\tast.where ? `WHERE ${renderExpr(ast.where, ctx)}` : \"\",\n\t\tast.groupBy?.length ? `GROUP BY ${ast.groupBy.map((expr) => renderExpr(expr, ctx)).join(\", \")}` : \"\",\n\t\tast.having ? `HAVING ${renderExpr(ast.having, ctx)}` : \"\",\n\t\tast.orderBy?.length ? `ORDER BY ${ast.orderBy.map((order) => `${renderExpr(order.expr, ctx)} ${order.dir.toUpperCase()}`).join(\", \")}` : \"\",\n\t\trenderLimitOffset(\"LIMIT\", ast.limit, ctx),\n\t\trenderLimitOffset(\"OFFSET\", ast.offset, ctx)\n\t].filter((part) => part.length > 0).join(\" \").trim();\n}\nfunction renderProjection(projection, ctx) {\n\treturn projection.map((item) => {\n\t\tconst alias = quoteIdentifier(item.alias);\n\t\tif (item.expr.kind === \"literal\") return `${renderLiteral(item.expr)} AS ${alias}`;\n\t\treturn `${renderExpr(item.expr, ctx)} AS ${alias}`;\n\t}).join(\", \");\n}\nfunction qualifyTableFromNamespaceCoordinate(table, ctx) {\n\tif (table.namespaceId === void 0) return quoteIdentifier(table.name);\n\tif (ctx.contract === void 0) throw new InternalError(`Table \"${table.name}\" carries namespace \"${table.namespaceId}\" but no contract was supplied to resolve it`);\n\tconst namespace = ctx.contract.storage.namespaces[table.namespaceId];\n\tif (namespace === void 0) throw structuredError(\"RUNTIME.NAMESPACE_UNKNOWN\", `Table \"${table.name}\" references namespace \"${table.namespaceId}\" which is not present on the contract`, { meta: {\n\t\ttable: table.name,\n\t\tnamespaceId: table.namespaceId,\n\t\treason: \"not-present\"\n\t} });\n\tconst qualifyTable = namespace.qualifyTable;\n\tif (qualifyTable === void 0) throw structuredError(\"RUNTIME.NAMESPACE_UNKNOWN\", `Table \"${table.name}\" references namespace \"${table.namespaceId}\" which is not materialised for SQL rendering on the contract`, { meta: {\n\t\ttable: table.name,\n\t\tnamespaceId: table.namespaceId,\n\t\treason: \"not-materialised\"\n\t} });\n\treturn qualifyTable.call(namespace, table.name);\n}\nfunction renderTableSource(source, ctx) {\n\tconst qualified = qualifyTableFromNamespaceCoordinate(source, ctx);\n\tif (!source.alias) return qualified;\n\treturn `${qualified} AS ${quoteIdentifier(source.alias)}`;\n}\nfunction renderSource(source, ctx) {\n\tconst node = source;\n\tswitch (node.kind) {\n\t\tcase \"table-source\": return renderTableSource(node, ctx);\n\t\tcase \"derived-table-source\": return `(${renderSelect(node.query, ctx)}) AS ${quoteIdentifier(node.alias)}`;\n\t\tcase \"function-source\": {\n\t\t\tif (node.ordinality) throw structuredError(\"RUNTIME.AST_UNSUPPORTED\", \"SQLite does not support WITH ORDINALITY on function sources\", { meta: {\n\t\t\t\ttarget: \"sqlite\",\n\t\t\t\tfeature: \"function-source-with-ordinality\"\n\t\t\t} });\n\t\t\tif (node.columnAliases !== void 0) throw structuredError(\"RUNTIME.AST_UNSUPPORTED\", \"SQLite does not support returned-column aliases on function sources\", { meta: {\n\t\t\t\ttarget: \"sqlite\",\n\t\t\t\tfeature: \"function-source-column-aliases\"\n\t\t\t} });\n\t\t\tconst args = node.args.map((arg) => renderExpr(arg, ctx)).join(\", \");\n\t\t\tconst call = `${node.fn}(${args})`;\n\t\t\treturn node.alias !== void 0 ? `${call} AS ${quoteIdentifier(node.alias)}` : call;\n\t\t}\n\t\tdefault: return assertNever(node, `Unsupported source node kind: ${unreachableKind(node)}`);\n\t}\n}\nfunction renderExpr(expr, ctx) {\n\tconst node = expr;\n\tswitch (node.kind) {\n\t\tcase \"column-ref\": return renderColumn(node);\n\t\tcase \"identifier-ref\": return quoteIdentifier(node.name);\n\t\tcase \"operation\": return renderOperation(node, ctx);\n\t\tcase \"subquery\": return renderSubqueryExpr(node, ctx);\n\t\tcase \"aggregate\": return renderAggregateExpr(node, ctx);\n\t\tcase \"window-func\": return renderWindowFuncExpr(node, ctx);\n\t\tcase \"function-call\": return renderFunctionCallExpr(node, ctx);\n\t\tcase \"cast\": return renderCastExpr(node, ctx);\n\t\tcase \"case\": return renderCaseExpr(node, ctx);\n\t\tcase \"json-object\": return renderJsonObjectExpr(node, ctx);\n\t\tcase \"json-array-agg\": return renderJsonArrayAggExpr(node, ctx);\n\t\tcase \"binary\": return renderBinary(node, ctx);\n\t\tcase \"and\":\n\t\t\tif (node.exprs.length === 0) return \"TRUE\";\n\t\t\treturn `(${node.exprs.map((part) => renderExpr(part, ctx)).join(\" AND \")})`;\n\t\tcase \"or\":\n\t\t\tif (node.exprs.length === 0) return \"FALSE\";\n\t\t\treturn `(${node.exprs.map((part) => renderExpr(part, ctx)).join(\" OR \")})`;\n\t\tcase \"exists\":\n\t\t\tif (ctx.contract === void 0) throw new InternalError(\"EXISTS subquery rendering requires a Sqlite contract\");\n\t\t\treturn `${node.notExists ? \"NOT \" : \"\"}EXISTS (${renderSelect(node.subquery, ctx)})`;\n\t\tcase \"null-check\": return renderNullCheck(node, ctx);\n\t\tcase \"not\": return `NOT (${renderExpr(node.expr, ctx)})`;\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\": return \"?\";\n\t\tcase \"literal\": return renderLiteral(node);\n\t\tcase \"list\": return renderListLiteral(node, ctx);\n\t\tcase \"raw-expr\": return renderRawExpr(node, ctx);\n\t\tdefault: return assertNever(node, `Unsupported expression node kind: ${unreachableKind(node)}`);\n\t}\n}\nfunction renderRawExpr(node, ctx) {\n\treturn node.parts.map((part) => typeof part === \"string\" ? part : renderExpr(part, ctx)).join(\"\");\n}\nfunction renderColumn(ref) {\n\tif (ref.table === \"excluded\") return `excluded.${quoteIdentifier(ref.column)}`;\n\treturn `${quoteIdentifier(ref.table)}.${quoteIdentifier(ref.column)}`;\n}\nfunction renderLiteral(expr) {\n\tif (typeof expr.value === \"string\") return `'${escapeLiteral(expr.value)}'`;\n\tif (typeof expr.value === \"number\" || typeof expr.value === \"boolean\") return String(expr.value);\n\tif (typeof expr.value === \"bigint\") return String(expr.value);\n\tif (expr.value === null || expr.value === void 0) return \"NULL\";\n\tif (expr.value instanceof Date) return `'${escapeLiteral(expr.value.toISOString())}'`;\n\tconst json = JSON.stringify(expr.value);\n\tif (json === void 0) return \"NULL\";\n\treturn `'${escapeLiteral(json)}'`;\n}\nfunction renderOperation(expr, ctx) {\n\tconst self = renderExpr(expr.self, ctx);\n\tconst args = expr.args.map((arg) => renderExpr(arg, ctx));\n\tlet result = expr.lowering.template;\n\tresult = result.replace(/\\{\\{self\\}\\}/g, self);\n\tfor (let i = 0; i < args.length; i++) result = result.replace(new RegExp(`\\\\{\\\\{arg${i}\\\\}\\\\}`, \"g\"), args[i] ?? \"\");\n\treturn result;\n}\nfunction renderSubqueryExpr(expr, ctx) {\n\tif (expr.query.projection.length !== 1) throw structuredError(\"RUNTIME.AST_INVALID\", \"Subquery expressions must project exactly one column\", { meta: { node: \"subquery\" } });\n\tif (ctx.contract === void 0) throw new InternalError(\"Subquery expression rendering requires a Sqlite contract\");\n\treturn `(${renderSelect(expr.query, ctx)})`;\n}\nfunction requiresNullCheckGrouping(kind) {\n\tswitch (kind) {\n\t\tcase \"operation\":\n\t\tcase \"subquery\": return true;\n\t\tcase \"column-ref\":\n\t\tcase \"identifier-ref\":\n\t\tcase \"aggregate\":\n\t\tcase \"window-func\":\n\t\tcase \"function-call\":\n\t\tcase \"cast\":\n\t\tcase \"case\":\n\t\tcase \"json-object\":\n\t\tcase \"json-array-agg\":\n\t\tcase \"binary\":\n\t\tcase \"and\":\n\t\tcase \"or\":\n\t\tcase \"exists\":\n\t\tcase \"null-check\":\n\t\tcase \"not\":\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\":\n\t\tcase \"literal\":\n\t\tcase \"list\":\n\t\tcase \"raw-expr\": return false;\n\t}\n}\nfunction renderNullCheck(expr, ctx) {\n\tconst rendered = renderExpr(expr.expr, ctx);\n\tconst renderedExpr = requiresNullCheckGrouping(expr.expr.kind) ? `(${rendered})` : rendered;\n\treturn expr.isNull ? `${renderedExpr} IS NULL` : `${renderedExpr} IS NOT NULL`;\n}\nfunction renderBinary(expr, ctx) {\n\tif (expr.right.kind === \"list\" && expr.right.values.length === 0) {\n\t\tif (expr.op === \"in\") return \"FALSE\";\n\t\tif (expr.op === \"notIn\") return \"TRUE\";\n\t}\n\tconst leftExpr = expr.left;\n\tconst left = renderExpr(leftExpr, ctx);\n\tconst leftRendered = leftExpr.kind === \"operation\" || leftExpr.kind === \"subquery\" ? `(${left})` : left;\n\tconst rightNode = expr.right;\n\tlet right;\n\tswitch (rightNode.kind) {\n\t\tcase \"list\":\n\t\t\tright = renderListLiteral(rightNode, ctx);\n\t\t\tbreak;\n\t\tcase \"literal\":\n\t\t\tright = renderLiteral(rightNode);\n\t\t\tbreak;\n\t\tcase \"column-ref\":\n\t\t\tright = renderColumn(rightNode);\n\t\t\tbreak;\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\":\n\t\t\tright = \"?\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tright = renderExpr(rightNode, ctx);\n\t\t\tbreak;\n\t}\n\treturn `${leftRendered} ${{\n\t\teq: \"=\",\n\t\tneq: \"!=\",\n\t\tgt: \">\",\n\t\tlt: \"<\",\n\t\tgte: \">=\",\n\t\tlte: \"<=\",\n\t\tlike: \"LIKE\",\n\t\tin: \"IN\",\n\t\tnotIn: \"NOT IN\"\n\t}[expr.op]} ${right}`;\n}\nfunction renderListLiteral(expr, ctx) {\n\tif (expr.values.length === 0) return \"(NULL)\";\n\treturn `(${expr.values.map((v) => {\n\t\tif (v.kind === \"param-ref\" || v.kind === \"prepared-param-ref\") return \"?\";\n\t\tif (v.kind === \"literal\") return renderLiteral(v);\n\t\treturn renderExpr(v, ctx);\n\t}).join(\", \")})`;\n}\nfunction renderAggregateExpr(expr, ctx) {\n\tconst fn = expr.fn.toUpperCase();\n\tif (!expr.expr) return `${fn}(*)`;\n\treturn `${fn}(${renderExpr(expr.expr, ctx)})`;\n}\nfunction renderWindowFuncExpr(expr, ctx) {\n\treturn `${expr.fn.toUpperCase()}(${expr.args.map((arg) => renderExpr(arg, ctx)).join(\", \")}) OVER (${[expr.partitionBy && expr.partitionBy.length > 0 ? `PARTITION BY ${expr.partitionBy.map((e) => renderExpr(e, ctx)).join(\", \")}` : \"\", expr.orderBy && expr.orderBy.length > 0 ? `ORDER BY ${renderOrderByItems(expr.orderBy, ctx)}` : \"\"].filter((part) => part.length > 0).join(\" \")})`;\n}\nfunction renderFunctionCallExpr(expr, ctx) {\n\tconst args = expr.args.map((arg) => renderExpr(arg, ctx)).join(\", \");\n\treturn `${expr.fn}(${args})`;\n}\nfunction renderCastExpr(expr, ctx) {\n\treturn `CAST(${renderExpr(expr.expr, ctx)} AS ${expr.targetType})`;\n}\nfunction renderCaseExpr(expr, ctx) {\n\treturn `CASE ${expr.branches.map((branch) => `WHEN ${renderExpr(branch.condition, ctx)} THEN ${renderExpr(branch.value, ctx)}`).join(\" \")}${expr.elseExpr === void 0 ? \"\" : ` ELSE ${renderExpr(expr.elseExpr, ctx)}`} END`;\n}\nfunction renderJsonValueProjection(projection, ctx) {\n\treturn projection.accept({\n\t\tcodec: ({ value, codec }) => renderExpr(projectJsonThroughCodec(value, codec, ctx.codecs), ctx),\n\t\tnative: ({ value }) => renderExpr(value, ctx),\n\t\tdocument: ({ value }) => renderExpr(jsonDocumentRetag(value), ctx)\n\t});\n}\nfunction projectJsonThroughCodec(value, codec, codecs) {\n\tconst descriptor = codecs.descriptorFor(codec.codecId);\n\tif (descriptor === void 0) throw structuredError(\"RUNTIME.PARAM_REF_MISSING_CODEC\", `SQLite lowering: a JSON projection carries codecId \"${codec.codecId}\" but the validated SQLite codec registry has no entry for it. This usually indicates a missing extension pack in the runtime stack — register the pack that contributes this codec, or use the codec directly from \\`@prisma/orm-target-sqlite/target/codecs\\` if it's a builtin.`, { meta: { codecId: codec.codecId } });\n\treturn descriptor.projectJson(value, codec);\n}\nfunction renderJsonObjectExpr(expr, ctx) {\n\treturn `json_object(${expr.entries.flatMap((entry) => {\n\t\treturn [`'${escapeLiteral(entry.key)}'`, renderJsonValueProjection(entry.value, ctx)];\n\t}).join(\", \")})`;\n}\nfunction renderOrderByItems(items, ctx) {\n\treturn items.map((item) => `${renderExpr(item.expr, ctx)} ${item.dir.toUpperCase()}`).join(\", \");\n}\nfunction renderJsonArrayAggExpr(expr, ctx) {\n\tconst aggregateOrderBy = expr.orderBy && expr.orderBy.length > 0 ? ` ORDER BY ${renderOrderByItems(expr.orderBy, ctx)}` : \"\";\n\tconst aggregated = `json_group_array(${renderJsonValueProjection(expr.expr, ctx)}${aggregateOrderBy})`;\n\tif (expr.onEmpty === \"emptyArray\") return `coalesce(${aggregated}, '[]')`;\n\treturn aggregated;\n}\nfunction renderJoin(join, ctx) {\n\tif (ctx.contract === void 0) throw new InternalError(\"JOIN rendering requires a Sqlite contract\");\n\treturn `${join.joinType.toUpperCase()} JOIN ${renderSource(join.source, ctx)} ON ${renderJoinOn(join.on, ctx)}`;\n}\nfunction renderJoinOn(on, ctx) {\n\tif (on.kind === \"eq-col-join-on\") return `${renderColumn(on.left)} = ${renderColumn(on.right)}`;\n\treturn renderExpr(on, ctx);\n}\nfunction renderInsertValue(value, ctx) {\n\tswitch (value.kind) {\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\": return \"?\";\n\t\tcase \"column-ref\": return renderColumn(value);\n\t\tcase \"raw-expr\": return renderExpr(value, ctx);\n\t\tcase \"default-value\": throw structuredError(\"RUNTIME.AST_UNSUPPORTED\", \"SQLite does not support DEFAULT as a value in INSERT ... VALUES\", { meta: { node: \"default-value\" } });\n\t\tdefault: return assertNever(value, `Unsupported value node in INSERT: ${unreachableKind(value)}`);\n\t}\n}\nfunction renderInsert(ast, ctx) {\n\tconst table = qualifyTableFromNamespaceCoordinate(ast.table, ctx);\n\tconst rows = ast.rows;\n\tconst firstRow = rows[0];\n\tif (firstRow === void 0) throw structuredError(\"RUNTIME.AST_INVALID\", \"INSERT requires at least one row\", { meta: {\n\t\tnode: \"insert\",\n\t\ttable: ast.table.name\n\t} });\n\tconst columnOrder = Object.keys(firstRow);\n\tlet insertClause;\n\tif (columnOrder.length === 0) insertClause = `INSERT INTO ${table} DEFAULT VALUES`;\n\telse {\n\t\tconst columns = columnOrder.map((column) => quoteIdentifier(column));\n\t\tconst values = rows.map((row) => {\n\t\t\treturn `(${columnOrder.map((column) => {\n\t\t\t\tconst value = row[column];\n\t\t\t\tif (value === void 0) throw structuredError(\"RUNTIME.AST_INVALID\", `Missing value for column \"${column}\" in INSERT row`, { meta: {\n\t\t\t\t\tnode: \"insert\",\n\t\t\t\t\ttable: ast.table.name,\n\t\t\t\t\tcolumn\n\t\t\t\t} });\n\t\t\t\treturn renderInsertValue(value, ctx);\n\t\t\t}).join(\", \")})`;\n\t\t}).join(\", \");\n\t\tinsertClause = `INSERT INTO ${table} (${columns.join(\", \")}) VALUES ${values}`;\n\t}\n\tlet onConflictClause = \"\";\n\tif (ast.onConflict) {\n\t\tconst conflictColumns = ast.onConflict.columns.map((col) => quoteIdentifier(col.column));\n\t\tif (conflictColumns.length === 0) throw structuredError(\"RUNTIME.AST_INVALID\", \"INSERT onConflict requires at least one conflict column\", { meta: {\n\t\t\tnode: \"insert\",\n\t\t\ttable: ast.table.name\n\t\t} });\n\t\tconst action = ast.onConflict.action;\n\t\tswitch (action.kind) {\n\t\t\tcase \"do-nothing\":\n\t\t\t\tonConflictClause = ` ON CONFLICT (${conflictColumns.join(\", \")}) DO NOTHING`;\n\t\t\t\tbreak;\n\t\t\tcase \"do-update-set\": {\n\t\t\t\tconst updates = Object.entries(action.set).map(([colName, value]) => {\n\t\t\t\t\treturn `${quoteIdentifier(colName)} = ${renderExpr(value, ctx)}`;\n\t\t\t\t});\n\t\t\t\tonConflictClause = ` ON CONFLICT (${conflictColumns.join(\", \")}) DO UPDATE SET ${updates.join(\", \")}`;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: assertNever(action, `Unsupported onConflict action: ${unreachableKind(action)}`);\n\t\t}\n\t}\n\tconst returningClause = renderReturning(ast.returning, ctx);\n\treturn `${insertClause}${onConflictClause}${returningClause}`;\n}\nfunction renderUpdate(ast, ctx) {\n\tconst table = qualifyTableFromNamespaceCoordinate(ast.table, ctx);\n\tconst setClauses = Object.entries(ast.set).map(([col, val]) => {\n\t\treturn `${quoteIdentifier(col)} = ${renderExpr(val, ctx)}`;\n\t});\n\tconst whereClause = ast.where ? ` WHERE ${renderExpr(ast.where, ctx)}` : \"\";\n\tconst returningClause = renderReturning(ast.returning, ctx);\n\treturn `UPDATE ${table} SET ${setClauses.join(\", \")}${whereClause}${returningClause}`;\n}\nfunction renderDelete(ast, ctx) {\n\treturn `DELETE FROM ${qualifyTableFromNamespaceCoordinate(ast.table, ctx)}${ast.where ? ` WHERE ${renderExpr(ast.where, ctx)}` : \"\"}${renderReturning(ast.returning, ctx)}`;\n}\nfunction renderReturning(returning, ctx) {\n\tif (!returning?.length) return \"\";\n\treturn ` RETURNING ${returning.map((item) => {\n\t\tif (item.expr.kind === \"column-ref\") {\n\t\t\tconst rendered = `${quoteIdentifier(item.expr.table)}.${quoteIdentifier(item.expr.column)}`;\n\t\t\treturn item.expr.column === item.alias ? rendered : `${rendered} AS ${quoteIdentifier(item.alias)}`;\n\t\t}\n\t\treturn `${renderExpr(item.expr, ctx)} AS ${quoteIdentifier(item.alias)}`;\n\t}).join(\", \")}`;\n}\nfunction createSqliteAdapter(options) {\n\tconst codecRegistry = createSqliteCodecRegistryWithBuiltins(options?.codecDescriptors);\n\treturn Object.freeze(new SqliteAdapterImpl(codecRegistry, options?.profileId));\n}\nfunction createSqliteAdapterWithCodecRegistry(codecRegistry) {\n\treturn Object.freeze(new SqliteAdapterImpl(codecRegistry));\n}\n//#endregion\nexport { SqliteControlAdapter as a, createSqliteCodecRegistryWithBuiltins as c, sqliteRawCodecInferer as i, createSqliteAdapterWithCodecRegistry as n, assembleSqliteCodecRegistry as o, renderLoweredSql as r, createSqliteBuiltinCodecLookup as s, createSqliteAdapter as t };\n\n//# sourceMappingURL=adapter-BHzKEzqw.mjs.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js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as quoteIdentifier, t as escapeLiteral } from "./sql-utils-DqPXZBMA-Mm27NNjs.mjs";
|
|
2
2
|
import { t as parseSqliteDefault } from "./default-normalizer-DuoHj9-O-DsK7lJZn.mjs";
|
|
3
3
|
import { t as normalizeSqliteNativeType } from "./native-type-normalizer-GpQMEyN5.mjs";
|
|
4
|
-
import { a as createSqliteBuiltinCodecLookup, c as sqliteRawCodecInferer, o as createSqliteCodecRegistryWithBuiltins, r as createSqliteAdapter, s as renderLoweredSql, t as SqliteControlAdapter } from "./adapter-
|
|
4
|
+
import { a as createSqliteBuiltinCodecLookup, c as sqliteRawCodecInferer, o as createSqliteCodecRegistryWithBuiltins, r as createSqliteAdapter, s as renderLoweredSql, t as SqliteControlAdapter } from "./adapter-BHzKEzqw-CPUu2tBl.mjs";
|
|
5
5
|
import { a as jsonColumn, i as integerColumn, n as blobColumn, o as realColumn, r as datetimeColumn, s as textColumn, t as bigintColumn } from "./column-types-NVxgsjFA.mjs";
|
|
6
6
|
export { SqliteControlAdapter, bigintColumn, blobColumn, createSqliteAdapter, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins, datetimeColumn, escapeLiteral, integerColumn, jsonColumn, normalizeSqliteNativeType, parseSqliteDefault, quoteIdentifier, realColumn, renderLoweredSql, sqliteRawCodecInferer, textColumn };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as sqliteRawCodecInferer, r as createSqliteAdapter } from "./adapter-
|
|
1
|
+
import { c as sqliteRawCodecInferer, r as createSqliteAdapter } from "./adapter-BHzKEzqw-CPUu2tBl.mjs";
|
|
2
2
|
export { createSqliteAdapter, sqliteRawCodecInferer };
|
|
@@ -2,7 +2,7 @@ import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DA
|
|
|
2
2
|
import { n as quoteIdentifier, t as escapeLiteral } from "./sql-utils-DqPXZBMA-Mm27NNjs.mjs";
|
|
3
3
|
import { t as parseSqliteDefault } from "./default-normalizer-DuoHj9-O-DsK7lJZn.mjs";
|
|
4
4
|
import { t as normalizeSqliteNativeType } from "./native-type-normalizer-GpQMEyN5.mjs";
|
|
5
|
-
import { a as createSqliteBuiltinCodecLookup, n as assembleSqliteCodecRegistry, o as createSqliteCodecRegistryWithBuiltins, t as SqliteControlAdapter } from "./adapter-
|
|
5
|
+
import { a as createSqliteBuiltinCodecLookup, n as assembleSqliteCodecRegistry, o as createSqliteCodecRegistryWithBuiltins, t as SqliteControlAdapter } from "./adapter-BHzKEzqw-CPUu2tBl.mjs";
|
|
6
6
|
import { t as sqliteAdapterDescriptorMeta } from "./descriptor-meta-DjKgG4z5-BAKSkr1j.mjs";
|
|
7
7
|
import { timestampNowControlDescriptor } from "@prisma/orm-family-sql/family/control";
|
|
8
8
|
import { builtinGeneratorRegistryMetadata } from "@prisma/orm-framework/ids";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/control.mjs"],"sourcesContent":["import { a as SqliteControlAdapter, c as createSqliteCodecRegistryWithBuiltins, o as assembleSqliteCodecRegistry, s as createSqliteBuiltinCodecLookup } from \"./adapter-NeO612zv.mjs\";\nimport { t as sqliteAdapterDescriptorMeta } from \"./descriptor-meta-DjKgG4z5.mjs\";\nimport { escapeLiteral, quoteIdentifier } from \"@internal/target-sqlite/sql-utils\";\nimport { parseSqliteDefault } from \"@internal/target-sqlite/default-normalizer\";\nimport { normalizeSqliteNativeType } from \"@internal/target-sqlite/native-type-normalizer\";\nimport { SQLITE_BIGINT_CODEC_ID, SQLITE_BLOB_CODEC_ID, SQLITE_DATETIME_CODEC_ID, SQLITE_INTEGER_CODEC_ID, SQLITE_JSON_CODEC_ID, SQLITE_REAL_CODEC_ID, SQLITE_TEXT_CODEC_ID } from \"@internal/target-sqlite/codec-ids\";\nimport { timestampNowControlDescriptor } from \"@internal/family-sql/control\";\nimport { builtinGeneratorRegistryMetadata } from \"@internal/ids\";\nimport { int, num, oneOf, optional, str } from \"@internal/psl-parser\";\n//#region src/core/control-mutation-defaults.ts\nfunction invalidArgumentDiagnostic(input) {\n\treturn {\n\t\tok: false,\n\t\tdiagnostic: {\n\t\t\tcode: \"PSL_INVALID_DEFAULT_FUNCTION_ARGUMENT\",\n\t\t\tmessage: input.message,\n\t\t\tsourceId: input.context.sourceId,\n\t\t\tspan: input.span\n\t\t}\n\t};\n}\nfunction executionGenerator(id, params) {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"execution\",\n\t\t\tgenerated: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid,\n\t\t\t\t...params ? { params } : {}\n\t\t\t}\n\t\t}\n\t};\n}\n/**\n* SQLite spellings that all denote the same wall-clock-now value. Anything\n* matching this set when passed through `dbgenerated(\"...\")` is rewritten\n* to the canonical `now()` form before entering the contract — symmetric\n* with `parseSqliteDefault` on the introspection side, so the verifier\n* compares canonical-vs-canonical and a contract using\n* `dbgenerated(\"CURRENT_TIMESTAMP\")` doesn't drift against the schema it\n* just produced.\n*/\nconst NOW_SYNONYMS = /* @__PURE__ */ new Set([\n\t\"current_timestamp\",\n\t\"datetime('now')\",\n\t\"datetime(\\\"now\\\")\",\n\t\"now()\"\n]);\nfunction lowerAutoincrement() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"autoincrement()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerNow() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"now()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerUlid() {\n\treturn executionGenerator(\"ulid\");\n}\nfunction lowerUuid(input) {\n\treturn input.call.args[\"version\"] === 7 ? executionGenerator(\"uuidv7\") : executionGenerator(\"uuidv4\");\n}\nfunction lowerCuid() {\n\treturn executionGenerator(\"cuid2\");\n}\nfunction lowerNanoid(input) {\n\tconst size = input.call.args[\"size\"];\n\treturn typeof size === \"number\" ? executionGenerator(\"nanoid\", { size }) : executionGenerator(\"nanoid\");\n}\nfunction lowerDbgenerated(input) {\n\tconst raw = input.call.args[\"expression\"];\n\tif (typeof raw !== \"string\" || raw.trim().length === 0) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.span,\n\t\tmessage: \"Default function \\\"dbgenerated\\\" argument cannot be empty.\"\n\t});\n\tconst trimmed = raw.trim();\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: NOW_SYNONYMS.has(trimmed.toLowerCase()) ? \"now()\" : trimmed\n\t\t\t}\n\t\t}\n\t};\n}\nconst nowSig = {};\nconst autoincrementSig = {};\nconst ulidSig = {};\nconst uuidSig = { positional: [{\n\tkey: \"version\",\n\ttype: optional(oneOf(num(4), num(7)))\n}] };\nconst cuidSig = { positional: [{\n\tkey: \"version\",\n\ttype: num(2)\n}] };\nconst nanoidSig = { positional: [{\n\tkey: \"size\",\n\ttype: optional(int({\n\t\tmin: 2,\n\t\tmax: 255\n\t}))\n}] };\nconst dbgeneratedSig = { positional: [{\n\tkey: \"expression\",\n\ttype: str()\n}] };\nconst sqliteDefaultFunctionRegistryEntries = [\n\t[\"autoincrement\", {\n\t\tsignature: autoincrementSig,\n\t\tlower: lowerAutoincrement,\n\t\tusageSignatures: [\"autoincrement()\"]\n\t}],\n\t[\"now\", {\n\t\tsignature: nowSig,\n\t\tlower: lowerNow,\n\t\tusageSignatures: [\"now()\"]\n\t}],\n\t[\"uuid\", {\n\t\tsignature: uuidSig,\n\t\tlower: lowerUuid,\n\t\tusageSignatures: [\n\t\t\t\"uuid()\",\n\t\t\t\"uuid(4)\",\n\t\t\t\"uuid(7)\"\n\t\t]\n\t}],\n\t[\"cuid\", {\n\t\tsignature: cuidSig,\n\t\tlower: lowerCuid,\n\t\tusageSignatures: [\"cuid(2)\"]\n\t}],\n\t[\"ulid\", {\n\t\tsignature: ulidSig,\n\t\tlower: lowerUlid,\n\t\tusageSignatures: [\"ulid()\"]\n\t}],\n\t[\"nanoid\", {\n\t\tsignature: nanoidSig,\n\t\tlower: lowerNanoid,\n\t\tusageSignatures: [\"nanoid()\", \"nanoid(<2-255>)\"]\n\t}],\n\t[\"dbgenerated\", {\n\t\tsignature: dbgeneratedSig,\n\t\tlower: lowerDbgenerated,\n\t\tusageSignatures: [\"dbgenerated(\\\"...\\\")\"]\n\t}]\n];\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring\n* channel, with explicit `nativeType` values pinned to the codec manifests\n* (`codecLookup.targetTypesFor(codecId)[0]`).\n*\n* The type position is the only storage decider: a mutation-default generator\n* (`@default(uuid())`) never re-picks a column's storage.\n*/\nconst sqliteScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_TEXT_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_INTEGER_CODEC_ID,\n\t\t\tnativeType: \"integer\"\n\t\t}\n\t},\n\tBigInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_BIGINT_CODEC_ID,\n\t\t\tnativeType: \"integer\"\n\t\t}\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_REAL_CODEC_ID,\n\t\t\tnativeType: \"real\"\n\t\t}\n\t},\n\tDecimal: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_TEXT_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_DATETIME_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_JSON_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tBytes: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_BLOB_CODEC_ID,\n\t\t\tnativeType: \"blob\"\n\t\t}\n\t}\n};\nfunction createSqliteDefaultFunctionRegistry() {\n\treturn new Map(sqliteDefaultFunctionRegistryEntries);\n}\nfunction createSqliteMutationDefaultGeneratorDescriptors() {\n\treturn [...builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({\n\t\tid,\n\t\tapplicableCodecIds\n\t})), timestampNowControlDescriptor()];\n}\n//#endregion\n//#region src/exports/control.ts\nconst sqliteAdapterDescriptor = {\n\t...sqliteAdapterDescriptorMeta,\n\tauthoring: {\n\t\ttype: sqliteScalarAuthoringTypes,\n\t\tvalueObjectStorageType: \"Json\"\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createSqliteDefaultFunctionRegistry(),\n\t\tgeneratorDescriptors: createSqliteMutationDefaultGeneratorDescriptors()\n\t},\n\tcreate(stack) {\n\t\treturn new SqliteControlAdapter(assembleSqliteCodecRegistry(stack.target, stack.extensions));\n\t}\n};\n//#endregion\nexport { SqliteControlAdapter, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins, sqliteAdapterDescriptor as default, escapeLiteral, normalizeSqliteNativeType, parseSqliteDefault, quoteIdentifier };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,0BAA0B,OAAO;CACzC,OAAO;EACN,IAAI;EACJ,YAAY;GACX,MAAM;GAC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;EACb;CACD;CACA,KAAK;EACJ,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,QAAQ;EACP,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,OAAO;EACN,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,SAAS;EACR,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,UAAU;EACT,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,MAAM;EACL,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;CACA,OAAO;EACN,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;CACD;AACD;AACA,SAAS,sCAAsC;CAC9C,OAAO,IAAI,IAAI,oCAAoC;AACpD;AACA,SAAS,kDAAkD;CAC1D,OAAO,CAAC,GAAG,iCAAiC,KAAK,EAAE,IAAI,0BAA0B;EAChF;EACA;CACD,EAAE,GAAG,8BAA8B,CAAC;AACrC;AAGA,MAAM,0BAA0B;CAC/B,GAAG;CACH,WAAW;EACV,MAAM;EACN,wBAAwB;CACzB;CACA,yBAAyB;EACxB,yBAAyB,oCAAoC;EAC7D,sBAAsB,gDAAgD;CACvE;CACA,OAAO,OAAO;EACb,OAAO,IAAI,qBAAqB,4BAA4B,MAAM,QAAQ,MAAM,UAAU,CAAC;CAC5F;AACD"}
|
|
1
|
+
{"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/control.mjs"],"sourcesContent":["import { a as SqliteControlAdapter, c as createSqliteCodecRegistryWithBuiltins, o as assembleSqliteCodecRegistry, s as createSqliteBuiltinCodecLookup } from \"./adapter-BHzKEzqw.mjs\";\nimport { t as sqliteAdapterDescriptorMeta } from \"./descriptor-meta-DjKgG4z5.mjs\";\nimport { escapeLiteral, quoteIdentifier } from \"@internal/target-sqlite/sql-utils\";\nimport { parseSqliteDefault } from \"@internal/target-sqlite/default-normalizer\";\nimport { normalizeSqliteNativeType } from \"@internal/target-sqlite/native-type-normalizer\";\nimport { SQLITE_BIGINT_CODEC_ID, SQLITE_BLOB_CODEC_ID, SQLITE_DATETIME_CODEC_ID, SQLITE_INTEGER_CODEC_ID, SQLITE_JSON_CODEC_ID, SQLITE_REAL_CODEC_ID, SQLITE_TEXT_CODEC_ID } from \"@internal/target-sqlite/codec-ids\";\nimport { timestampNowControlDescriptor } from \"@internal/family-sql/control\";\nimport { builtinGeneratorRegistryMetadata } from \"@internal/ids\";\nimport { int, num, oneOf, optional, str } from \"@internal/psl-parser\";\n//#region src/core/control-mutation-defaults.ts\nfunction invalidArgumentDiagnostic(input) {\n\treturn {\n\t\tok: false,\n\t\tdiagnostic: {\n\t\t\tcode: \"PSL_INVALID_DEFAULT_FUNCTION_ARGUMENT\",\n\t\t\tmessage: input.message,\n\t\t\tsourceId: input.context.sourceId,\n\t\t\tspan: input.span\n\t\t}\n\t};\n}\nfunction executionGenerator(id, params) {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"execution\",\n\t\t\tgenerated: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid,\n\t\t\t\t...params ? { params } : {}\n\t\t\t}\n\t\t}\n\t};\n}\n/**\n* SQLite spellings that all denote the same wall-clock-now value. Anything\n* matching this set when passed through `dbgenerated(\"...\")` is rewritten\n* to the canonical `now()` form before entering the contract — symmetric\n* with `parseSqliteDefault` on the introspection side, so the verifier\n* compares canonical-vs-canonical and a contract using\n* `dbgenerated(\"CURRENT_TIMESTAMP\")` doesn't drift against the schema it\n* just produced.\n*/\nconst NOW_SYNONYMS = /* @__PURE__ */ new Set([\n\t\"current_timestamp\",\n\t\"datetime('now')\",\n\t\"datetime(\\\"now\\\")\",\n\t\"now()\"\n]);\nfunction lowerAutoincrement() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"autoincrement()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerNow() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"now()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerUlid() {\n\treturn executionGenerator(\"ulid\");\n}\nfunction lowerUuid(input) {\n\treturn input.call.args[\"version\"] === 7 ? executionGenerator(\"uuidv7\") : executionGenerator(\"uuidv4\");\n}\nfunction lowerCuid() {\n\treturn executionGenerator(\"cuid2\");\n}\nfunction lowerNanoid(input) {\n\tconst size = input.call.args[\"size\"];\n\treturn typeof size === \"number\" ? executionGenerator(\"nanoid\", { size }) : executionGenerator(\"nanoid\");\n}\nfunction lowerDbgenerated(input) {\n\tconst raw = input.call.args[\"expression\"];\n\tif (typeof raw !== \"string\" || raw.trim().length === 0) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.span,\n\t\tmessage: \"Default function \\\"dbgenerated\\\" argument cannot be empty.\"\n\t});\n\tconst trimmed = raw.trim();\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: NOW_SYNONYMS.has(trimmed.toLowerCase()) ? \"now()\" : trimmed\n\t\t\t}\n\t\t}\n\t};\n}\nconst nowSig = {};\nconst autoincrementSig = {};\nconst ulidSig = {};\nconst uuidSig = { positional: [{\n\tkey: \"version\",\n\ttype: optional(oneOf(num(4), num(7)))\n}] };\nconst cuidSig = { positional: [{\n\tkey: \"version\",\n\ttype: num(2)\n}] };\nconst nanoidSig = { positional: [{\n\tkey: \"size\",\n\ttype: optional(int({\n\t\tmin: 2,\n\t\tmax: 255\n\t}))\n}] };\nconst dbgeneratedSig = { positional: [{\n\tkey: \"expression\",\n\ttype: str()\n}] };\nconst sqliteDefaultFunctionRegistryEntries = [\n\t[\"autoincrement\", {\n\t\tsignature: autoincrementSig,\n\t\tlower: lowerAutoincrement,\n\t\tusageSignatures: [\"autoincrement()\"]\n\t}],\n\t[\"now\", {\n\t\tsignature: nowSig,\n\t\tlower: lowerNow,\n\t\tusageSignatures: [\"now()\"]\n\t}],\n\t[\"uuid\", {\n\t\tsignature: uuidSig,\n\t\tlower: lowerUuid,\n\t\tusageSignatures: [\n\t\t\t\"uuid()\",\n\t\t\t\"uuid(4)\",\n\t\t\t\"uuid(7)\"\n\t\t]\n\t}],\n\t[\"cuid\", {\n\t\tsignature: cuidSig,\n\t\tlower: lowerCuid,\n\t\tusageSignatures: [\"cuid(2)\"]\n\t}],\n\t[\"ulid\", {\n\t\tsignature: ulidSig,\n\t\tlower: lowerUlid,\n\t\tusageSignatures: [\"ulid()\"]\n\t}],\n\t[\"nanoid\", {\n\t\tsignature: nanoidSig,\n\t\tlower: lowerNanoid,\n\t\tusageSignatures: [\"nanoid()\", \"nanoid(<2-255>)\"]\n\t}],\n\t[\"dbgenerated\", {\n\t\tsignature: dbgeneratedSig,\n\t\tlower: lowerDbgenerated,\n\t\tusageSignatures: [\"dbgenerated(\\\"...\\\")\"]\n\t}]\n];\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring\n* channel, with explicit `nativeType` values pinned to the codec manifests\n* (`codecLookup.targetTypesFor(codecId)[0]`).\n*\n* The type position is the only storage decider: a mutation-default generator\n* (`@default(uuid())`) never re-picks a column's storage.\n*/\nconst sqliteScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_TEXT_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_INTEGER_CODEC_ID,\n\t\t\tnativeType: \"integer\"\n\t\t}\n\t},\n\tBigInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_BIGINT_CODEC_ID,\n\t\t\tnativeType: \"integer\"\n\t\t}\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_REAL_CODEC_ID,\n\t\t\tnativeType: \"real\"\n\t\t}\n\t},\n\tDecimal: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_TEXT_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_DATETIME_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_JSON_CODEC_ID,\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tBytes: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: SQLITE_BLOB_CODEC_ID,\n\t\t\tnativeType: \"blob\"\n\t\t}\n\t}\n};\nfunction createSqliteDefaultFunctionRegistry() {\n\treturn new Map(sqliteDefaultFunctionRegistryEntries);\n}\nfunction createSqliteMutationDefaultGeneratorDescriptors() {\n\treturn [...builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({\n\t\tid,\n\t\tapplicableCodecIds\n\t})), timestampNowControlDescriptor()];\n}\n//#endregion\n//#region src/exports/control.ts\nconst sqliteAdapterDescriptor = {\n\t...sqliteAdapterDescriptorMeta,\n\tauthoring: {\n\t\ttype: sqliteScalarAuthoringTypes,\n\t\tvalueObjectStorageType: \"Json\"\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createSqliteDefaultFunctionRegistry(),\n\t\tgeneratorDescriptors: createSqliteMutationDefaultGeneratorDescriptors()\n\t},\n\tcreate(stack) {\n\t\treturn new SqliteControlAdapter(assembleSqliteCodecRegistry(stack.target, stack.extensions));\n\t}\n};\n//#endregion\nexport { SqliteControlAdapter, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins, sqliteAdapterDescriptor as default, escapeLiteral, normalizeSqliteNativeType, parseSqliteDefault, quoteIdentifier };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,0BAA0B,OAAO;CACzC,OAAO;EACN,IAAI;EACJ,YAAY;GACX,MAAM;GACN,SAAS,MAAM;GACf,UAAU,MAAM,QAAQ;GACxB,MAAM,MAAM;EACb;CACD;AACD;AACA,SAAS,mBAAmB,IAAI,QAAQ;CACvC,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,WAAW;IACV,MAAM;IACN;IACA,GAAG,SAAS,EAAE,OAAO,IAAI,CAAC;GAC3B;EACD;CACD;AACD;;;;;;;;;;AAUA,MAAM,+BAA+B,IAAI,IAAI;CAC5C;CACA;CACA;CACA;AACD,CAAC;AACD,SAAS,qBAAqB;CAC7B,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,cAAc;IACb,MAAM;IACN,YAAY;GACb;EACD;CACD;AACD;AACA,SAAS,WAAW;CACnB,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,cAAc;IACb,MAAM;IACN,YAAY;GACb;EACD;CACD;AACD;AACA,SAAS,YAAY;CACpB,OAAO,mBAAmB,MAAM;AACjC;AACA,SAAS,UAAU,OAAO;CACzB,OAAO,MAAM,KAAK,KAAK,eAAe,IAAI,mBAAmB,QAAQ,IAAI,mBAAmB,QAAQ;AACrG;AACA,SAAS,YAAY;CACpB,OAAO,mBAAmB,OAAO;AAClC;AACA,SAAS,YAAY,OAAO;CAC3B,MAAM,OAAO,MAAM,KAAK,KAAK;CAC7B,OAAO,OAAO,SAAS,WAAW,mBAAmB,UAAU,EAAE,KAAK,CAAC,IAAI,mBAAmB,QAAQ;AACvG;AACA,SAAS,iBAAiB,OAAO;CACh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
import { a as sqliteCodecDescriptorRegistry } from "./codecs-TyM6tD3U.mjs";
|
|
2
|
-
import { c as sqliteRawCodecInferer, i as createSqliteAdapterWithCodecRegistry, n as assembleSqliteCodecRegistry } from "./adapter-
|
|
2
|
+
import { c as sqliteRawCodecInferer, i as createSqliteAdapterWithCodecRegistry, n as assembleSqliteCodecRegistry } from "./adapter-BHzKEzqw-CPUu2tBl.mjs";
|
|
3
3
|
import { t as sqliteAdapterDescriptorMeta } from "./descriptor-meta-DjKgG4z5-BAKSkr1j.mjs";
|
|
4
4
|
import { builtinGeneratorIds } from "@prisma/orm-framework/ids";
|
|
5
5
|
import { timestampNowRuntimeGenerator } from "@prisma/orm-family-sql/family/runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/runtime.mjs"],"sourcesContent":["import { i as sqliteRawCodecInferer, n as createSqliteAdapterWithCodecRegistry, o as assembleSqliteCodecRegistry } from \"./adapter-
|
|
1
|
+
{"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/runtime.mjs"],"sourcesContent":["import { i as sqliteRawCodecInferer, n as createSqliteAdapterWithCodecRegistry, o as assembleSqliteCodecRegistry } from \"./adapter-BHzKEzqw.mjs\";\nimport { t as sqliteAdapterDescriptorMeta } from \"./descriptor-meta-DjKgG4z5.mjs\";\nimport { sqliteCodecDescriptorRegistry } from \"@internal/target-sqlite/codecs\";\nimport { builtinGeneratorIds } from \"@internal/ids\";\nimport { timestampNowRuntimeGenerator } from \"@internal/family-sql/runtime\";\nimport { generateId } from \"@internal/ids/runtime\";\n//#region src/core/runtime-adapter.ts\nfunction createSqliteMutationDefaultGenerators() {\n\treturn [...builtinGeneratorIds.map((id) => ({\n\t\tid,\n\t\tgenerate: (params) => {\n\t\t\treturn generateId(params ? {\n\t\t\t\tid,\n\t\t\t\tparams\n\t\t\t} : { id });\n\t\t},\n\t\tstability: \"field\"\n\t})), timestampNowRuntimeGenerator()];\n}\nconst sqliteRuntimeAdapterDescriptor = {\n\t...sqliteAdapterDescriptorMeta,\n\tcodecs: () => Array.from(sqliteCodecDescriptorRegistry.values()),\n\tmutationDefaultGenerators: createSqliteMutationDefaultGenerators,\n\trawCodecInferer: sqliteRawCodecInferer,\n\tcreate(stack) {\n\t\treturn createSqliteAdapterWithCodecRegistry(assembleSqliteCodecRegistry(stack.target, stack.extensions));\n\t}\n};\n//#endregion\nexport { sqliteRuntimeAdapterDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,wCAAwC;CAChD,OAAO,CAAC,GAAG,oBAAoB,KAAK,QAAQ;EAC3C;EACA,WAAW,WAAW;GACrB,OAAO,WAAW,SAAS;IAC1B;IACA;GACD,IAAI,EAAE,GAAG,CAAC;EACX;EACA,WAAW;CACZ,EAAE,GAAG,6BAA6B,CAAC;AACpC;AACA,MAAM,iCAAiC;CACtC,GAAG;CACH,cAAc,MAAM,KAAK,8BAA8B,OAAO,CAAC;CAC/D,2BAA2B;CAC3B,iBAAiB;CACjB,OAAO,OAAO;EACb,OAAO,qCAAqC,4BAA4B,MAAM,QAAQ,MAAM,UAAU,CAAC;CACxG;AACD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { s as renderLoweredSql } from "./adapter-
|
|
1
|
+
import { s as renderLoweredSql } from "./adapter-BHzKEzqw-CPUu2tBl.mjs";
|
|
2
2
|
export { renderLoweredSql };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as buildTargetDetails } from "./planner-target-details-CIQ789Gc-C5U4yVY9.mjs";
|
|
2
|
-
import { h as step } from "./op-factory-call-
|
|
2
|
+
import { h as step } from "./op-factory-call-DPooV70K-CHz16zs8.mjs";
|
|
3
3
|
import { col as col$1, fn as fn$1, foreignKey, lit as lit$1, primaryKey, unique } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
4
4
|
import { placeholder } from "@prisma/orm-framework/errors/migration";
|
|
5
5
|
import { MigrationCLI } from "@prisma/orm-toolchain/cli/migration-cli";
|
|
@@ -44,4 +44,4 @@ function rawSql(op) {
|
|
|
44
44
|
//#endregion
|
|
45
45
|
export { foreignKey as a, primaryKey as c, fn$1 as i, rawSql as l, col$1 as n, lit$1 as o, dataTransform as r, placeholder as s, MigrationCLI as t, unique as u };
|
|
46
46
|
|
|
47
|
-
//# sourceMappingURL=migration-
|
|
47
|
+
//# sourceMappingURL=migration-BxcJYyhH.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-
|
|
1
|
+
{"version":3,"file":"migration-BxcJYyhH.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/migration.mjs"],"sourcesContent":["import { f as step } from \"./op-factory-call-DPooV70K.mjs\";\nimport { t as buildTargetDetails } from \"./planner-target-details-CIQ789Gc.mjs\";\nimport { t as SqliteMigration } from \"./sqlite-migration-BNwiY-Um.mjs\";\nimport { placeholder } from \"@internal/errors/migration\";\nimport { col, fn, foreignKey, lit, primaryKey, unique } from \"@internal/sql-relational-core/contract-free\";\nimport { MigrationCLI } from \"@internal/cli/migration-cli\";\n//#region src/core/migrations/operations/data-transform.ts\n/**\n* User-facing `dataTransform` factory for the SQLite migration authoring\n* surface. Invoked directly inside a `migration.ts` file to supply a\n* user-authored SQL statement that runs with operation class `'data'`.\n*\n* Typical use: the planner emits a `DataTransformCall` stub when a NOT NULL\n* tightening requires a backfill. The rendered `migration.ts` exposes the\n* backfill as a `placeholder(\"…\")` slot the user fills in with an\n* `UPDATE … WHERE col IS NULL` statement. The filled-in `dataTransform(...)`\n* invocation returns a runnable operation the runner executes before the\n* subsequent recreate-table op copies data into the tightened schema.\n*/\nfunction dataTransform(opts) {\n\treturn {\n\t\tid: opts.id,\n\t\tlabel: opts.label,\n\t\tsummary: opts.description,\n\t\toperationClass: \"data\",\n\t\ttarget: {\n\t\t\tid: \"sqlite\",\n\t\t\tdetails: buildTargetDetails(\"table\", opts.table)\n\t\t},\n\t\tprecheck: [],\n\t\texecute: [step(opts.description, opts.run())],\n\t\tpostcheck: []\n\t};\n}\n//#endregion\n//#region src/core/migrations/operations/raw.ts\n/**\n* Identity factory for an already-materialized\n* `SqlMigrationPlanOperation<SqlitePlanTargetDetails>`. Mirrors the Postgres\n* `rawSql` factory: the planner uses this to carry ops produced by SQL-family\n* paths (codec lifecycle hooks, raw-SQL escape hatches) alongside structured\n* call IR without reverse-engineering their shape.\n*/\nfunction rawSql(op) {\n\treturn op;\n}\n//#endregion\nexport { SqliteMigration as Migration, MigrationCLI, col, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, unique };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,SAAS,cAAc,MAAM;CAC5B,OAAO;EACN,IAAI,KAAK;EACT,OAAO,KAAK;EACZ,SAAS,KAAK;EACd,gBAAgB;EAChB,QAAQ;GACP,IAAI;GACJ,SAAS,mBAAmB,SAAS,KAAK,KAAK;EAChD;EACA,UAAU,CAAC;EACX,SAAS,CAAC,KAAK,KAAK,aAAa,KAAK,IAAI,CAAC,CAAC;EAC5C,WAAW,CAAC;CACb;AACD;;;;;;;;AAUA,SAAS,OAAO,IAAI;CACnB,OAAO;AACR"}
|
package/dist/{op-factory-call-CsNFRTPS-HuMdWaBX.mjs → op-factory-call-DPooV70K-CHz16zs8.mjs}
RENAMED
|
@@ -10,7 +10,7 @@ import { RelationalSchemaNodeKind } from "@prisma/orm-family-sql/schema-ir/types
|
|
|
10
10
|
import { errorUnfilledPlaceholder } from "@prisma/orm-framework/errors/migration";
|
|
11
11
|
import { TsExpression, jsonToTsSource } from "@prisma/orm-framework/ts-render";
|
|
12
12
|
import { REFERENTIAL_ACTION_SQL } from "@prisma/orm-family-sql/contract/referential-action-sql";
|
|
13
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/op-factory-call-
|
|
13
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/op-factory-call-DPooV70K.mjs
|
|
14
14
|
const SAFE_NATIVE_TYPE_PATTERN = /^[a-zA-Z][a-zA-Z0-9_ ]*$/;
|
|
15
15
|
function assertSafeNativeType(nativeType) {
|
|
16
16
|
if (!SAFE_NATIVE_TYPE_PATTERN.test(nativeType)) throw sqliteError("CONTRACT.NATIVE_TYPE_INVALID", `Unsafe native type name in contract: "${nativeType}". Native type names must match /^[a-zA-Z][a-zA-Z0-9_ ]*\$/`, { meta: { nativeType } });
|
|
@@ -382,7 +382,7 @@ function renderDdlConstraintAsTsCall(constraint) {
|
|
|
382
382
|
const nameOpt = constraint.name ? `, { name: ${jsonToTsSource(constraint.name)} }` : "";
|
|
383
383
|
return `unique(${jsonToTsSource(constraint.columns)}${nameOpt})`;
|
|
384
384
|
}
|
|
385
|
-
case "check-expression": throw sqliteError("CONTRACT.CONSTRAINT_INVALID", `SQLite does not support
|
|
385
|
+
case "check-expression": throw sqliteError("CONTRACT.CONSTRAINT_INVALID", `The SQLite target does not support CHECK constraints (constraint "${constraint.name}"). The "checkConstraint" capability is Postgres-only — remove the "@@check" / "check()" declaration, or target Postgres.`, { meta: { constraintName: constraint.name } });
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
function constraintImportSymbols(constraints) {
|
|
@@ -826,4 +826,4 @@ var RawSqlCall = class extends SqliteOpFactoryCallNode {
|
|
|
826
826
|
//#endregion
|
|
827
827
|
export { DropColumnCall as a, RawSqlCall as c, buildColumnTypeSql as d, buildRecreatePostchecks as f, step as h, DataTransformCall as i, RecreateTableCall as l, renderDefaultLiteral as m, CreateIndexCall as n, DropIndexCall as o, buildRecreateSummary as p, CreateTableCall as r, DropTableCall as s, AddColumnCall as t, buildColumnDefaultSql as u };
|
|
828
828
|
|
|
829
|
-
//# sourceMappingURL=op-factory-call-
|
|
829
|
+
//# sourceMappingURL=op-factory-call-DPooV70K-CHz16zs8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"op-factory-call-DPooV70K-CHz16zs8.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/op-factory-call-DPooV70K.mjs"],"sourcesContent":["import { n as sqliteError } from \"./errors-CKsaaSnD.mjs\";\nimport { n as quoteIdentifier, t as escapeLiteral } from \"./sql-utils-DqPXZBMA.mjs\";\nimport { i as tableExistsAst, n as columnExistsAst, r as indexExistsAst, t as createTable } from \"./ddl-CXduXyOT.mjs\";\nimport { t as buildTargetDetails } from \"./planner-target-details-CIQ789Gc.mjs\";\nimport { n as stripOuterParens } from \"./default-normalizer-DuoHj9-O.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { RelationalSchemaNodeKind } from \"@internal/sql-schema-ir/types\";\nimport { issueOutcome } from \"@internal/framework-components/control\";\nimport { errorUnfilledPlaceholder } from \"@internal/errors/migration\";\nimport { TsExpression, jsonToTsSource } from \"@internal/ts-render\";\nimport { REFERENTIAL_ACTION_SQL } from \"@internal/sql-contract/referential-action-sql\";\n//#region src/core/migrations/planner-ddl-builders.ts\nconst SAFE_NATIVE_TYPE_PATTERN = /^[a-zA-Z][a-zA-Z0-9_ ]*$/;\nfunction assertSafeNativeType(nativeType) {\n\tif (!SAFE_NATIVE_TYPE_PATTERN.test(nativeType)) throw sqliteError(\"CONTRACT.NATIVE_TYPE_INVALID\", `Unsafe native type name in contract: \"${nativeType}\". Native type names must match /^[a-zA-Z][a-zA-Z0-9_ ]*\\$/`, { meta: { nativeType } });\n}\nfunction assertSafeDefaultExpression(expression) {\n\tif (expression.includes(\";\") || /--|\\/\\*|\\bSELECT\\b/i.test(expression)) throw sqliteError(\"CONTRACT.DEFAULT_INVALID\", `Unsafe default expression in contract: \"${expression}\". Default expressions must not contain semicolons, SQL comment tokens, or subqueries.`, { meta: { expression } });\n}\n/**\n* Renders the column's DDL type token (e.g. `\"INTEGER\"`, `\"TEXT\"`).\n* Resolves `typeRef` against `storageTypes` and validates the resulting\n* native type against a safe-identifier pattern.\n*/\nfunction buildColumnTypeSql(column, storageTypes = {}) {\n\tconst resolved = resolveColumnTypeMetadata(column, storageTypes);\n\tassertSafeNativeType(resolved.nativeType);\n\treturn resolved.nativeType.toUpperCase();\n}\n/**\n* Renders the column's `DEFAULT …` clause. Returns the empty string when\n* there is no default, and also when the default is `autoincrement()` —\n* SQLite encodes that as `INTEGER PRIMARY KEY AUTOINCREMENT` inline on the\n* column definition, not as a separate DEFAULT.\n*/\nfunction buildColumnDefaultSql(columnDefault) {\n\tif (!columnDefault) return \"\";\n\tswitch (columnDefault.kind) {\n\t\tcase \"literal\": return `DEFAULT ${renderDefaultLiteral(columnDefault.value)}`;\n\t\tcase \"function\":\n\t\t\tif (columnDefault.expression === \"autoincrement()\") return \"\";\n\t\t\tif (columnDefault.expression === \"now()\") return \"DEFAULT (datetime('now'))\";\n\t\t\tassertSafeDefaultExpression(columnDefault.expression);\n\t\t\treturn `DEFAULT (${columnDefault.expression})`;\n\t}\n}\nfunction renderDefaultLiteral(value) {\n\tif (value instanceof Date) return `'${escapeLiteral(value.toISOString())}'`;\n\tif (typeof value === \"string\") return `'${escapeLiteral(value)}'`;\n\tif (typeof value === \"number\" || typeof value === \"bigint\") return String(value);\n\tif (typeof value === \"boolean\") return value ? \"1\" : \"0\";\n\tif (value === null) return \"NULL\";\n\treturn `'${escapeLiteral(JSON.stringify(value))}'`;\n}\nfunction buildCreateIndexSql(tableName, indexName, columns, unique = false) {\n\treturn `CREATE ${unique ? \"UNIQUE \" : \"\"}INDEX ${quoteIdentifier(indexName)} ON ${quoteIdentifier(tableName)} (${columns.map(quoteIdentifier).join(\", \")})`;\n}\nfunction buildDropIndexSql(indexName) {\n\treturn `DROP INDEX IF EXISTS ${quoteIdentifier(indexName)}`;\n}\nfunction resolveColumnTypeMetadata(column, storageTypes) {\n\tif (!column.typeRef) return column;\n\tconst referencedType = storageTypes[column.typeRef];\n\tif (!referencedType) throw sqliteError(\"CONTRACT.TYPE_UNKNOWN\", `Storage type \"${column.typeRef}\" referenced by column is not defined in storage.types.`, { meta: { typeRef: column.typeRef } });\n\treturn {\n\t\tcodecId: referencedType.codecId,\n\t\tnativeType: referencedType.nativeType,\n\t\ttypeParams: referencedType.typeParams\n\t};\n}\n//#endregion\n//#region src/core/migrations/operations/shared.ts\nfunction step(description, sql, params) {\n\treturn {\n\t\tdescription,\n\t\tsql,\n\t\t...ifDefined(\"params\", params)\n\t};\n}\n/**\n* Renders a single column's inline DDL fragment within a `CREATE TABLE`\n* statement. Honours the `inlineAutoincrementPrimaryKey` flag — SQLite\n* treats `INTEGER PRIMARY KEY AUTOINCREMENT` as a special form that aliases\n* `rowid`, and the column must not carry a `DEFAULT` or repeat `NOT NULL`.\n*/\nfunction renderColumnDefinition(column) {\n\tconst parts = [quoteIdentifier(column.name), column.typeSql];\n\tif (column.inlineAutoincrementPrimaryKey) parts.push(\"PRIMARY KEY AUTOINCREMENT\");\n\telse {\n\t\tif (column.defaultSql) parts.push(column.defaultSql);\n\t\tif (!column.nullable) parts.push(\"NOT NULL\");\n\t}\n\treturn parts.join(\" \");\n}\n/**\n* Renders an inline FOREIGN KEY constraint clause for a `CREATE TABLE`\n* body. Every `SqliteForeignKeySpec` is constraint-bearing by construction\n* (`tableSpecFromNode` only ever builds specs from schema-IR FK nodes, which\n* are themselves constraint-only — a non-constraint FK contributes no node).\n*/\nfunction renderForeignKeyClause(fk) {\n\tlet sql = `${fk.name ? `CONSTRAINT ${quoteIdentifier(fk.name)} ` : \"\"}FOREIGN KEY (${fk.columns.map(quoteIdentifier).join(\", \")}) REFERENCES ${quoteIdentifier(fk.references.table)} (${fk.references.columns.map(quoteIdentifier).join(\", \")})`;\n\tif (fk.onDelete !== void 0) sql += ` ON DELETE ${REFERENTIAL_ACTION_SQL[fk.onDelete]}`;\n\tif (fk.onUpdate !== void 0) sql += ` ON UPDATE ${REFERENTIAL_ACTION_SQL[fk.onUpdate]}`;\n\treturn sql;\n}\n//#endregion\n//#region src/core/migrations/operations/columns.ts\nfunction addColumnExecuteSql(tableName, column) {\n\treturn [\n\t\t`ALTER TABLE ${quoteIdentifier(tableName)}`,\n\t\t`ADD COLUMN ${quoteIdentifier(column.name)} ${column.typeSql}`,\n\t\tcolumn.defaultSql,\n\t\tcolumn.nullable ? \"\" : \"NOT NULL\"\n\t].filter(Boolean).join(\" \");\n}\nfunction dropColumnExecuteSql(tableName, columnName) {\n\treturn `ALTER TABLE ${quoteIdentifier(tableName)} DROP COLUMN ${quoteIdentifier(columnName)}`;\n}\n//#endregion\n//#region src/core/migrations/operations/tables.ts\nasync function tableExistsSteps(lowerer, tableName) {\n\tconst checks = tableExistsAst(tableName);\n\treturn {\n\t\tpresent: await lowerer.lowerToExecuteRequest(checks.tablePresent()),\n\t\tabsent: await lowerer.lowerToExecuteRequest(checks.tableAbsent())\n\t};\n}\n/**\n* Renders the body of a `CREATE TABLE <name> ( … )` statement from a flat\n* `SqliteTableSpec`. SQLite's `INTEGER PRIMARY KEY AUTOINCREMENT` form is\n* inline on the column; the table-level PRIMARY KEY clause is emitted only\n* when no column carries `inlineAutoincrementPrimaryKey`.\n*/\nfunction renderCreateTableSql(tableName, spec) {\n\tconst columnDefs = spec.columns.map(renderColumnDefinition);\n\tconst constraintDefs = [];\n\tconst hasInlinePk = spec.columns.some((c) => c.inlineAutoincrementPrimaryKey);\n\tif (spec.primaryKey && !hasInlinePk) constraintDefs.push(`PRIMARY KEY (${spec.primaryKey.columns.map(quoteIdentifier).join(\", \")})`);\n\tfor (const u of spec.uniques ?? []) {\n\t\tconst name = u.name ? `CONSTRAINT ${quoteIdentifier(u.name)} ` : \"\";\n\t\tconstraintDefs.push(`${name}UNIQUE (${u.columns.map(quoteIdentifier).join(\", \")})`);\n\t}\n\tfor (const fk of spec.foreignKeys ?? []) {\n\t\tconst clause = renderForeignKeyClause(fk);\n\t\tif (clause) constraintDefs.push(clause);\n\t}\n\tconst allDefs = [...columnDefs, ...constraintDefs];\n\treturn `CREATE TABLE ${quoteIdentifier(tableName)} (\\n ${allDefs.join(\",\\n \")}\\n)`;\n}\nasync function recreateTable(args, lowerer) {\n\tconst { tableName, contractTable, schemaColumnNames, indexes, summary, postchecks, operationClass } = args;\n\tconst tempName = `_prisma_new_${tableName}`;\n\tconst liveSet = new Set(schemaColumnNames);\n\tconst sharedColumns = contractTable.columns.filter((c) => liveSet.has(c.name)).map((c) => c.name);\n\tconst columnList = sharedColumns.map(quoteIdentifier).join(\", \");\n\tconst indexStatements = indexes.map((idx) => ({\n\t\tdescription: `recreate index \"${idx.name}\" on \"${tableName}\"`,\n\t\tsql: buildCreateIndexSql(tableName, idx.name, idx.columns)\n\t}));\n\tconst copyStep = sharedColumns.length > 0 ? [step(`copy data from \"${tableName}\" to \"${tempName}\"`, `INSERT INTO ${quoteIdentifier(tempName)} (${columnList}) SELECT ${columnList} FROM ${quoteIdentifier(tableName)}`)] : [];\n\tconst tableSteps = await tableExistsSteps(lowerer, tableName);\n\tconst tempSteps = await tableExistsSteps(lowerer, tempName);\n\treturn {\n\t\tid: `recreateTable.${tableName}`,\n\t\tlabel: `Recreate table ${tableName}`,\n\t\tsummary,\n\t\toperationClass,\n\t\ttarget: {\n\t\t\tid: \"sqlite\",\n\t\t\tdetails: buildTargetDetails(\"table\", tableName)\n\t\t},\n\t\tprecheck: [step(`ensure table \"${tableName}\" exists`, tableSteps.present.sql, tableSteps.present.params), step(`ensure temp table \"${tempName}\" does not exist`, tempSteps.absent.sql, tempSteps.absent.params)],\n\t\texecute: [\n\t\t\tstep(`create new table \"${tempName}\" with desired schema`, renderCreateTableSql(tempName, contractTable)),\n\t\t\t...copyStep,\n\t\t\tstep(`drop old table \"${tableName}\"`, `DROP TABLE ${quoteIdentifier(tableName)}`),\n\t\t\tstep(`rename \"${tempName}\" to \"${tableName}\"`, `ALTER TABLE ${quoteIdentifier(tempName)} RENAME TO ${quoteIdentifier(tableName)}`),\n\t\t\t...indexStatements\n\t\t],\n\t\tpostcheck: [\n\t\t\tstep(`verify table \"${tableName}\" exists`, tableSteps.present.sql, tableSteps.present.params),\n\t\t\tstep(`verify temp table \"${tempName}\" is gone`, tempSteps.absent.sql, tempSteps.absent.params),\n\t\t\t...postchecks\n\t\t]\n\t};\n}\n/**\n* Build a one-line summary of a recreate-table operation from the schema-diff\n* issues that triggered it. Lives next to `recreateTable` so the planner\n* (which has the issues) can produce the same description the factory\n* used to build inline. Keeping the formatting target-side keeps\n* `RecreateTableCall` issue-free at the IR layer. `SchemaDiffIssue` carries\n* no rendered message, so this renders one from each issue's path.\n*/\nfunction buildRecreateSummary(tableName, issues) {\n\treturn `Recreates table ${tableName} to apply schema changes: ${issues.map((i) => i.path.join(\"/\")).join(\"; \")}`;\n}\nfunction nodeKindOf(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node).nodeKind;\n}\n/** Mirrors `SqlColumnIR.isEqualTo`'s type comparison, isolated so a `not-equal` column issue's postcheck can target type drift and nullability drift independently. */\nfunction columnTypeChanged(expected, actual) {\n\tif (expected.resolvedNativeType !== void 0 && actual.resolvedNativeType !== void 0) return expected.resolvedNativeType !== actual.resolvedNativeType;\n\treturn expected.nativeType !== actual.nativeType || Boolean(expected.many) !== Boolean(actual.many);\n}\n/**\n* Returns the columns the contract expects as the table's primary key. Picks\n* up SQLite's inline `INTEGER PRIMARY KEY AUTOINCREMENT` form when no\n* explicit `primaryKey` clause is set on the spec.\n*/\nfunction expectedPrimaryKeyColumns(spec) {\n\tif (spec.primaryKey) return spec.primaryKey.columns;\n\tconst inlinePk = spec.columns.find((c) => c.inlineAutoincrementPrimaryKey);\n\treturn inlinePk ? [inlinePk.name] : [];\n}\nfunction quoteSqlList(values) {\n\treturn values.map((v) => `'${escapeLiteral(v)}'`).join(\", \");\n}\nfunction columnNameFromNode(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\tif (node === void 0) return void 0;\n\treturn blindCast(node).name;\n}\n/**\n* A column-default issue's own node has no back-reference to its owning\n* column — it's a transient child built by `SqlColumnIR.children()`. The\n* column's id (`column:<name>`) is always the diff path's second-to-last\n* segment for a default issue (`[..., tableId, columnId, 'default']`), so\n* the name is recovered from the path rather than the node.\n*/\nfunction columnNameFromDefaultIssuePath(issue) {\n\tconst columnId = issue.path[issue.path.length - 2];\n\tif (columnId === void 0) return void 0;\n\treturn columnId.startsWith(\"column:\") ? columnId.slice(7) : columnId;\n}\n/**\n* Per-issue postchecks verifying the recreated table's shape against the\n* expected spec. Column-level issues (`sql-column` `not-equal`,\n* `sql-column-default` any reason) emit one targeted check each;\n* constraint-level issues (`sql-primary-key`, `sql-unique`, `sql-foreign-key`,\n* any reason) emit one `pragma_*`-driven check per declared constraint in the\n* expected spec, so a recreated table with the right columns but the wrong\n* PK / unique / FK shape fails the postcheck instead of passing silently.\n* Exported so the planner can pre-build the list at construction time and\n* `RecreateTableCall` doesn't have to carry `SchemaDiffIssue` objects through\n* to render time.\n*/\nfunction buildRecreatePostchecks(tableName, issues, spec) {\n\tconst checks = [];\n\tconst t = escapeLiteral(tableName);\n\tconst byName = new Map(spec.columns.map((c) => [c.name, c]));\n\tlet hasPkIssue = false;\n\tlet hasUniqueIssue = false;\n\tlet hasFkIssue = false;\n\tfor (const issue of issues) {\n\t\tconst nodeKind = nodeKindOf(issue);\n\t\tif (nodeKind === RelationalSchemaNodeKind.column && issueOutcome(issue) === \"not-equal\") {\n\t\t\tconst columnName = columnNameFromNode(issue);\n\t\t\tif (columnName === void 0) continue;\n\t\t\tconst c = escapeLiteral(columnName);\n\t\t\tconst expected = blindCast(issue.expected);\n\t\t\tconst actual = blindCast(issue.actual);\n\t\t\tif (expected.nullable !== actual.nullable) checks.push({\n\t\t\t\tdescription: `verify \"${columnName}\" nullability on \"${tableName}\"`,\n\t\t\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info('${t}') WHERE name = '${c}' AND \"notnull\" = ${expected.nullable ? 0 : 1}`\n\t\t\t});\n\t\t\tif (columnTypeChanged(expected, actual)) {\n\t\t\t\tconst colSpec = byName.get(columnName);\n\t\t\t\tif (colSpec) checks.push({\n\t\t\t\t\tdescription: `verify \"${columnName}\" type on \"${tableName}\"`,\n\t\t\t\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info('${t}') WHERE name = '${c}' AND LOWER(type) = '${escapeLiteral(colSpec.typeSql.toLowerCase())}'`\n\t\t\t\t});\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tif (nodeKind === RelationalSchemaNodeKind.columnDefault) {\n\t\t\tconst columnName = columnNameFromDefaultIssuePath(issue);\n\t\t\tif (columnName === void 0) continue;\n\t\t\tconst c = escapeLiteral(columnName);\n\t\t\tif (issueOutcome(issue) === \"not-expected\") {\n\t\t\t\tchecks.push({\n\t\t\t\t\tdescription: `verify \"${columnName}\" has no default on \"${tableName}\"`,\n\t\t\t\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info('${t}') WHERE name = '${c}' AND dflt_value IS NULL`\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst colSpec = byName.get(columnName);\n\t\t\tconst expectedRaw = colSpec?.defaultSql.startsWith(\"DEFAULT \") ? stripOuterParens(colSpec.defaultSql.slice(8)) : null;\n\t\t\tif (expectedRaw) checks.push({\n\t\t\t\tdescription: `verify \"${columnName}\" default on \"${tableName}\"`,\n\t\t\t\tsql: `SELECT COUNT(*) > 0 FROM pragma_table_info('${t}') WHERE name = '${c}' AND dflt_value = '${escapeLiteral(expectedRaw)}'`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (nodeKind === RelationalSchemaNodeKind.primaryKey) hasPkIssue = true;\n\t\tif (nodeKind === RelationalSchemaNodeKind.unique) hasUniqueIssue = true;\n\t\tif (nodeKind === RelationalSchemaNodeKind.foreignKey) hasFkIssue = true;\n\t}\n\tif (hasPkIssue) {\n\t\tconst pkColumns = expectedPrimaryKeyColumns(spec);\n\t\tconst colCount = pkColumns.length;\n\t\tif (colCount === 0) checks.push({\n\t\t\tdescription: `verify \"${tableName}\" has no primary key`,\n\t\t\tsql: `SELECT (SELECT COUNT(*) FROM pragma_table_info('${t}') WHERE pk > 0) = 0`\n\t\t});\n\t\telse checks.push({\n\t\t\tdescription: `verify primary key on \"${tableName}\"`,\n\t\t\tsql: `SELECT (SELECT COUNT(*) FROM pragma_table_info('${t}') WHERE pk > 0) = ${colCount} AND (SELECT COUNT(*) FROM pragma_table_info('${t}') WHERE pk > 0 AND name IN (${quoteSqlList(pkColumns)})) = ${colCount}`\n\t\t});\n\t}\n\tif (hasUniqueIssue) for (const u of spec.uniques ?? []) {\n\t\tconst colCount = u.columns.length;\n\t\tconst description = u.name ? `verify unique constraint \"${u.name}\" on \"${tableName}\"` : `verify unique constraint (${u.columns.join(\", \")}) on \"${tableName}\"`;\n\t\tchecks.push({\n\t\t\tdescription,\n\t\t\tsql: `SELECT EXISTS (SELECT 1 FROM pragma_index_list('${t}') l WHERE l.\"unique\" = 1 AND (SELECT COUNT(*) FROM pragma_index_info(l.name)) = ${colCount} AND (SELECT COUNT(*) FROM pragma_index_info(l.name) WHERE name IN (${quoteSqlList(u.columns)})) = ${colCount})`\n\t\t});\n\t}\n\tif (hasFkIssue) for (const fk of spec.foreignKeys ?? []) {\n\t\tconst refTable = escapeLiteral(fk.references.table);\n\t\tconst colCount = fk.columns.length;\n\t\tconst tuples = fk.columns.map((from, i) => {\n\t\t\tconst to = fk.references.columns[i] ?? from;\n\t\t\treturn `('${escapeLiteral(from)}', '${escapeLiteral(to)}')`;\n\t\t}).join(\", \");\n\t\tconst description = `verify foreign key (${fk.columns.join(\", \")}) → ${fk.references.table}(${fk.references.columns.join(\", \")}) on \"${tableName}\"`;\n\t\tchecks.push({\n\t\t\tdescription,\n\t\t\tsql: `SELECT EXISTS (SELECT 1 FROM pragma_foreign_key_list('${t}') f WHERE f.\"table\" = '${refTable}' GROUP BY f.id HAVING COUNT(*) = ${colCount} AND SUM(CASE WHEN (f.\"from\", f.\"to\") IN (${tuples}) THEN 1 ELSE 0 END) = ${colCount})`\n\t\t});\n\t}\n\treturn checks;\n}\n//#endregion\n//#region src/core/migrations/op-factory-call.ts\n/**\n* SQLite migration IR: one concrete `*Call` class per pure factory under\n* `operations/`, plus a shared `SqliteOpFactoryCallNode` abstract base.\n*\n* Each call class carries fully-resolved literal arguments. `CreateTableCall`\n* holds structured `DdlColumn[]` + `DdlTableConstraint[]` and lowers via the\n* adapter's DDL path; other call classes carry flat SQL fragments. Codec /\n* `typeRef` / default expansion happens upstream in the issue-planner /\n* strategies, mirroring the Postgres `ColumnSpec` pattern.\n*/\nconst TARGET_MIGRATION_MODULE = \"@internal/sqlite/migration\";\nvar SqliteOpFactoryCallNode = class extends TsExpression {\n\timportRequirements() {\n\t\treturn [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: this.factoryName\n\t\t}];\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\nfunction renderDdlColumnDefault(def) {\n\tif (!def) return \"\";\n\tif (def.kind === \"literal\") return `lit(${jsonToTsSource(def.value)})`;\n\treturn `fn(${jsonToTsSource(def.expression)})`;\n}\nfunction renderDdlColumnAsTsCall(column) {\n\tconst opts = [];\n\tif (column.notNull) opts.push(\"notNull: true\");\n\tif (column.primaryKey) opts.push(\"primaryKey: true\");\n\tif (column.default) opts.push(`default: ${renderDdlColumnDefault(column.default)}`);\n\tconst optsStr = opts.length > 0 ? `, { ${opts.join(\", \")} }` : \"\";\n\treturn `col(${jsonToTsSource(column.name)}, ${jsonToTsSource(column.type)}${optsStr})`;\n}\nfunction renderDdlConstraintAsTsCall(constraint) {\n\tswitch (constraint.kind) {\n\t\tcase \"primary-key\": {\n\t\t\tconst nameOpt = constraint.name ? `, { name: ${jsonToTsSource(constraint.name)} }` : \"\";\n\t\t\treturn `primaryKey(${jsonToTsSource(constraint.columns)}${nameOpt})`;\n\t\t}\n\t\tcase \"foreign-key\": {\n\t\t\tconst opts = [];\n\t\t\tif (constraint.name) opts.push(`name: ${jsonToTsSource(constraint.name)}`);\n\t\t\tif (constraint.onDelete) opts.push(`onDelete: ${jsonToTsSource(constraint.onDelete)}`);\n\t\t\tif (constraint.onUpdate) opts.push(`onUpdate: ${jsonToTsSource(constraint.onUpdate)}`);\n\t\t\tconst optsStr = opts.length > 0 ? `, { ${opts.join(\", \")} }` : \"\";\n\t\t\treturn `foreignKey(${jsonToTsSource(constraint.columns)}, ${jsonToTsSource(constraint.refTable)}, ${jsonToTsSource(constraint.refColumns)}${optsStr})`;\n\t\t}\n\t\tcase \"unique\": {\n\t\t\tconst nameOpt = constraint.name ? `, { name: ${jsonToTsSource(constraint.name)} }` : \"\";\n\t\t\treturn `unique(${jsonToTsSource(constraint.columns)}${nameOpt})`;\n\t\t}\n\t\tcase \"check-expression\": throw sqliteError(\"CONTRACT.CONSTRAINT_INVALID\", `The SQLite target does not support CHECK constraints (constraint \"${constraint.name}\"). The \"checkConstraint\" capability is Postgres-only — remove the \"@@check\" / \"check()\" declaration, or target Postgres.`, { meta: { constraintName: constraint.name } });\n\t}\n}\nfunction constraintImportSymbols(constraints) {\n\tif (!constraints || constraints.length === 0) return [];\n\tconst symbols = /* @__PURE__ */ new Set();\n\tfor (const c of constraints) if (c.kind === \"primary-key\") symbols.add(\"primaryKey\");\n\telse if (c.kind === \"foreign-key\") symbols.add(\"foreignKey\");\n\telse if (c.kind === \"unique\") symbols.add(\"unique\");\n\treturn [...symbols];\n}\nfunction defaultImportSymbols(columns) {\n\tconst symbols = /* @__PURE__ */ new Set();\n\tfor (const col of columns) if (col.default?.kind === \"literal\") symbols.add(\"lit\");\n\telse if (col.default?.kind === \"function\") symbols.add(\"fn\");\n\treturn [...symbols];\n}\nvar CreateTableCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"createTable\";\n\toperationClass = \"additive\";\n\ttableName;\n\tcolumns;\n\tconstraints;\n\tlabel;\n\tconstructor(tableName, columns, constraints) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.columns = Object.freeze([...columns]);\n\t\tthis.constraints = constraints ? Object.freeze([...constraints]) : void 0;\n\t\tthis.label = `Create table ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `CreateTableCall.toOp: a DDL lowerer is required on the SQLite planner path (table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName\n\t\t} });\n\t\tconst ddlNode = createTable({\n\t\t\ttable: this.tableName,\n\t\t\tcolumns: this.columns,\n\t\t\t...ifDefined(\"constraints\", this.constraints)\n\t\t});\n\t\tconst statement = await lowerer.lowerToExecuteRequest(ddlNode);\n\t\tconst tableName = this.tableName;\n\t\tconst tableChecks = tableExistsAst(tableName);\n\t\tconst absent = await lowerer.lowerToExecuteRequest(tableChecks.tableAbsent());\n\t\tconst present = await lowerer.lowerToExecuteRequest(tableChecks.tablePresent());\n\t\treturn {\n\t\t\tid: `table.${tableName}`,\n\t\t\tlabel: `Create table ${tableName}`,\n\t\t\tsummary: `Creates table ${tableName} with required columns`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"table\", tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure table \"${tableName}\" does not exist`, absent.sql, absent.params)],\n\t\t\texecute: [{\n\t\t\t\tdescription: `create table \"${tableName}\"`,\n\t\t\t\tsql: statement.sql,\n\t\t\t\tparams: statement.params ?? []\n\t\t\t}],\n\t\t\tpostcheck: [step(`verify table \"${tableName}\" exists`, present.sql, present.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\tconst columnsList = this.columns.map(renderDdlColumnAsTsCall).join(\", \");\n\t\tconst constraintsList = this.constraints ? this.constraints.map(renderDdlConstraintAsTsCall).join(\", \") : void 0;\n\t\tconst opts = [];\n\t\topts.push(`table: ${jsonToTsSource(this.tableName)}`);\n\t\topts.push(`columns: [${columnsList}]`);\n\t\tif (constraintsList) opts.push(`constraints: [${constraintsList}]`);\n\t\treturn `this.createTable({ ${opts.join(\", \")} })`;\n\t}\n\timportRequirements() {\n\t\tconst req = [];\n\t\tif (this.columns.length > 0) {\n\t\t\treq.push({\n\t\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\t\tsymbol: \"col\"\n\t\t\t});\n\t\t\tfor (const sym of defaultImportSymbols(this.columns)) req.push({\n\t\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\t\tsymbol: sym\n\t\t\t});\n\t\t}\n\t\tfor (const sym of constraintImportSymbols(this.constraints)) req.push({\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: sym\n\t\t});\n\t\treturn req;\n\t}\n};\nvar DropTableCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"dropTable\";\n\toperationClass = \"destructive\";\n\ttableName;\n\tlabel;\n\tconstructor(tableName) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.label = `Drop table ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `DropTableCall.toOp: a lowerer is required on the SQLite planner path (table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName\n\t\t} });\n\t\tconst checks = tableExistsAst(this.tableName);\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.tablePresent());\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.tableAbsent());\n\t\treturn {\n\t\t\tid: `dropTable.${this.tableName}`,\n\t\t\tlabel: `Drop table ${this.tableName}`,\n\t\t\tsummary: `Drops table ${this.tableName} which is not in the contract`,\n\t\t\toperationClass: \"destructive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"table\", this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure table \"${this.tableName}\" exists`, present.sql, present.params)],\n\t\t\texecute: [step(`drop table \"${this.tableName}\"`, `DROP TABLE ${quoteIdentifier(this.tableName)}`)],\n\t\t\tpostcheck: [step(`verify table \"${this.tableName}\" is gone`, absent.sql, absent.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.dropTable({ table: ${jsonToTsSource(this.tableName)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar RecreateTableCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"recreateTable\";\n\toperationClass;\n\ttableName;\n\tcontractTable;\n\tschemaColumnNames;\n\tindexes;\n\tsummary;\n\tpostchecks;\n\tlabel;\n\tconstructor(args) {\n\t\tsuper();\n\t\tthis.tableName = args.tableName;\n\t\tthis.contractTable = args.contractTable;\n\t\tthis.schemaColumnNames = args.schemaColumnNames;\n\t\tthis.indexes = args.indexes;\n\t\tthis.summary = args.summary;\n\t\tthis.postchecks = args.postchecks;\n\t\tthis.operationClass = args.operationClass;\n\t\tthis.label = `Recreate table ${args.tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `RecreateTableCall.toOp: a lowerer is required on the SQLite planner path (table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName\n\t\t} });\n\t\treturn recreateTable({\n\t\t\ttableName: this.tableName,\n\t\t\tcontractTable: this.contractTable,\n\t\t\tschemaColumnNames: this.schemaColumnNames,\n\t\t\tindexes: this.indexes,\n\t\t\tsummary: this.summary,\n\t\t\tpostchecks: this.postchecks,\n\t\t\toperationClass: this.operationClass\n\t\t}, lowerer);\n\t}\n\trenderTypeScript() {\n\t\treturn `this.recreateTable(${jsonToTsSource({\n\t\t\ttableName: this.tableName,\n\t\t\tcontractTable: this.contractTable,\n\t\t\tschemaColumnNames: this.schemaColumnNames,\n\t\t\tindexes: this.indexes,\n\t\t\tsummary: this.summary,\n\t\t\tpostchecks: this.postchecks,\n\t\t\toperationClass: this.operationClass\n\t\t})})`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar AddColumnCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"addColumn\";\n\toperationClass = \"additive\";\n\ttableName;\n\tcolumnName;\n\tcolumn;\n\tlabel;\n\tconstructor(tableName, column) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.columnName = column.name;\n\t\tthis.column = column;\n\t\tthis.label = `Add column ${column.name} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `AddColumnCall.toOp: a lowerer is required on the SQLite planner path (column \"${this.column.name}\" on table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName,\n\t\t\tcolumnName: this.column.name\n\t\t} });\n\t\tconst checks = columnExistsAst(this.tableName, this.column.name);\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.columnAbsent());\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.columnPresent());\n\t\treturn {\n\t\t\tid: `column.${this.tableName}.${this.column.name}`,\n\t\t\tlabel: `Add column ${this.column.name} on ${this.tableName}`,\n\t\t\tsummary: `Adds column ${this.column.name} on ${this.tableName}`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"column\", this.column.name, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure column \"${this.column.name}\" is missing`, absent.sql, absent.params)],\n\t\t\texecute: [step(`add column \"${this.column.name}\"`, addColumnExecuteSql(this.tableName, this.column))],\n\t\t\tpostcheck: [step(`verify column \"${this.column.name}\" exists`, present.sql, present.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.addColumn({ table: ${jsonToTsSource(this.tableName)}, column: ${jsonToTsSource(this.column)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar DropColumnCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"dropColumn\";\n\toperationClass = \"destructive\";\n\ttableName;\n\tcolumnName;\n\tlabel;\n\tconstructor(tableName, columnName) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.columnName = columnName;\n\t\tthis.label = `Drop column ${columnName} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `DropColumnCall.toOp: a lowerer is required on the SQLite planner path (column \"${this.columnName}\" on table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName,\n\t\t\tcolumnName: this.columnName\n\t\t} });\n\t\tconst checks = columnExistsAst(this.tableName, this.columnName);\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.columnPresent());\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.columnAbsent());\n\t\treturn {\n\t\t\tid: `dropColumn.${this.tableName}.${this.columnName}`,\n\t\t\tlabel: `Drop column ${this.columnName} on ${this.tableName}`,\n\t\t\tsummary: `Drops column ${this.columnName} on ${this.tableName} which is not in the contract`,\n\t\t\toperationClass: \"destructive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"column\", this.columnName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure column \"${this.columnName}\" exists on \"${this.tableName}\"`, present.sql, present.params)],\n\t\t\texecute: [step(`drop column \"${this.columnName}\" from \"${this.tableName}\"`, dropColumnExecuteSql(this.tableName, this.columnName))],\n\t\t\tpostcheck: [step(`verify column \"${this.columnName}\" is gone from \"${this.tableName}\"`, absent.sql, absent.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.dropColumn({ table: ${jsonToTsSource(this.tableName)}, column: ${jsonToTsSource(this.columnName)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar CreateIndexCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"createIndex\";\n\toperationClass = \"additive\";\n\ttableName;\n\tindexName;\n\tcolumns;\n\tlabel;\n\tconstructor(tableName, indexName, columns) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.indexName = indexName;\n\t\tthis.columns = columns;\n\t\tthis.label = `Create index ${indexName} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `CreateIndexCall.toOp: a lowerer is required on the SQLite planner path (index \"${this.indexName}\" on table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName,\n\t\t\tindexName: this.indexName\n\t\t} });\n\t\tconst checks = indexExistsAst(this.indexName);\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.indexAbsent());\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.indexPresent());\n\t\treturn {\n\t\t\tid: `index.${this.tableName}.${this.indexName}`,\n\t\t\tlabel: `Create index ${this.indexName} on ${this.tableName}`,\n\t\t\tsummary: `Creates index ${this.indexName} on ${this.tableName}`,\n\t\t\toperationClass: \"additive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"index\", this.indexName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure index \"${this.indexName}\" is missing`, absent.sql, absent.params)],\n\t\t\texecute: [step(`create index \"${this.indexName}\"`, buildCreateIndexSql(this.tableName, this.indexName, this.columns))],\n\t\t\tpostcheck: [step(`verify index \"${this.indexName}\" exists`, present.sql, present.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.createIndex({ table: ${jsonToTsSource(this.tableName)}, index: ${jsonToTsSource(this.indexName)}, columns: ${jsonToTsSource(this.columns)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\nvar DropIndexCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"dropIndex\";\n\toperationClass = \"destructive\";\n\ttableName;\n\tindexName;\n\tlabel;\n\tconstructor(tableName, indexName) {\n\t\tsuper();\n\t\tthis.tableName = tableName;\n\t\tthis.indexName = indexName;\n\t\tthis.label = `Drop index ${indexName} on ${tableName}`;\n\t\tthis.freeze();\n\t}\n\tasync toOp(lowerer) {\n\t\tif (lowerer === void 0) throw sqliteError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `DropIndexCall.toOp: a lowerer is required on the SQLite planner path (index \"${this.indexName}\" on table \"${this.tableName}\"). Pass the control adapter to createSqliteMigrationPlanner.`, { meta: {\n\t\t\tfactory: this.factoryName,\n\t\t\ttableName: this.tableName,\n\t\t\tindexName: this.indexName\n\t\t} });\n\t\tconst checks = indexExistsAst(this.indexName);\n\t\tconst present = await lowerer.lowerToExecuteRequest(checks.indexPresent());\n\t\tconst absent = await lowerer.lowerToExecuteRequest(checks.indexAbsent());\n\t\treturn {\n\t\t\tid: `dropIndex.${this.tableName}.${this.indexName}`,\n\t\t\tlabel: `Drop index ${this.indexName} on ${this.tableName}`,\n\t\t\tsummary: `Drops index ${this.indexName} on ${this.tableName} which is not in the contract`,\n\t\t\toperationClass: \"destructive\",\n\t\t\ttarget: {\n\t\t\t\tid: \"sqlite\",\n\t\t\t\tdetails: buildTargetDetails(\"index\", this.indexName, this.tableName)\n\t\t\t},\n\t\t\tprecheck: [step(`ensure index \"${this.indexName}\" exists`, present.sql, present.params)],\n\t\t\texecute: [step(`drop index \"${this.indexName}\"`, buildDropIndexSql(this.indexName))],\n\t\t\tpostcheck: [step(`verify index \"${this.indexName}\" is gone`, absent.sql, absent.params)]\n\t\t};\n\t}\n\trenderTypeScript() {\n\t\treturn `this.dropIndex({ table: ${jsonToTsSource(this.tableName)}, index: ${jsonToTsSource(this.indexName)} })`;\n\t}\n\timportRequirements() {\n\t\treturn [];\n\t}\n};\n/**\n* A planner-generated data-transform stub. The current default strategy\n* (`nullabilityTighteningBackfillStrategy`) emits one of these with a\n* backfill-flavored `id`/`label` when the policy allows `'data'` and the\n* contract tightens a column's nullability, but the op itself is generic —\n* any future strategy that needs a placeholder data step can construct one\n* with its own id/label.\n*\n* `toOp()` always throws `MIGRATION.UNFILLED_PLACEHOLDER`: the planner cannot lower a stubbed\n* transform to a runtime op — the user must edit the rendered\n* `migration.ts` and re-emit.\n*/\nvar DataTransformCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"dataTransform\";\n\toperationClass = \"data\";\n\tid;\n\tlabel;\n\ttableName;\n\tcolumnName;\n\tconstructor(id, label, tableName, columnName) {\n\t\tsuper();\n\t\tthis.id = id;\n\t\tthis.label = label;\n\t\tthis.tableName = tableName;\n\t\tthis.columnName = columnName;\n\t\tthis.freeze();\n\t}\n\ttoOp(_lowerer) {\n\t\tthrow errorUnfilledPlaceholder(this.label);\n\t}\n\trenderTypeScript() {\n\t\tconst slot = `${this.tableName}-${this.columnName}-backfill-sql`;\n\t\treturn [\n\t\t\t\"dataTransform({\",\n\t\t\t` id: ${jsonToTsSource(this.id)},`,\n\t\t\t` label: ${jsonToTsSource(this.label)},`,\n\t\t\t` table: ${jsonToTsSource(this.tableName)},`,\n\t\t\t` description: ${jsonToTsSource(`Backfill NULL ${this.columnName} values in ${this.tableName}`)},`,\n\t\t\t` run: () => placeholder(${jsonToTsSource(slot)}),`,\n\t\t\t\"})\"\n\t\t].join(\"\\n\");\n\t}\n\timportRequirements() {\n\t\treturn [{\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: this.factoryName\n\t\t}, {\n\t\t\tmoduleSpecifier: TARGET_MIGRATION_MODULE,\n\t\t\tsymbol: \"placeholder\"\n\t\t}];\n\t}\n};\n/**\n* Laundered pre-built operation. Mirrors Postgres's `RawSqlCall`: wraps an\n* already-materialized `SqlMigrationPlanOperation` (typically produced by a\n* SQL-family helper or a codec lifecycle hook) so the planner can carry it\n* alongside structured call IR. `toOp()` returns the stored op unchanged;\n* `renderTypeScript()` emits `rawSql({...})` with the op serialized as a\n* JSON literal — round-tripping requires every field on the op to be\n* JSON-serializable (no closures).\n*/\nvar RawSqlCall = class extends SqliteOpFactoryCallNode {\n\tfactoryName = \"rawSql\";\n\toperationClass;\n\tlabel;\n\top;\n\tconstructor(op) {\n\t\tsuper();\n\t\tthis.op = op;\n\t\tthis.label = op.label;\n\t\tthis.operationClass = op.operationClass;\n\t\tthis.freeze();\n\t}\n\ttoOp(_lowerer) {\n\t\treturn this.op;\n\t}\n\trenderTypeScript() {\n\t\treturn `rawSql(${jsonToTsSource(this.op)})`;\n\t}\n};\n//#endregion\nexport { DropColumnCall as a, RawSqlCall as c, buildRecreateSummary as d, step as f, renderDefaultLiteral as h, DataTransformCall as i, RecreateTableCall as l, buildColumnTypeSql as m, CreateIndexCall as n, DropIndexCall as o, buildColumnDefaultSql as p, CreateTableCall as r, DropTableCall as s, AddColumnCall as t, buildRecreatePostchecks as u };\n\n//# sourceMappingURL=op-factory-call-DPooV70K.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,2BAA2B;AACjC,SAAS,qBAAqB,YAAY;CACzC,IAAI,CAAC,yBAAyB,KAAK,UAAU,GAAG,MAAM,YAAY,gCAAgC,yCAAyC,WAAW,8DAA8D,EAAE,MAAM,EAAE,WAAW,EAA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AW,EAAE;GACjG,4BAA4B,eAAe,IAAI,EAAE;GACjD;EACD,CAAC,CAAC,KAAK,IAAI;CACZ;CACA,qBAAqB;EACpB,OAAO,CAAC;GACP,iBAAiB;GACjB,QAAQ,KAAK;EACd,GAAG;GACF,iBAAiB;GACjB,QAAQ;EACT,CAAC;CACF;AACD;;;;;;;;;;AAUA,IAAI,aAAa,cAAc,wBAAwB;CACtD,cAAc;CACd;CACA;CACA;CACA,YAAY,IAAI;EACf,MAAM;EACN,KAAK,KAAK;EACV,KAAK,QAAQ,GAAG;EAChB,KAAK,iBAAiB,GAAG;EACzB,KAAK,OAAO;CACb;CACA,KAAK,UAAU;EACd,OAAO,KAAK;CACb;CACA,mBAAmB;EAClB,OAAO,UAAU,eAAe,KAAK,EAAE,EAAE;CAC1C;AACD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as sqliteError } from "./errors-CKsaaSnD-BeB4JS8h.mjs";
|
|
2
|
+
import { a as DropColumnCall, d as buildColumnTypeSql, f as buildRecreatePostchecks, i as DataTransformCall, l as RecreateTableCall, m as renderDefaultLiteral, n as CreateIndexCall, o as DropIndexCall, p as buildRecreateSummary, r as CreateTableCall, s as DropTableCall, t as AddColumnCall, u as buildColumnDefaultSql } from "./op-factory-call-DPooV70K-CHz16zs8.mjs";
|
|
2
3
|
import { t as CONTROL_TABLE_NAMES } from "./control-tables-D_o8dKRB-BXi43noL.mjs";
|
|
3
|
-
import { t as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-
|
|
4
|
+
import { t as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-BGQ61EyB-DVKS_IQb.mjs";
|
|
4
5
|
import { DdlColumn, ForeignKeyConstraint, FunctionColumnDefault, LiteralColumnDefault, PrimaryKeyConstraint, UniqueConstraint } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
6
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
6
7
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
@@ -11,7 +12,7 @@ import { RelationalSchemaNodeKind, SqlSchemaIR, relationalNodeGranularity } from
|
|
|
11
12
|
import { verifySqlSchemaByDiff } from "@prisma/orm-family-sql/family/diff";
|
|
12
13
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
13
14
|
import { InternalError, assertNever } from "@prisma/orm-framework/utils/internal-error";
|
|
14
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/planner-
|
|
15
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/planner-9WgrN7Ax.mjs
|
|
15
16
|
/** Renders a column default for the SQLite dialect. */
|
|
16
17
|
function sqliteRenderDefault(def, _column) {
|
|
17
18
|
if (def.kind === "function") {
|
|
@@ -228,10 +229,22 @@ function ddlColumnFromNode(column, inline) {
|
|
|
228
229
|
* Builds the table-level constraints (PK / unique / FK) for a `CreateTable`
|
|
229
230
|
* path from the table node — the node-sourced sibling of the retired
|
|
230
231
|
* contract-based `tableToDdlParts`'s constraint half.
|
|
232
|
+
*
|
|
233
|
+
* A check constraint on the table node throws rather than being dropped.
|
|
234
|
+
* `@@check` is refused earlier, by the `sql.checkConstraint` capability gate in
|
|
235
|
+
* PSL interpretation. The TS `check()` builder is not gated there — capabilities
|
|
236
|
+
* are adapter-reported and reach the contract only after it is built — so a
|
|
237
|
+
* `check()` declared against SQLite arrives here, and this is where it is
|
|
238
|
+
* refused. It is the primary enforcement point for that surface, and the safety
|
|
239
|
+
* net for a contract that reached storage some other way.
|
|
231
240
|
*/
|
|
232
241
|
function tableConstraintsFromNode(table, hasInlinePk) {
|
|
233
242
|
const constraints = [];
|
|
234
243
|
if (table.primaryKey && !hasInlinePk) constraints.push(new PrimaryKeyConstraint({ columns: table.primaryKey.columns }));
|
|
244
|
+
for (const check of table.checks ?? []) throw sqliteError("CONTRACT.CONSTRAINT_INVALID", `The SQLite target does not support CHECK constraints (constraint "${check.name}" on table "${table.name}"). The "checkConstraint" capability is Postgres-only — remove the "@@check" / "check()" declaration, or target Postgres.`, { meta: {
|
|
245
|
+
constraintName: check.name,
|
|
246
|
+
tableName: table.name
|
|
247
|
+
} });
|
|
235
248
|
for (const u of table.uniques) constraints.push(new UniqueConstraint({
|
|
236
249
|
columns: u.columns,
|
|
237
250
|
...u.name !== void 0 ? { name: u.name } : {}
|
|
@@ -530,7 +543,7 @@ function mapNodeIssueToCall(issue, ctx) {
|
|
|
530
543
|
case RelationalSchemaNodeKind.primaryKey:
|
|
531
544
|
case RelationalSchemaNodeKind.foreignKey:
|
|
532
545
|
case RelationalSchemaNodeKind.unique: return notOk(issueConflict(absorbedConflictKind(node.nodeKind), issue.path.join("/")));
|
|
533
|
-
case RelationalSchemaNodeKind.check: return notOk(issueConflict("unsupportedOperation", `SQLite does not support CHECK constraint DDL: ${issue.path.join("/")}`));
|
|
546
|
+
case RelationalSchemaNodeKind.check: return notOk(issueConflict("unsupportedOperation", `The SQLite target does not support CHECK constraint DDL: ${issue.path.join("/")}`));
|
|
534
547
|
default: return notOk(issueConflict("unsupportedOperation", `Unhandled node kind: ${node.nodeKind}`));
|
|
535
548
|
}
|
|
536
549
|
}
|
|
@@ -808,4 +821,4 @@ function retainUnownedExtras(issues, ownership) {
|
|
|
808
821
|
//#endregion
|
|
809
822
|
export { verifySqliteDatabaseSchema as a, sqliteContractToSchema as i, createSqliteMigrationPlanner as n, diffSqliteSchema as r, SqliteMigrationPlanner as t };
|
|
810
823
|
|
|
811
|
-
//# sourceMappingURL=planner-
|
|
824
|
+
//# sourceMappingURL=planner-9WgrN7Ax-Dh0zET4M.mjs.map
|