@prisma/orm-target-sqlite 8.0.0-rc.22-dev.10 → 8.0.0-rc.22-dev.11

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.
Files changed (27) hide show
  1. package/dist/{adapter-BLfNDWw-.d.mts → adapter-BBdY4iCZ.d.mts} +8 -6
  2. package/dist/adapter-BBdY4iCZ.d.mts.map +1 -0
  3. package/dist/{adapter-gpb0ICA2-Ddnczc5D.mjs → adapter-C6ceXocc-DA8E7YzK.mjs} +4 -3
  4. package/dist/adapter-C6ceXocc-DA8E7YzK.mjs.map +1 -0
  5. package/dist/adapter.d.mts +1 -1
  6. package/dist/adapter.mjs +2 -2
  7. package/dist/adapter__adapter.d.mts +1 -1
  8. package/dist/adapter__adapter.mjs +2 -2
  9. package/dist/adapter__control.mjs +2 -2
  10. package/dist/adapter__control.mjs.map +1 -1
  11. package/dist/adapter__runtime.mjs +2 -2
  12. package/dist/adapter__runtime.mjs.map +1 -1
  13. package/dist/adapter__sql-renderer.mjs +1 -1
  14. package/dist/{aggregates-DNxUFwla.d.mts → aggregates-Bee9csBL.d.mts} +6 -6
  15. package/dist/{aggregates-DNxUFwla.d.mts.map → aggregates-Bee9csBL.d.mts.map} +1 -1
  16. package/dist/{contract-contributions-wweWdXMK-CwYZg4jC.mjs → contract-contributions-DT76ePH3-BI96J32-.mjs} +4 -3
  17. package/dist/contract-contributions-DT76ePH3-BI96J32-.mjs.map +1 -0
  18. package/dist/{descriptor-meta-DrNwC4vO-C_RZ1Tmp.mjs → descriptor-meta-CKqpcoZL-D82JbePf.mjs} +3 -3
  19. package/dist/{descriptor-meta-DrNwC4vO-C_RZ1Tmp.mjs.map → descriptor-meta-CKqpcoZL-D82JbePf.mjs.map} +1 -1
  20. package/dist/driver__runtime.mjs +6 -1
  21. package/dist/driver__runtime.mjs.map +1 -1
  22. package/dist/target.d.mts +1 -1
  23. package/dist/target__aggregates.d.mts +1 -1
  24. package/package.json +10 -10
  25. package/dist/adapter-BLfNDWw-.d.mts.map +0 -1
  26. package/dist/adapter-gpb0ICA2-Ddnczc5D.mjs.map +0 -1
  27. package/dist/contract-contributions-wweWdXMK-CwYZg4jC.mjs.map +0 -1
@@ -13,6 +13,7 @@ declare const sqliteAdapterCapabilities: Readonly<{
13
13
  readonly enums: false;
14
14
  readonly insertOnConflictSkip: true;
15
15
  readonly insertOnConflictWithoutTarget: true;
16
+ readonly insertOnConflictTarget: true;
16
17
  };
17
18
  }>;
18
19
  //#endregion
@@ -32,6 +33,7 @@ declare const sqliteAdapterContractContributions: {
32
33
  readonly enums: false;
33
34
  readonly insertOnConflictSkip: true;
34
35
  readonly insertOnConflictWithoutTarget: true;
36
+ readonly insertOnConflictTarget: true;
35
37
  };
36
38
  }>;
37
39
  readonly types: {
@@ -64,7 +66,7 @@ declare const sqliteAdapterContractContributions: {
64
66
  readonly operation: "sum";
65
67
  readonly input: {
66
68
  readonly kind: "codec";
67
- readonly codecId: "sql/int@1" | "sqlite/integer@1" | "sqlite/bigint@1" | "sqlite/bigintnumber@1";
69
+ readonly codecId: "sql/int@1" | "sqlite/bigintnumber@1" | "sqlite/bigint@1" | "sqlite/integer@1";
68
70
  };
69
71
  readonly output: {
70
72
  readonly kind: "codec";
@@ -75,7 +77,7 @@ declare const sqliteAdapterContractContributions: {
75
77
  readonly operation: "sumBigInt";
76
78
  readonly input: {
77
79
  readonly kind: "codec";
78
- readonly codecId: "sql/int@1" | "sqlite/integer@1" | "sqlite/bigint@1" | "sqlite/bigintnumber@1";
80
+ readonly codecId: "sql/int@1" | "sqlite/bigintnumber@1" | "sqlite/bigint@1" | "sqlite/integer@1";
79
81
  };
80
82
  readonly output: {
81
83
  readonly kind: "codec";
@@ -100,7 +102,7 @@ declare const sqliteAdapterContractContributions: {
100
102
  readonly operation: "avg";
101
103
  readonly input: {
102
104
  readonly kind: "codec";
103
- readonly codecId: "sql/int@1" | "sql/float@1" | "sqlite/integer@1" | "sqlite/bigint@1" | "sqlite/real@1" | "sqlite/bigintnumber@1";
105
+ readonly codecId: "sql/int@1" | "sql/float@1" | "sqlite/bigintnumber@1" | "sqlite/bigint@1" | "sqlite/integer@1" | "sqlite/real@1";
104
106
  };
105
107
  readonly output: {
106
108
  readonly kind: "codec";
@@ -131,7 +133,7 @@ declare const sqliteAdapterContractContributions: {
131
133
  readonly operation: "min";
132
134
  readonly input: {
133
135
  readonly kind: "codec";
134
- readonly codecId: "sqlite/json@1" | "sqlite/blob@1" | "sqlite/datetime@1" | "sqlite/datetime-temporal@1" | "sqlite/datetime-string@1" | "sqlite/date-string@1" | "sqlite/date-temporal@1" | "sqlite/time-string@1" | "sqlite/time-temporal@1";
136
+ readonly codecId: "sqlite/datetime@1" | "sqlite/datetime-temporal@1" | "sqlite/datetime-string@1" | "sqlite/date-string@1" | "sqlite/date-temporal@1" | "sqlite/time-string@1" | "sqlite/time-temporal@1" | "sqlite/json@1" | "sqlite/blob@1";
135
137
  };
136
138
  readonly output: {
137
139
  readonly kind: "self";
@@ -172,7 +174,7 @@ declare const sqliteAdapterContractContributions: {
172
174
  readonly operation: "max";
173
175
  readonly input: {
174
176
  readonly kind: "codec";
175
- readonly codecId: "sqlite/json@1" | "sqlite/blob@1" | "sqlite/datetime@1" | "sqlite/datetime-temporal@1" | "sqlite/datetime-string@1" | "sqlite/date-string@1" | "sqlite/date-temporal@1" | "sqlite/time-string@1" | "sqlite/time-temporal@1";
177
+ readonly codecId: "sqlite/datetime@1" | "sqlite/datetime-temporal@1" | "sqlite/datetime-string@1" | "sqlite/date-string@1" | "sqlite/date-temporal@1" | "sqlite/time-string@1" | "sqlite/time-temporal@1" | "sqlite/json@1" | "sqlite/blob@1";
176
178
  };
177
179
  readonly output: {
178
180
  readonly kind: "self";
@@ -194,4 +196,4 @@ declare const sqliteAdapterContractContributions: {
194
196
  };
195
197
  //#endregion
196
198
  export { sqliteAdapterContractContributions as n, sqliteAdapterCapabilities as t };
197
- //# sourceMappingURL=adapter-BLfNDWw-.d.mts.map
199
+ //# sourceMappingURL=adapter-BBdY4iCZ.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-BBdY4iCZ.d.mts","names":[],"sources":["../../../../3-targets/sqlite/2-adapter/dist/adapter.d.mts"],"mappings":";;;;cAGc,2BAA2B;WAC9B;aACE;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA;;;;;;;;cAQC;WACH,cAAc;aACZ;eACE;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;;;WAGJ;aACE;eACE;eACA;iBACE;;eAEF;iBACE;iBACA;;eAEF;eACA;eACA,6EAA6E;;eAE7E;eACA;iBACE;;eAEF;iBACE;iBACA;;eAEF;eACA;eACA,6EAA6E;;eAE7E,8EAA8E;eAC9E;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;eACA,6EAA6E;;eAE7E,8EAA8E;eAC9E;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA,8EAA8E;eAC9E;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;eACA,6EAA6E;;eAE7E;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;eACA,6EAA6E"}
@@ -20,7 +20,7 @@ import { parseMarkerRowSafely, withMarkerReadErrorHandling } from "@prisma/orm-f
20
20
  import { resolveIntrospectedColumnType } from "@prisma/orm-family-sql/family/control-adapter";
21
21
  import { parseContractMarkerRow } from "@prisma/orm-family-sql/family/verify";
22
22
  import { createAstCodecRegistry, deriveParamMetadata, encodeParamsWithMetadata } from "@prisma/orm-family-sql/runtime";
23
- //#region ../../../3-targets/sqlite/2-adapter/dist/adapter-gpb0ICA2.mjs
23
+ //#region ../../../3-targets/sqlite/2-adapter/dist/adapter-C6ceXocc.mjs
24
24
  function ledgerOriginFromStored(originCoreHash) {
25
25
  if (originCoreHash === null || originCoreHash === "" || originCoreHash === "empty") return null;
26
26
  return originCoreHash;
@@ -695,7 +695,8 @@ const defaultCapabilities = Object.freeze({ sql: {
695
695
  returning: true,
696
696
  enums: false,
697
697
  insertOnConflictSkip: true,
698
- insertOnConflictWithoutTarget: true
698
+ insertOnConflictWithoutTarget: true,
699
+ insertOnConflictTarget: true
699
700
  } });
700
701
  var SqliteAdapterImpl = class {
701
702
  familyId = "sql";
@@ -1172,4 +1173,4 @@ function createSqliteAdapterWithCodecRegistry(codecRegistry, declaredDataTypes)
1172
1173
  //#endregion
1173
1174
  export { sqliteRawCodecInferer as a, renderLoweredSql as i, createSqliteAdapter as n, createSqliteAdapterWithCodecRegistry as r, SqliteControlAdapter as t };
1174
1175
 
1175
- //# sourceMappingURL=adapter-gpb0ICA2-Ddnczc5D.mjs.map
1176
+ //# sourceMappingURL=adapter-C6ceXocc-DA8E7YzK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-C6ceXocc-DA8E7YzK.mjs","names":["#codecs"],"sources":["../../../../3-targets/sqlite/2-adapter/dist/adapter-C6ceXocc.mjs"],"sourcesContent":["import { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { RawExpr, collectOrderedParamRefs, encodeLiteralDefault, isDdlNode, renderOpaqueSql } from \"@internal/sql-relational-core/ast\";\nimport { SQLITE_NOW_EXPRESSION, createSqliteCodecRegistryWithBuiltins, jsonDocumentRetag, sqliteCodecRegistry, sqliteNowExpressionFor } from \"@internal/target-sqlite/codecs\";\nimport { sqliteDataTypes } from \"@internal/target-sqlite/data-types\";\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 { parseMarkerRowSafely, withMarkerReadErrorHandling } from \"@internal/errors/execution\";\nimport { checkSqlDefaultText, contractColumns, readColumnDefault } from \"@internal/family-sql/control\";\nimport { resolveIntrospectedColumnType } from \"@internal/family-sql/control-adapter\";\nimport { parseContractMarkerRow } from \"@internal/family-sql/verify\";\nimport { codecForRef } from \"@internal/framework-components/codec\";\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 { readSqliteDefault } from \"@internal/target-sqlite/default-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 ../../../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: [SQLITE_NOW_EXPRESSION],\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\tmarkerLocation = SQLITE_MARKER_TABLE;\n\tcodecRegistry;\n\tdeclaredDataTypes;\n\t/** `declaredDataTypes` are the stack's data types in assembly order, which introspection resolves each column's reported type over. */\n\tconstructor(codecRegistry, declaredDataTypes) {\n\t\tthis.codecRegistry = codecRegistry;\n\t\tthis.declaredDataTypes = declaredDataTypes;\n\t}\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\tasync renderColumnDefault(column, table) {\n\t\tif (column.default === void 0) return \"\";\n\t\treturn sqliteRenderDdlColumnDefault(column.default, this.codecRegistry, column.codecRef, {\n\t\t\ttable,\n\t\t\tcolumn: column.name\n\t\t});\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 numbered `?N` 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\tasync withTransaction(driver, fn) {\n\t\tawait driver.query(\"BEGIN IMMEDIATE\");\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await fn();\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tawait driver.query(\"ROLLBACK\");\n\t\t\t} catch (rollbackError) {\n\t\t\t\tif (error instanceof Error && error.cause === void 0) error.cause = rollbackError;\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tawait driver.query(\"COMMIT\");\n\t\treturn result;\n\t}\n\tasync lockMarker(_driver) {}\n\t/**\n\t* Appends a ledger entry for `space`. See the `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\t/**\n\t* Reads a column's reported default: a function or SQL NULL as itself, and a literal with the column's codec, when the contract declares the column. A literal of a column the contract does not declare keeps only its raw text. When the contract's default is an expression that writes a literal, the codec reads that literal too, for the diff to compare the two values.\n\t*/\n\tasync readReportedDefault(rawDefault, declaredType, column) {\n\t\tconst reported = readSqliteDefault(rawDefault, declaredType);\n\t\tif (reported.kind === \"function\") return { resolvedDefault: reported };\n\t\tif (reported.kind === \"null\") return { resolvedDefault: {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: null\n\t\t} };\n\t\tconst codec = column === void 0 ? void 0 : codecForRef(this.codecRegistry, column.codecRef);\n\t\tif (codec === void 0) return {};\n\t\tconst expression = column?.defaultExpression;\n\t\tconst written = expression === void 0 ? void 0 : readSqliteDefault(expression, declaredType);\n\t\treturn readColumnDefault(codec, {\n\t\t\tliteral: reported.literal,\n\t\t\traw: rawDefault\n\t\t}, expression !== void 0 && written?.kind === \"literal\" ? {\n\t\t\tliteral: written.literal,\n\t\t\texpression\n\t\t} : void 0);\n\t}\n\tasync introspect(driver, contract) {\n\t\tconst contractColumnsOf = contractColumns(contract);\n\t\tconst tablesResult = await driver.query(`SELECT name, sql 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(${quoteIdentifier(tableName)})`);\n\t\t\tconst fkResult = await driver.query(`PRAGMA foreign_key_list(${quoteIdentifier(tableName)})`);\n\t\t\tconst indexListResult = await driver.query(`PRAGMA index_list(${quoteIdentifier(tableName)})`);\n\t\t\tconst columns = {};\n\t\t\tconst pkColumns = [];\n\t\t\tconst autoincrementColumn = autoincrementColumnOf(tableRow.sql, columnsResult.rows);\n\t\t\tfor (const col of columnsResult.rows) {\n\t\t\t\tconst rawDefault = col.dflt_value ?? void 0;\n\t\t\t\tconst readDefault = col.name === autoincrementColumn ? { resolvedDefault: AUTOINCREMENT_DEFAULT } : rawDefault === void 0 ? {} : await this.readReportedDefault(rawDefault, col.type, contractColumnsOf.columnOf(void 0, tableName, col.name));\n\t\t\t\tconst reportedType = {\n\t\t\t\t\ttext: col.type,\n\t\t\t\t\tkind: void 0,\n\t\t\t\t\tschema: void 0,\n\t\t\t\t\tname: void 0\n\t\t\t\t};\n\t\t\t\tcolumns[col.name] = {\n\t\t\t\t\tname: col.name,\n\t\t\t\t\ttypeText: 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\t...readDefault,\n\t\t\t\t\treportedType,\n\t\t\t\t\t...resolveIntrospectedColumnType(reportedType, this.declaredDataTypes)\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(${quoteIdentifier(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};\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, where) {\n\tif (wire === null) return \"NULL\";\n\tif (typeof wire === \"boolean\") return wire ? \"1\" : \"0\";\n\tif (typeof wire === \"number\") {\n\t\tif (Number.isNaN(wire)) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", `Column \"${where.table}\".\"${where.column}\" has a NaN default, which SQLite stores as NULL`, { meta: {\n\t\t\ttable: where.table,\n\t\t\tcolumn: where.column,\n\t\t\tvalue: \"NaN\",\n\t\t\treason: \"nan-default\"\n\t\t} });\n\t\tif (!Number.isFinite(wire)) return wire > 0 ? \"9e999\" : \"-9e999\";\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\", `Column \"${where.table}\".\"${where.column}\" has an invalid Date default`, { meta: {\n\t\t\ttable: where.table,\n\t\t\tcolumn: where.column,\n\t\t\treason: \"invalid-date-default\"\n\t\t} });\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}\nconst AUTOINCREMENT_DEFAULT = {\n\tkind: \"function\",\n\texpression: \"autoincrement()\"\n};\n/** `CREATE TABLE` text with its string literals, quoted identifiers and comments removed. */\nfunction createTableKeywords(createSql) {\n\treturn createSql.replace(/'(?:[^']|'')*'|\"(?:[^\"]|\"\")*\"|`(?:[^`]|``)*`|\\[[^\\]]*\\]|--[^\\n]*|\\/\\*[\\s\\S]*?(?:\\*\\/|$)/g, \" \");\n}\n/**\n* The column SQLite numbers with `AUTOINCREMENT`, which it keeps only in the table's `CREATE TABLE`\n* text. SQLite accepts the keyword only on a table's sole `INTEGER PRIMARY KEY` column.\n* See https://www.sqlite.org/autoinc.html.\n*/\nfunction autoincrementColumnOf(createSql, columns) {\n\tif (!createSql || !/\\bAUTOINCREMENT\\b/i.test(createTableKeywords(createSql))) return;\n\tconst primaryKey = columns.filter((column) => column.pk > 0);\n\tconst [column] = primaryKey;\n\treturn primaryKey.length === 1 && column?.type.toUpperCase() === \"INTEGER\" ? column.name : void 0;\n}\nasync function sqliteRenderDdlColumnDefault(def, codecLookup, codecRef, where) {\n\tif (def.kind === \"function\") {\n\t\tif (def.expression.text === \"autoincrement()\") return \"\";\n\t\tif (def.expression.text === \"now()\") {\n\t\t\tconst dataType = codecRef === void 0 ? void 0 : codecLookup.descriptorFor(codecRef.codecId)?.dataType;\n\t\t\tconst now = sqliteNowExpressionFor(dataType);\n\t\t\tif (now === void 0) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", `The column \"${where.table}\".\"${where.column}\" has a now() default, but its data type ${dataType} stores no date or time, so there is no current value to write. Remove the default, or give the field a date or time type.`, { meta: {\n\t\t\t\ttable: where.table,\n\t\t\t\tcolumn: where.column,\n\t\t\t\tdataType,\n\t\t\t\treason: \"now-default-not-date-or-time\"\n\t\t\t} });\n\t\t\treturn `DEFAULT (${now})`;\n\t\t}\n\t\tif (checkSqlDefaultText(def.expression.text) !== void 0) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", `Unsafe default expression in contract: \"${def.expression.text}\". Default expressions must not contain semicolons, SQL comment tokens, dollar-quoting, or subqueries.`, { meta: { expression: def.expression.text } });\n\t\treturn `DEFAULT (${renderOpaqueSql(def.expression)})`;\n\t}\n\tconst encoded = codecRef === void 0 ? void 0 : await encodeLiteralDefault(codecLookup, codecRef, def.value, where);\n\tif (encoded?.kind === \"sql-null\") return \"DEFAULT NULL\";\n\tif (encoded !== void 0) return `DEFAULT ${sqliteInlineLiteral(encoded.wire, where)}`;\n\treturn `DEFAULT ${sqliteInlineLiteral(def.value, where)}`;\n}\nasync function sqliteRenderDdlColumn(column, codecLookup, table) {\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\t\ttable,\n\t\t\tcolumn: column.name\n\t\t});\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, node.table)));\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/placeholders.ts\nconst QUOTE_CLOSERS = {\n\t\"'\": \"'\",\n\t\"\\\"\": \"\\\"\",\n\t\"`\": \"`\",\n\t\"[\": \"]\"\n};\nfunction skipQuoted(sql, start, closer) {\n\tlet index = start + 1;\n\twhile (index < sql.length) {\n\t\tif (sql[index] === closer) {\n\t\t\tif (closer !== \"]\" && sql[index + 1] === closer) {\n\t\t\t\tindex += 2;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn index + 1;\n\t\t}\n\t\tindex += 1;\n\t}\n\treturn index;\n}\nfunction skipUntil(sql, start, terminator) {\n\tconst end = sql.indexOf(terminator, start);\n\treturn end === -1 ? sql.length : end + terminator.length;\n}\nfunction isDigit(char) {\n\treturn char !== void 0 && char >= \"0\" && char <= \"9\";\n}\n/** The `?` placeholders in SQLite SQL text, in the order written, skipping quoted text, quoted identifiers and comments. */\nfunction scanPlaceholders(sql) {\n\tconst placeholders = [];\n\tlet index = 0;\n\twhile (index < sql.length) {\n\t\tconst char = sql[index] ?? \"\";\n\t\tconst closer = QUOTE_CLOSERS[char];\n\t\tif (closer !== void 0) index = skipQuoted(sql, index, closer);\n\t\telse if (sql.startsWith(\"--\", index)) index = skipUntil(sql, index + 2, \"\\n\");\n\t\telse if (sql.startsWith(\"/*\", index)) index = skipUntil(sql, index + 2, \"*/\");\n\t\telse if (char === \"?\") {\n\t\t\tlet end = index + 1;\n\t\t\twhile (isDigit(sql[end])) end += 1;\n\t\t\tplaceholders.push(sql.slice(index, end));\n\t\t\tindex = end;\n\t\t} else index += 1;\n\t}\n\treturn placeholders;\n}\nconst NUMBERED_PLACEHOLDER = /^\\?([1-9]\\d*)$/;\nfunction placeholdersMatchParams(placeholders, paramCount) {\n\tconst numbers = placeholders.map((placeholder) => Number(NUMBERED_PLACEHOLDER.exec(placeholder)?.[1] ?? NaN));\n\treturn numbers.every((number) => number >= 1 && number <= paramCount) && new Set(numbers).size === paramCount;\n}\nconst REPORTED_PLACEHOLDERS = 5;\nfunction plural(count, noun) {\n\treturn `${count} ${noun}${count === 1 ? \"\" : \"s\"}`;\n}\nfunction assertPlaceholdersMatchParams(sql, paramCount) {\n\tconst placeholders = scanPlaceholders(sql);\n\tif (placeholdersMatchParams(placeholders, paramCount)) return;\n\tconst firstPlaceholders = placeholders.slice(0, REPORTED_PLACEHOLDERS);\n\tconst starting = firstPlaceholders.length > 0 ? `, starting ${firstPlaceholders.join(\", \")}` : \"\";\n\tthrow structuredError(\"RUNTIME.PARAM_PLACEHOLDER_MISMATCH\", `The lowered SQLite statement writes ${plural(placeholders.length, \"placeholder\")} for ${plural(paramCount, \"parameter\")}${starting}; each parameter must be written as its own numbered placeholder, and no other placeholder may appear.`, {\n\t\twhy: \"A placeholder that does not match a parameter binds a value to the wrong place in the statement, or leaves a value unbound.\",\n\t\tfix: \"Pass values into raw SQL through interpolation rather than writing a `?` in the SQL text.\",\n\t\tmeta: {\n\t\t\tplaceholderCount: placeholders.length,\n\t\t\tparamCount,\n\t\t\tfirstPlaceholders\n\t\t}\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\tinsertOnConflictSkip: true,\n\tinsertOnConflictWithoutTarget: true,\n\tinsertOnConflictTarget: true\n} });\nvar SqliteAdapterImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"sqlite\";\n\tprofile;\n\t#codecs;\n\tconstructor(codecRegistry, declaredDataTypes, profileId) {\n\t\tthis.#codecs = codecRegistry;\n\t\tconst controlAdapter = new SqliteControlAdapter(codecRegistry, declaredDataTypes);\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 orderedRefs = collectOrderedParamRefs(ast);\n\tconst placeholderNumbers = /* @__PURE__ */ new Map();\n\tconst params = orderedRefs.map((ref, index) => {\n\t\tplaceholderNumbers.set(ref, index + 1);\n\t\treturn ref.kind === \"prepared-param-ref\" ? {\n\t\t\tkind: \"bind\",\n\t\t\tname: ref.name\n\t\t} : {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: ref.value\n\t\t};\n\t});\n\tconst ctx = {\n\t\tcontract,\n\t\tcodecs,\n\t\tplaceholderNumbers\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\tcase \"raw-query\":\n\t\t\tsql = renderParts(node.parts, ctx);\n\t\t\tbreak;\n\t\tdefault: throw new InternalError(`Unsupported AST node kind: ${nodeKind(node)}`);\n\t}\n\tassertPlaceholdersMatchParams(sql, params.length);\n\treturn Object.freeze({\n\t\tsql,\n\t\tparams\n\t});\n}\nfunction renderPlaceholder(ref, ctx) {\n\tconst number = ctx.placeholderNumbers.get(ref);\n\tif (number === void 0) throw new InternalError(\"ParamRef was written but not collected from the AST\");\n\treturn `?${number}`;\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\tif (ast.locking !== void 0 && ast.locking.length > 0) throw structuredError(\"RUNTIME.AST_UNSUPPORTED\", \"SQLite has no row locks, so a select cannot carry a locking clause such as FOR UPDATE\", { meta: {\n\t\ttarget: \"sqlite\",\n\t\tfeature: \"locking-clause\"\n\t} });\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 ${renderOrderByItems(ast.orderBy, ctx)}` : \"\",\n\t\tast.limit === void 0 && ast.offset !== void 0 ? \"LIMIT -1\" : renderLimitOffset(\"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 renderPlaceholder(node, ctx);\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 renderParts(parts, ctx) {\n\treturn parts.map((part) => typeof part === \"string\" ? part : renderExpr(part, ctx)).join(\"\");\n}\nfunction renderRawExpr(node, ctx) {\n\treturn renderParts(node.parts, ctx);\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\" && !Number.isNaN(expr.value) && !Number.isFinite(expr.value)) return expr.value > 0 ? \"9e999\" : \"-9e999\";\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\treturn expr.lowering.template.replace(/\\{\\{self\\}\\}|\\{\\{arg(\\d+)\\}\\}/g, (token, argIndex) => {\n\t\tif (token === \"{{self}}\") return self;\n\t\tconst arg = args[Number(argIndex)];\n\t\tif (arg === void 0) throw structuredError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Operation lowering template for \"${expr.method}\" referenced missing argument {{arg${argIndex}}}; template has ${args.length} arg(s)`, { meta: { method: expr.method } });\n\t\treturn arg;\n\t});\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 = renderPlaceholder(rightNode, ctx);\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\tisNotDistinctFrom: \"IS\",\n\t\tisDistinctFrom: \"IS NOT\",\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 renderPlaceholder(v, ctx);\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)}${ORDER_DIRECTION_SQL[item.dir]}${renderNullsPlacement(item)}`).join(\", \");\n}\nconst ORDER_DIRECTION_SQL = {\n\tasc: \" ASC\",\n\tdesc: \" DESC\"\n};\nconst ORDER_NULLS_SQL = {\n\tfirst: \" NULLS FIRST\",\n\tlast: \" NULLS LAST\"\n};\nfunction renderNullsPlacement(item) {\n\treturn item.nulls === void 0 ? \"\" : ORDER_NULLS_SQL[item.nulls];\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 renderPlaceholder(value, ctx);\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 = renderTableSource(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\tconst target = conflictColumns.length === 0 ? \"\" : ` (${conflictColumns.join(\", \")})`;\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${target} DO NOTHING`;\n\t\t\t\tbreak;\n\t\t\tcase \"do-update-set\":\n\t\t\t\tif (conflictColumns.length === 0) throw structuredError(\"RUNTIME.AST_INVALID\", \"INSERT onConflict requires at least one conflict column\", { meta: {\n\t\t\t\t\tnode: \"insert\",\n\t\t\t\t\ttable: ast.table.name\n\t\t\t\t} });\n\t\t\t\tonConflictClause = ` ON CONFLICT${target} DO UPDATE SET ${Object.entries(action.set).map(([colName, value]) => {\n\t\t\t\t\treturn `${quoteIdentifier(colName)} = ${renderExpr(value, ctx)}`;\n\t\t\t\t}).join(\", \")}`;\n\t\t\t\tbreak;\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 = renderTableSource(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 ${renderTableSource(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.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, sqliteDataTypes, options?.profileId));\n}\nfunction createSqliteAdapterWithCodecRegistry(codecRegistry, declaredDataTypes) {\n\treturn Object.freeze(new SqliteAdapterImpl(codecRegistry, declaredDataTypes));\n}\n//#endregion\nexport { SqliteControlAdapter as a, sqliteRawCodecInferer as i, createSqliteAdapterWithCodecRegistry as n, renderLoweredSql as r, createSqliteAdapter as t };\n\n//# sourceMappingURL=adapter-C6ceXocc.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,uBAAuB,gBAAgB;CAC/C,IAAI,mBAAmB,QAAQ,mBAAmB,MAAM,mBAAmB,SAAS,OAAO;CAC3F,OAAO;AACR;AAGA,MAAM,iBAAiB,uBAAuB,mBAAmB;AACjE,eAAe,yBAAyB,SAAS,KAAK,SAAS,gBAAgB;CAC9E,OAAO,yBAAyB,QAAQ,OAAO,KAAK,SAAS;EAC5D,IAAI,KAAK,SAAS,WAAW,OAAO,KAAK;EACzC,MAAM,IAAI,cAAc,yCAAyC,KAAK,KAAK,wBAAwB;CACpG,CAAC,GAAG,oBAAoB,GAAG,GAAG,CAAC,GAAG,MAAM;AACzC;AAGA,MAAM,+BAA+B;AACrC,SAAS,sBAAsB,OAAO;CACrC,IAAI,iBAAiB,MAAM,OAAO;CAClC,IAAI,6BAA6B,KAAK,KAAK,GAAG,uBAAuB,IAAI,KAAK,GAAG,MAAM,QAAQ,KAAK,GAAG,EAAE,EAAE;CAC3G,OAAO,IAAI,KAAK,KAAK;AACtB;AACA,SAAS,yBAAyB,YAAY;CAC7C,IAAI,MAAM,QAAQ,UAAU,GAAG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AK,KAAK;EACjG;EACA,OAAO,GAAG,WAAW,KAAK,MAAM,GAAG,EAAE,MAAM,gBAAgB,KAAK,KAAK;CACtE,CAAC,CAAC,CAAC,KAAK,IAAI;AACb;AACA,SAAS,oBAAoB,SAAS;CACrC,MAAM,gBAAgB,sCAAsC,SAAS,gBAAgB;CACrF,OAAO,OAAO,OAAO,IAAI,kBAAkB,eAAe,iBAAiB,SAAS,SAAS,CAAC;AAC/F;AACA,SAAS,qCAAqC,eAAe,mBAAmB;CAC/E,OAAO,OAAO,OAAO,IAAI,kBAAkB,eAAe,iBAAiB,CAAC;AAC7E"}
@@ -1,7 +1,7 @@
1
1
  import { n as SqliteContract, r as SqliteLoweredStatement, t as SqliteAdapterOptions } from "./types-RJMd2PlL-BTGAJrBQ.mjs";
2
2
  import { b as createSqliteBuiltinCodecLookup, o as SqliteCodecRegistry, t as JsonValue$1, x as createSqliteCodecRegistryWithBuiltins } from "./codecs-A0DbaZRE-CMyLhO_K.mjs";
3
3
  import { i as sqliteRawCodecInferer, r as renderLoweredSql, t as createSqliteAdapter } from "./adapter-xFPDhkod-DB6XDGgl.mjs";
4
- import { n as sqliteAdapterContractContributions, t as sqliteAdapterCapabilities } from "./adapter-BLfNDWw-.mjs";
4
+ import { n as sqliteAdapterContractContributions, t as sqliteAdapterCapabilities } from "./adapter-BBdY4iCZ.mjs";
5
5
  import { t as CodecTypes } from "./codec-types-CGtSWeZ5-B5RH39BA.mjs";
6
6
  import "./codec-types-Dx9dQe-Y.mjs";
7
7
  import { a as jsonColumn, c as textColumn, i as integerColumn, n as blobColumn, o as rawColumn, r as datetimeColumn, s as realColumn, t as bigintColumn } from "./column-types-bTPNfz46.mjs";
package/dist/adapter.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { n as createSqliteBuiltinCodecLookup, r as createSqliteCodecRegistryWithBuiltins } from "./codecs-BhRFtE69.mjs";
2
2
  import { n as escapeLiteral, r as quoteIdentifier } from "./sql-utils-C9blmi9x-B90QedVA.mjs";
3
3
  import { t as readSqliteDefault } from "./default-normalizer-CsMhUEOe-CRieDElD.mjs";
4
- import { a as sqliteRawCodecInferer, i as renderLoweredSql, n as createSqliteAdapter, t as SqliteControlAdapter } from "./adapter-gpb0ICA2-Ddnczc5D.mjs";
5
- import { n as sqliteAdapterContractContributions, t as sqliteAdapterCapabilities } from "./contract-contributions-wweWdXMK-CwYZg4jC.mjs";
4
+ import { a as sqliteRawCodecInferer, i as renderLoweredSql, n as createSqliteAdapter, t as SqliteControlAdapter } from "./adapter-C6ceXocc-DA8E7YzK.mjs";
5
+ import { n as sqliteAdapterContractContributions, t as sqliteAdapterCapabilities } from "./contract-contributions-DT76ePH3-BI96J32-.mjs";
6
6
  import { a as jsonColumn, c as textColumn, i as integerColumn, n as blobColumn, o as rawColumn, r as datetimeColumn, s as realColumn, t as bigintColumn } from "./column-types-toYbR7mn.mjs";
7
7
  export { SqliteControlAdapter, bigintColumn, blobColumn, createSqliteAdapter, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins, datetimeColumn, escapeLiteral, integerColumn, jsonColumn, quoteIdentifier, rawColumn, readSqliteDefault, realColumn, renderLoweredSql, sqliteAdapterCapabilities, sqliteAdapterContractContributions, sqliteRawCodecInferer, textColumn };
@@ -1,4 +1,4 @@
1
1
  import { t as SqliteAdapterOptions } from "./types-RJMd2PlL-BTGAJrBQ.mjs";
2
2
  import { i as sqliteRawCodecInferer, t as createSqliteAdapter } from "./adapter-xFPDhkod-DB6XDGgl.mjs";
3
- import { n as sqliteAdapterContractContributions, t as sqliteAdapterCapabilities } from "./adapter-BLfNDWw-.mjs";
3
+ import { n as sqliteAdapterContractContributions, t as sqliteAdapterCapabilities } from "./adapter-BBdY4iCZ.mjs";
4
4
  export { type SqliteAdapterOptions, createSqliteAdapter, sqliteAdapterCapabilities, sqliteAdapterContractContributions, sqliteRawCodecInferer };
@@ -1,3 +1,3 @@
1
- import { a as sqliteRawCodecInferer, n as createSqliteAdapter } from "./adapter-gpb0ICA2-Ddnczc5D.mjs";
2
- import { n as sqliteAdapterContractContributions, t as sqliteAdapterCapabilities } from "./contract-contributions-wweWdXMK-CwYZg4jC.mjs";
1
+ import { a as sqliteRawCodecInferer, n as createSqliteAdapter } from "./adapter-C6ceXocc-DA8E7YzK.mjs";
2
+ import { n as sqliteAdapterContractContributions, t as sqliteAdapterCapabilities } from "./contract-contributions-DT76ePH3-BI96J32-.mjs";
3
3
  export { createSqliteAdapter, sqliteAdapterCapabilities, sqliteAdapterContractContributions, sqliteRawCodecInferer };
@@ -1,8 +1,8 @@
1
1
  import { n as createSqliteBuiltinCodecLookup, r as createSqliteCodecRegistryWithBuiltins, t as assembleSqliteCodecRegistry } from "./codecs-BhRFtE69.mjs";
2
2
  import { n as escapeLiteral, r as quoteIdentifier } from "./sql-utils-C9blmi9x-B90QedVA.mjs";
3
3
  import { t as readSqliteDefault } from "./default-normalizer-CsMhUEOe-CRieDElD.mjs";
4
- import { t as SqliteControlAdapter } from "./adapter-gpb0ICA2-Ddnczc5D.mjs";
5
- import { t as sqliteAdapterDescriptorMeta } from "./descriptor-meta-DrNwC4vO-C_RZ1Tmp.mjs";
4
+ import { t as SqliteControlAdapter } from "./adapter-C6ceXocc-DA8E7YzK.mjs";
5
+ import { t as sqliteAdapterDescriptorMeta } from "./descriptor-meta-CKqpcoZL-D82JbePf.mjs";
6
6
  import { sqlDefaultFunctions } from "@prisma/orm-family-sql/family/control";
7
7
  //#region ../../../3-targets/sqlite/2-adapter/dist/control.mjs
8
8
  const sqliteDefaultFunctionRegistryEntries = Object.entries(sqlDefaultFunctions());
@@ -1 +1 @@
1
- {"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/sqlite/2-adapter/dist/control.mjs"],"sourcesContent":["import { a as SqliteControlAdapter } from \"./adapter-gpb0ICA2.mjs\";\nimport { t as sqliteAdapterDescriptorMeta } from \"./descriptor-meta-DrNwC4vO.mjs\";\nimport { assembleSqliteCodecRegistry, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins } from \"@internal/target-sqlite/codecs\";\nimport { escapeLiteral, quoteIdentifier } from \"@internal/target-sqlite/sql-utils\";\nimport { sqlDefaultFunctions } from \"@internal/family-sql/control\";\nimport { readSqliteDefault } from \"@internal/target-sqlite/default-normalizer\";\n//#region src/core/migrations/control-mutation-defaults.ts\nconst sqliteDefaultFunctionRegistryEntries = Object.entries(sqlDefaultFunctions());\nfunction createSqliteDefaultFunctionRegistry() {\n\treturn new Map(sqliteDefaultFunctionRegistryEntries);\n}\n//#endregion\n//#region src/exports/control.ts\nconst sqliteAdapterDescriptor = {\n\t...sqliteAdapterDescriptorMeta,\n\tauthoring: { valueObjectStorageType: \"Json\" },\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createSqliteDefaultFunctionRegistry(),\n\t\tgeneratorDescriptors: []\n\t},\n\tcreate(stack) {\n\t\treturn new SqliteControlAdapter(assembleSqliteCodecRegistry(stack.target, stack.extensions), stack.declaredDataTypes.map(({ type }) => type));\n\t}\n};\n//#endregion\nexport { SqliteControlAdapter, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins, sqliteAdapterDescriptor as default, escapeLiteral, quoteIdentifier, readSqliteDefault };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,uCAAuC,OAAO,QAAQ,oBAAoB,CAAC;AACjF,SAAS,sCAAsC;CAC9C,OAAO,IAAI,IAAI,oCAAoC;AACpD;AAGA,MAAM,0BAA0B;CAC/B,GAAG;CACH,WAAW,EAAE,wBAAwB,OAAO;CAC5C,yBAAyB;EACxB,yBAAyB,oCAAoC;EAC7D,sBAAsB,CAAC;CACxB;CACA,OAAO,OAAO;EACb,OAAO,IAAI,qBAAqB,4BAA4B,MAAM,QAAQ,MAAM,UAAU,GAAG,MAAM,kBAAkB,KAAK,EAAE,WAAW,IAAI,CAAC;CAC7I;AACD"}
1
+ {"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/sqlite/2-adapter/dist/control.mjs"],"sourcesContent":["import { a as SqliteControlAdapter } from \"./adapter-C6ceXocc.mjs\";\nimport { t as sqliteAdapterDescriptorMeta } from \"./descriptor-meta-CKqpcoZL.mjs\";\nimport { assembleSqliteCodecRegistry, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins } from \"@internal/target-sqlite/codecs\";\nimport { escapeLiteral, quoteIdentifier } from \"@internal/target-sqlite/sql-utils\";\nimport { sqlDefaultFunctions } from \"@internal/family-sql/control\";\nimport { readSqliteDefault } from \"@internal/target-sqlite/default-normalizer\";\n//#region src/core/migrations/control-mutation-defaults.ts\nconst sqliteDefaultFunctionRegistryEntries = Object.entries(sqlDefaultFunctions());\nfunction createSqliteDefaultFunctionRegistry() {\n\treturn new Map(sqliteDefaultFunctionRegistryEntries);\n}\n//#endregion\n//#region src/exports/control.ts\nconst sqliteAdapterDescriptor = {\n\t...sqliteAdapterDescriptorMeta,\n\tauthoring: { valueObjectStorageType: \"Json\" },\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createSqliteDefaultFunctionRegistry(),\n\t\tgeneratorDescriptors: []\n\t},\n\tcreate(stack) {\n\t\treturn new SqliteControlAdapter(assembleSqliteCodecRegistry(stack.target, stack.extensions), stack.declaredDataTypes.map(({ type }) => type));\n\t}\n};\n//#endregion\nexport { SqliteControlAdapter, createSqliteBuiltinCodecLookup, createSqliteCodecRegistryWithBuiltins, sqliteAdapterDescriptor as default, escapeLiteral, quoteIdentifier, readSqliteDefault };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,uCAAuC,OAAO,QAAQ,oBAAoB,CAAC;AACjF,SAAS,sCAAsC;CAC9C,OAAO,IAAI,IAAI,oCAAoC;AACpD;AAGA,MAAM,0BAA0B;CAC/B,GAAG;CACH,WAAW,EAAE,wBAAwB,OAAO;CAC5C,yBAAyB;EACxB,yBAAyB,oCAAoC;EAC7D,sBAAsB,CAAC;CACxB;CACA,OAAO,OAAO;EACb,OAAO,IAAI,qBAAqB,4BAA4B,MAAM,QAAQ,MAAM,UAAU,GAAG,MAAM,kBAAkB,KAAK,EAAE,WAAW,IAAI,CAAC;CAC7I;AACD"}
@@ -1,7 +1,7 @@
1
1
  import { i as sqliteCodecDescriptorRegistry, t as assembleSqliteCodecRegistry } from "./codecs-BhRFtE69.mjs";
2
2
  import { t as sqliteNowGenerators } from "./date-time-now-generators-T8JO6gR6-DBt5IyH5.mjs";
3
- import { a as sqliteRawCodecInferer, r as createSqliteAdapterWithCodecRegistry } from "./adapter-gpb0ICA2-Ddnczc5D.mjs";
4
- import { t as sqliteAdapterDescriptorMeta } from "./descriptor-meta-DrNwC4vO-C_RZ1Tmp.mjs";
3
+ import { a as sqliteRawCodecInferer, r as createSqliteAdapterWithCodecRegistry } from "./adapter-C6ceXocc-DA8E7YzK.mjs";
4
+ import { t as sqliteAdapterDescriptorMeta } from "./descriptor-meta-CKqpcoZL-D82JbePf.mjs";
5
5
  import { assembleDataTypes } from "@prisma/orm-framework/components/codec";
6
6
  import { timestampNowRuntimeGenerator } from "@prisma/orm-family-sql/family/runtime";
7
7
  import { builtinGeneratorIds } from "@prisma/orm-framework/ids";
@@ -1 +1 @@
1
- {"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/sqlite/2-adapter/dist/runtime.mjs"],"sourcesContent":["import { i as sqliteRawCodecInferer, n as createSqliteAdapterWithCodecRegistry } from \"./adapter-gpb0ICA2.mjs\";\nimport { t as sqliteAdapterDescriptorMeta } from \"./descriptor-meta-DrNwC4vO.mjs\";\nimport { assembleSqliteCodecRegistry, sqliteCodecDescriptorRegistry } from \"@internal/target-sqlite/codecs\";\nimport { assembleDataTypes } from \"@internal/framework-components/codec\";\nimport { timestampNowRuntimeGenerator } from \"@internal/family-sql/runtime\";\nimport { builtinGeneratorIds } from \"@internal/ids\";\nimport { generateId } from \"@internal/ids/runtime\";\nimport { sqliteNowGenerators } from \"@internal/target-sqlite/runtime\";\n//#region src/core/runtime/runtime-adapter.ts\nfunction createSqliteMutationDefaultGenerators() {\n\treturn [\n\t\t...builtinGeneratorIds.map((id) => ({\n\t\t\tid,\n\t\t\tgenerate: (params) => {\n\t\t\t\treturn generateId(params ? {\n\t\t\t\t\tid,\n\t\t\t\t\tparams\n\t\t\t\t} : { id });\n\t\t\t},\n\t\t\tstability: \"field\"\n\t\t})),\n\t\ttimestampNowRuntimeGenerator(),\n\t\t...sqliteNowGenerators.map(({ id, generate }) => ({\n\t\t\tid,\n\t\t\tgenerate,\n\t\t\tstability: \"query\"\n\t\t}))\n\t];\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), assembleDataTypes([\n\t\t\tstack.target,\n\t\t\tstack.adapter,\n\t\t\t...stack.extensions\n\t\t]).declared.map(({ type }) => type));\n\t}\n};\n//#endregion\nexport { sqliteRuntimeAdapterDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,wCAAwC;CAChD,OAAO;EACN,GAAG,oBAAoB,KAAK,QAAQ;GACnC;GACA,WAAW,WAAW;IACrB,OAAO,WAAW,SAAS;KAC1B;KACA;IACD,IAAI,EAAE,GAAG,CAAC;GACX;GACA,WAAW;EACZ,EAAE;EACF,6BAA6B;EAC7B,GAAG,oBAAoB,KAAK,EAAE,IAAI,gBAAgB;GACjD;GACA;GACA,WAAW;EACZ,EAAE;CACH;AACD;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,GAAG,kBAAkB;GAC1H,MAAM;GACN,MAAM;GACN,GAAG,MAAM;EACV,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,WAAW,IAAI,CAAC;CACpC;AACD"}
1
+ {"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/sqlite/2-adapter/dist/runtime.mjs"],"sourcesContent":["import { i as sqliteRawCodecInferer, n as createSqliteAdapterWithCodecRegistry } from \"./adapter-C6ceXocc.mjs\";\nimport { t as sqliteAdapterDescriptorMeta } from \"./descriptor-meta-CKqpcoZL.mjs\";\nimport { assembleSqliteCodecRegistry, sqliteCodecDescriptorRegistry } from \"@internal/target-sqlite/codecs\";\nimport { assembleDataTypes } from \"@internal/framework-components/codec\";\nimport { timestampNowRuntimeGenerator } from \"@internal/family-sql/runtime\";\nimport { builtinGeneratorIds } from \"@internal/ids\";\nimport { generateId } from \"@internal/ids/runtime\";\nimport { sqliteNowGenerators } from \"@internal/target-sqlite/runtime\";\n//#region src/core/runtime/runtime-adapter.ts\nfunction createSqliteMutationDefaultGenerators() {\n\treturn [\n\t\t...builtinGeneratorIds.map((id) => ({\n\t\t\tid,\n\t\t\tgenerate: (params) => {\n\t\t\t\treturn generateId(params ? {\n\t\t\t\t\tid,\n\t\t\t\t\tparams\n\t\t\t\t} : { id });\n\t\t\t},\n\t\t\tstability: \"field\"\n\t\t})),\n\t\ttimestampNowRuntimeGenerator(),\n\t\t...sqliteNowGenerators.map(({ id, generate }) => ({\n\t\t\tid,\n\t\t\tgenerate,\n\t\t\tstability: \"query\"\n\t\t}))\n\t];\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), assembleDataTypes([\n\t\t\tstack.target,\n\t\t\tstack.adapter,\n\t\t\t...stack.extensions\n\t\t]).declared.map(({ type }) => type));\n\t}\n};\n//#endregion\nexport { sqliteRuntimeAdapterDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,wCAAwC;CAChD,OAAO;EACN,GAAG,oBAAoB,KAAK,QAAQ;GACnC;GACA,WAAW,WAAW;IACrB,OAAO,WAAW,SAAS;KAC1B;KACA;IACD,IAAI,EAAE,GAAG,CAAC;GACX;GACA,WAAW;EACZ,EAAE;EACF,6BAA6B;EAC7B,GAAG,oBAAoB,KAAK,EAAE,IAAI,gBAAgB;GACjD;GACA;GACA,WAAW;EACZ,EAAE;CACH;AACD;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,GAAG,kBAAkB;GAC1H,MAAM;GACN,MAAM;GACN,GAAG,MAAM;EACV,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,WAAW,IAAI,CAAC;CACpC;AACD"}
@@ -1,2 +1,2 @@
1
- import { i as renderLoweredSql } from "./adapter-gpb0ICA2-Ddnczc5D.mjs";
1
+ import { i as renderLoweredSql } from "./adapter-C6ceXocc-DA8E7YzK.mjs";
2
2
  export { renderLoweredSql };
@@ -33,7 +33,7 @@ declare const sqliteAggregateDescriptors: readonly [{
33
33
  readonly operation: "sum";
34
34
  readonly input: {
35
35
  readonly kind: "codec";
36
- readonly codecId: "sql/int@1" | "sqlite/integer@1" | "sqlite/bigint@1" | "sqlite/bigintnumber@1";
36
+ readonly codecId: "sql/int@1" | "sqlite/bigintnumber@1" | "sqlite/bigint@1" | "sqlite/integer@1";
37
37
  };
38
38
  readonly output: {
39
39
  readonly kind: "codec";
@@ -44,7 +44,7 @@ declare const sqliteAggregateDescriptors: readonly [{
44
44
  readonly operation: "sumBigInt";
45
45
  readonly input: {
46
46
  readonly kind: "codec";
47
- readonly codecId: "sql/int@1" | "sqlite/integer@1" | "sqlite/bigint@1" | "sqlite/bigintnumber@1";
47
+ readonly codecId: "sql/int@1" | "sqlite/bigintnumber@1" | "sqlite/bigint@1" | "sqlite/integer@1";
48
48
  };
49
49
  readonly output: {
50
50
  readonly kind: "codec";
@@ -69,7 +69,7 @@ declare const sqliteAggregateDescriptors: readonly [{
69
69
  readonly operation: "avg";
70
70
  readonly input: {
71
71
  readonly kind: "codec";
72
- readonly codecId: "sql/int@1" | "sql/float@1" | "sqlite/integer@1" | "sqlite/bigint@1" | "sqlite/real@1" | "sqlite/bigintnumber@1";
72
+ readonly codecId: "sql/int@1" | "sql/float@1" | "sqlite/bigintnumber@1" | "sqlite/bigint@1" | "sqlite/integer@1" | "sqlite/real@1";
73
73
  };
74
74
  readonly output: {
75
75
  readonly kind: "codec";
@@ -100,7 +100,7 @@ declare const sqliteAggregateDescriptors: readonly [{
100
100
  readonly operation: "min";
101
101
  readonly input: {
102
102
  readonly kind: "codec";
103
- readonly codecId: "sqlite/json@1" | "sqlite/blob@1" | "sqlite/datetime@1" | "sqlite/datetime-temporal@1" | "sqlite/datetime-string@1" | "sqlite/date-string@1" | "sqlite/date-temporal@1" | "sqlite/time-string@1" | "sqlite/time-temporal@1";
103
+ readonly codecId: "sqlite/datetime@1" | "sqlite/datetime-temporal@1" | "sqlite/datetime-string@1" | "sqlite/date-string@1" | "sqlite/date-temporal@1" | "sqlite/time-string@1" | "sqlite/time-temporal@1" | "sqlite/json@1" | "sqlite/blob@1";
104
104
  };
105
105
  readonly output: {
106
106
  readonly kind: "self";
@@ -141,7 +141,7 @@ declare const sqliteAggregateDescriptors: readonly [{
141
141
  readonly operation: "max";
142
142
  readonly input: {
143
143
  readonly kind: "codec";
144
- readonly codecId: "sqlite/json@1" | "sqlite/blob@1" | "sqlite/datetime@1" | "sqlite/datetime-temporal@1" | "sqlite/datetime-string@1" | "sqlite/date-string@1" | "sqlite/date-temporal@1" | "sqlite/time-string@1" | "sqlite/time-temporal@1";
144
+ readonly codecId: "sqlite/datetime@1" | "sqlite/datetime-temporal@1" | "sqlite/datetime-string@1" | "sqlite/date-string@1" | "sqlite/date-temporal@1" | "sqlite/time-string@1" | "sqlite/time-temporal@1" | "sqlite/json@1" | "sqlite/blob@1";
145
145
  };
146
146
  readonly output: {
147
147
  readonly kind: "self";
@@ -161,4 +161,4 @@ declare const sqliteAggregateDescriptors: readonly [{
161
161
  }];
162
162
  //#endregion
163
163
  export { sqliteAggregateDescriptors as t };
164
- //# sourceMappingURL=aggregates-DNxUFwla.d.mts.map
164
+ //# sourceMappingURL=aggregates-Bee9csBL.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aggregates-DNxUFwla.d.mts","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/aggregates.d.mts"],"mappings":";;;;;;cAKc;WACH;WACA;aACE;;WAEF;aACE;aACA;;WAEF;WACA;WACA,OAAO;;WAEP;WACA;aACE;;WAEF;aACE;aACA;;WAEF;WACA;WACA,OAAO;;WAEP,QAAQ;WACR;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;WACA,OAAO;;WAEP,QAAQ;WACR;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,QAAQ;WACR;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;WACA,OAAO;;WAEP;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;WACA,OAAO"}
1
+ {"version":3,"file":"aggregates-Bee9csBL.d.mts","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/aggregates.d.mts"],"mappings":";;;;;;cAKc;WACH;WACA;aACE;;WAEF;aACE;aACA;;WAEF;WACA;WACA,OAAO;;WAEP;WACA;aACE;;WAEF;aACE;aACA;;WAEF;WACA;WACA,OAAO;;WAEP,QAAQ;WACR;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;WACA,OAAO;;WAEP,QAAQ;WACR;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,QAAQ;WACR;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;WACA,OAAO;;WAEP;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;WACA,OAAO"}
@@ -1,5 +1,5 @@
1
1
  import { t as sqliteAggregateDescriptors } from "./aggregates-DMvLJFlR.mjs";
2
- //#region ../../../3-targets/sqlite/2-adapter/dist/contract-contributions-wweWdXMK.mjs
2
+ //#region ../../../3-targets/sqlite/2-adapter/dist/contract-contributions-DT76ePH3.mjs
3
3
  const sqliteAdapterCapabilities = Object.freeze({ sql: {
4
4
  orderBy: true,
5
5
  limit: true,
@@ -9,7 +9,8 @@ const sqliteAdapterCapabilities = Object.freeze({ sql: {
9
9
  foreignKeys: true,
10
10
  enums: false,
11
11
  insertOnConflictSkip: true,
12
- insertOnConflictWithoutTarget: true
12
+ insertOnConflictWithoutTarget: true,
13
+ insertOnConflictTarget: true
13
14
  } });
14
15
  /**
15
16
  * What this adapter adds to every contract it runs: its capabilities and the aggregate overloads it lists. `prisma contract emit` reads them through the adapter's descriptor, and the TypeScript `defineContract` passes them to the contract build.
@@ -21,4 +22,4 @@ const sqliteAdapterContractContributions = {
21
22
  //#endregion
22
23
  export { sqliteAdapterContractContributions as n, sqliteAdapterCapabilities as t };
23
24
 
24
- //# sourceMappingURL=contract-contributions-wweWdXMK-CwYZg4jC.mjs.map
25
+ //# sourceMappingURL=contract-contributions-DT76ePH3-BI96J32-.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-contributions-DT76ePH3-BI96J32-.mjs","names":[],"sources":["../../../../3-targets/sqlite/2-adapter/dist/contract-contributions-DT76ePH3.mjs"],"sourcesContent":["import { sqliteAggregateDescriptors } from \"@internal/target-sqlite/aggregates\";\n//#region src/core/capabilities.ts\nconst sqliteAdapterCapabilities = Object.freeze({ sql: {\n\torderBy: true,\n\tlimit: true,\n\tlateral: false,\n\tjsonAgg: true,\n\treturning: true,\n\tforeignKeys: true,\n\tenums: false,\n\tinsertOnConflictSkip: true,\n\tinsertOnConflictWithoutTarget: true,\n\tinsertOnConflictTarget: true\n} });\n//#endregion\n//#region src/core/contract-contributions.ts\n/**\n* What this adapter adds to every contract it runs: its capabilities and the aggregate overloads it lists. `prisma contract emit` reads them through the adapter's descriptor, and the TypeScript `defineContract` passes them to the contract build.\n*/\nconst sqliteAdapterContractContributions = {\n\tcapabilities: sqliteAdapterCapabilities,\n\ttypes: { aggregateDescriptors: sqliteAggregateDescriptors }\n};\n//#endregion\nexport { sqliteAdapterCapabilities as n, sqliteAdapterContractContributions as t };\n\n//# sourceMappingURL=contract-contributions-DT76ePH3.mjs.map"],"mappings":";;AAEA,MAAM,4BAA4B,OAAO,OAAO,EAAE,KAAK;CACtD,SAAS;CACT,OAAO;CACP,SAAS;CACT,SAAS;CACT,WAAW;CACX,aAAa;CACb,OAAO;CACP,sBAAsB;CACtB,+BAA+B;CAC/B,wBAAwB;AACzB,EAAE,CAAC;;;;AAMH,MAAM,qCAAqC;CAC1C,cAAc;CACd,OAAO,EAAE,sBAAsB,2BAA2B;AAC3D"}
@@ -1,6 +1,6 @@
1
1
  import { a as sqliteCodecRegistry } from "./codecs-BhRFtE69.mjs";
2
- import { n as sqliteAdapterContractContributions } from "./contract-contributions-wweWdXMK-CwYZg4jC.mjs";
3
- //#region ../../../3-targets/sqlite/2-adapter/dist/descriptor-meta-DrNwC4vO.mjs
2
+ import { n as sqliteAdapterContractContributions } from "./contract-contributions-DT76ePH3-BI96J32-.mjs";
3
+ //#region ../../../3-targets/sqlite/2-adapter/dist/descriptor-meta-CKqpcoZL.mjs
4
4
  const sqliteAdapterDescriptorMeta = {
5
5
  kind: "adapter",
6
6
  familyId: "sql",
@@ -23,4 +23,4 @@ const sqliteAdapterDescriptorMeta = {
23
23
  //#endregion
24
24
  export { sqliteAdapterDescriptorMeta as t };
25
25
 
26
- //# sourceMappingURL=descriptor-meta-DrNwC4vO-C_RZ1Tmp.mjs.map
26
+ //# sourceMappingURL=descriptor-meta-CKqpcoZL-D82JbePf.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"descriptor-meta-DrNwC4vO-C_RZ1Tmp.mjs","names":[],"sources":["../../../../3-targets/sqlite/2-adapter/dist/descriptor-meta-DrNwC4vO.mjs"],"sourcesContent":["import { t as sqliteAdapterContractContributions } from \"./contract-contributions-wweWdXMK.mjs\";\nimport { sqliteCodecRegistry } from \"@internal/target-sqlite/codecs\";\n//#region src/core/descriptor-meta.ts\nconst sqliteAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"sqlite\",\n\tid: \"sqlite\",\n\tversion: \"0.0.1\",\n\tcapabilities: sqliteAdapterContractContributions.capabilities,\n\ttypes: {\n\t\taggregateDescriptors: sqliteAdapterContractContributions.types.aggregateDescriptors,\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(sqliteCodecRegistry.values()),\n\t\t\timport: {\n\t\t\t\tpackage: \"@internal/adapter-sqlite/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"SqliteTypes\"\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\nexport { sqliteAdapterDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-DrNwC4vO.mjs.map"],"mappings":";;;AAGA,MAAM,8BAA8B;CACnC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,mCAAmC;CACjD,OAAO;EACN,sBAAsB,mCAAmC,MAAM;EAC/D,YAAY;GACX,kBAAkB,MAAM,KAAK,oBAAoB,OAAO,CAAC;GACzD,QAAQ;IACP,SAAS;IACT,OAAO;IACP,OAAO;GACR;EACD;CACD;AACD"}
1
+ {"version":3,"file":"descriptor-meta-CKqpcoZL-D82JbePf.mjs","names":[],"sources":["../../../../3-targets/sqlite/2-adapter/dist/descriptor-meta-CKqpcoZL.mjs"],"sourcesContent":["import { t as sqliteAdapterContractContributions } from \"./contract-contributions-DT76ePH3.mjs\";\nimport { sqliteCodecRegistry } from \"@internal/target-sqlite/codecs\";\n//#region src/core/descriptor-meta.ts\nconst sqliteAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"sqlite\",\n\tid: \"sqlite\",\n\tversion: \"0.0.1\",\n\tcapabilities: sqliteAdapterContractContributions.capabilities,\n\ttypes: {\n\t\taggregateDescriptors: sqliteAdapterContractContributions.types.aggregateDescriptors,\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(sqliteCodecRegistry.values()),\n\t\t\timport: {\n\t\t\t\tpackage: \"@internal/adapter-sqlite/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"SqliteTypes\"\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\nexport { sqliteAdapterDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-CKqpcoZL.mjs.map"],"mappings":";;;AAGA,MAAM,8BAA8B;CACnC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,mCAAmC;CACjD,OAAO;EACN,sBAAsB,mCAAmC,MAAM;EAC/D,YAAY;GACX,kBAAkB,MAAM,KAAK,oBAAoB,OAAO,CAAC;GACzD,QAAQ;IACP,SAAS;IACT,OAAO;IACP,OAAO;GACR;EACD;CACD;AACD"}
@@ -45,7 +45,12 @@ var SqliteQueryable = class {
45
45
  try {
46
46
  const stmt = this.db.prepare(request.sql);
47
47
  if (stmt.columns().length !== 0) throw new InternalError("SQLite cannot execute statements that return rows.");
48
- return { affectedRows: Number(stmt.run(...sqliteParams(request.params)).changes) };
48
+ const { changes, lastInsertRowid } = stmt.run(...sqliteParams(request.params));
49
+ const affectedRows = Number(changes);
50
+ return affectedRows === 1 ? {
51
+ affectedRows,
52
+ insertId: String(lastInsertRowid)
53
+ } : { affectedRows };
49
54
  } catch (error) {
50
55
  throw normalizeSqliteError(error, wasClosedByDriver(this.db));
51
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"driver__runtime.mjs","names":["#state","#requireConnected"],"sources":["../../../../3-targets/sqlite/3-driver/dist/runtime.mjs"],"sourcesContent":["import { a as wasClosedByDriver, i as closeDatabase, n as sqliteParams, r as normalizeSqliteError, t as sqliteDriverDescriptorMeta } from \"./descriptor-meta-Drr6Abaf.mjs\";\nimport { DatabaseSync } from \"node:sqlite\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/sqlite-driver.ts\nfunction driverError(code, message, details) {\n\tconst error = new Error(message);\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"RuntimeError\",\n\t\tconfigurable: true\n\t});\n\treturn Object.assign(error, {\n\t\tcode,\n\t\tcategory: \"DRIVER\",\n\t\tseverity: \"error\",\n\t\tmessage,\n\t\tdetails\n\t});\n}\nconst NOT_CONNECTED_MESSAGE = \"SQLite driver not connected. Call connect(binding) before acquireConnection or execute.\";\nconst ALREADY_CONNECTED_MESSAGE = \"SQLite driver already connected. Call close() before reconnecting with a new binding.\";\nfunction openConnection(path) {\n\ttry {\n\t\tconst db = new DatabaseSync(path);\n\t\tdb.exec(\"PRAGMA foreign_keys = ON\");\n\t\tdb.exec(\"PRAGMA busy_timeout = 5000\");\n\t\treturn db;\n\t} catch (error) {\n\t\tthrow normalizeSqliteError(error, false);\n\t}\n}\nvar SqliteQueryable = class {\n\tdb;\n\tconstructor(db) {\n\t\tthis.db = db;\n\t}\n\tasync *query(request) {\n\t\ttry {\n\t\t\tconst stmt = this.db.prepare(request.sql);\n\t\t\tfor (const row of stmt.iterate(...sqliteParams(request.params))) yield row;\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n\tasync execute(request) {\n\t\ttry {\n\t\t\tconst stmt = this.db.prepare(request.sql);\n\t\t\tif (stmt.columns().length !== 0) throw new InternalError(\"SQLite cannot execute statements that return rows.\");\n\t\t\treturn { affectedRows: Number(stmt.run(...sqliteParams(request.params)).changes) };\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n\tasync explain(request) {\n\t\ttry {\n\t\t\treturn { rows: this.db.prepare(`EXPLAIN QUERY PLAN ${request.sql}`).all(...sqliteParams(request.params)) };\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n};\nvar SqliteConnectionImpl = class extends SqliteQueryable {\n\tasync beginTransaction() {\n\t\ttry {\n\t\t\tthis.db.exec(\"BEGIN\");\n\t\t\treturn new SqliteTransactionImpl(this.db);\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n\tasync release() {\n\t\treturn this.destroy();\n\t}\n\tasync destroy(_reason) {\n\t\ttry {\n\t\t\tcloseDatabase(this.db);\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n};\nvar SqliteTransactionImpl = class extends SqliteQueryable {\n\tasync commit() {\n\t\ttry {\n\t\t\tthis.db.exec(\"COMMIT\");\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n\tasync rollback() {\n\t\ttry {\n\t\t\tthis.db.exec(\"ROLLBACK\");\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n};\nfunction unboundQuery() {\n\treturn { [Symbol.asyncIterator]() {\n\t\treturn { async next() {\n\t\t\tthrow driverError(\"DRIVER.NOT_CONNECTED\", NOT_CONNECTED_MESSAGE);\n\t\t} };\n\t} };\n}\nvar SqliteDriver = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"sqlite\";\n\t#state;\n\tconstructor(initialState) {\n\t\tthis.#state = initialState ?? { kind: \"unbound\" };\n\t}\n\t#requireConnected() {\n\t\tif (this.#state.kind !== \"connected\") throw driverError(\"DRIVER.NOT_CONNECTED\", NOT_CONNECTED_MESSAGE);\n\t\treturn this.#state;\n\t}\n\tget state() {\n\t\treturn this.#state.kind;\n\t}\n\tasync connect(binding) {\n\t\tif (this.#state.kind === \"connected\") throw driverError(\"DRIVER.ALREADY_CONNECTED\", ALREADY_CONNECTED_MESSAGE, { bindingKind: binding.kind });\n\t\tthis.#state = {\n\t\t\tkind: \"connected\",\n\t\t\tpath: binding.path,\n\t\t\tconn: new SqliteConnectionImpl(openConnection(binding.path))\n\t\t};\n\t}\n\tasync acquireConnection() {\n\t\tconst { path } = this.#requireConnected();\n\t\treturn new SqliteConnectionImpl(openConnection(path));\n\t}\n\tasync close() {\n\t\tif (this.#state.kind !== \"connected\") return;\n\t\tconst { conn } = this.#state;\n\t\tthis.#state = { kind: \"closed\" };\n\t\tawait conn.release();\n\t}\n\tquery(request) {\n\t\tif (this.#state.kind !== \"connected\") return unboundQuery();\n\t\treturn this.#state.conn.query(request);\n\t}\n\tasync execute(request) {\n\t\treturn this.#requireConnected().conn.execute(request);\n\t}\n\tasync explain(request) {\n\t\treturn this.#requireConnected().conn.explain(request);\n\t}\n};\n//#endregion\n//#region src/core/runtime/runtime-driver.ts\nconst sqliteRuntimeDriverDescriptor = {\n\t...sqliteDriverDescriptorMeta,\n\tcreate() {\n\t\treturn new SqliteDriver();\n\t}\n};\n//#endregion\nexport { sqliteRuntimeDriverDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;AAIA,SAAS,YAAY,MAAM,SAAS,SAAS;CAC5C,MAAM,QAAQ,IAAI,MAAM,OAAO;CAC/B,OAAO,eAAe,OAAO,QAAQ;EACpC,OAAO;EACP,cAAc;CACf,CAAC;CACD,OAAO,OAAO,OAAO,OAAO;EAC3B;EACA,UAAU;EACV,UAAU;EACV;EACA;CACD,CAAC;AACF;AACA,MAAM,wBAAwB;AAC9B,MAAM,4BAA4B;AAClC,SAAS,eAAe,MAAM;CAC7B,IAAI;EACH,MAAM,KAAK,IAAI,aAAa,IAAI;EAChC,GAAG,KAAK,0BAA0B;EAClC,GAAG,KAAK,4BAA4B;EACpC,OAAO;CACR,SAAS,OAAO;EACf,MAAM,qBAAqB,OAAO,KAAK;CACxC;AACD;AACA,IAAI,kBAAkB,MAAM;CAC3B;CACA,YAAY,IAAI;EACf,KAAK,KAAK;CACX;CACA,OAAO,MAAM,SAAS;EACrB,IAAI;GACH,MAAM,OAAO,KAAK,GAAG,QAAQ,QAAQ,GAAG;GACxC,KAAK,MAAM,OAAO,KAAK,QAAQ,GAAG,aAAa,QAAQ,MAAM,CAAC,GAAG,MAAM;EACxE,SAAS,OAAO;GACf,MAAM,qBAAqB,OAAO,kBAAkB,KAAK,EAAE,CAAC;EAC7D;CACD;CACA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,KAAKA,kBAAkB,CAAC,CAAC,KAAK,QAAQ,OAAO;CACrD;AACD;AAGA,MAAM,gCAAgC;CACrC,GAAG;CACH,SAAS;EACR,OAAO,IAAI,aAAa;CACzB;AACD"}
1
+ {"version":3,"file":"driver__runtime.mjs","names":["#state","#requireConnected"],"sources":["../../../../3-targets/sqlite/3-driver/dist/runtime.mjs"],"sourcesContent":["import { a as wasClosedByDriver, i as closeDatabase, n as sqliteParams, r as normalizeSqliteError, t as sqliteDriverDescriptorMeta } from \"./descriptor-meta-Drr6Abaf.mjs\";\nimport { DatabaseSync } from \"node:sqlite\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/sqlite-driver.ts\nfunction driverError(code, message, details) {\n\tconst error = new Error(message);\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"RuntimeError\",\n\t\tconfigurable: true\n\t});\n\treturn Object.assign(error, {\n\t\tcode,\n\t\tcategory: \"DRIVER\",\n\t\tseverity: \"error\",\n\t\tmessage,\n\t\tdetails\n\t});\n}\nconst NOT_CONNECTED_MESSAGE = \"SQLite driver not connected. Call connect(binding) before acquireConnection or execute.\";\nconst ALREADY_CONNECTED_MESSAGE = \"SQLite driver already connected. Call close() before reconnecting with a new binding.\";\nfunction openConnection(path) {\n\ttry {\n\t\tconst db = new DatabaseSync(path);\n\t\tdb.exec(\"PRAGMA foreign_keys = ON\");\n\t\tdb.exec(\"PRAGMA busy_timeout = 5000\");\n\t\treturn db;\n\t} catch (error) {\n\t\tthrow normalizeSqliteError(error, false);\n\t}\n}\nvar SqliteQueryable = class {\n\tdb;\n\tconstructor(db) {\n\t\tthis.db = db;\n\t}\n\tasync *query(request) {\n\t\ttry {\n\t\t\tconst stmt = this.db.prepare(request.sql);\n\t\t\tfor (const row of stmt.iterate(...sqliteParams(request.params))) yield row;\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n\tasync execute(request) {\n\t\ttry {\n\t\t\tconst stmt = this.db.prepare(request.sql);\n\t\t\tif (stmt.columns().length !== 0) throw new InternalError(\"SQLite cannot execute statements that return rows.\");\n\t\t\tconst { changes, lastInsertRowid } = stmt.run(...sqliteParams(request.params));\n\t\t\tconst affectedRows = Number(changes);\n\t\t\treturn affectedRows === 1 ? {\n\t\t\t\taffectedRows,\n\t\t\t\tinsertId: String(lastInsertRowid)\n\t\t\t} : { affectedRows };\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n\tasync explain(request) {\n\t\ttry {\n\t\t\treturn { rows: this.db.prepare(`EXPLAIN QUERY PLAN ${request.sql}`).all(...sqliteParams(request.params)) };\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n};\nvar SqliteConnectionImpl = class extends SqliteQueryable {\n\tasync beginTransaction() {\n\t\ttry {\n\t\t\tthis.db.exec(\"BEGIN\");\n\t\t\treturn new SqliteTransactionImpl(this.db);\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n\tasync release() {\n\t\treturn this.destroy();\n\t}\n\tasync destroy(_reason) {\n\t\ttry {\n\t\t\tcloseDatabase(this.db);\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n};\nvar SqliteTransactionImpl = class extends SqliteQueryable {\n\tasync commit() {\n\t\ttry {\n\t\t\tthis.db.exec(\"COMMIT\");\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n\tasync rollback() {\n\t\ttry {\n\t\t\tthis.db.exec(\"ROLLBACK\");\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n};\nfunction unboundQuery() {\n\treturn { [Symbol.asyncIterator]() {\n\t\treturn { async next() {\n\t\t\tthrow driverError(\"DRIVER.NOT_CONNECTED\", NOT_CONNECTED_MESSAGE);\n\t\t} };\n\t} };\n}\nvar SqliteDriver = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"sqlite\";\n\t#state;\n\tconstructor(initialState) {\n\t\tthis.#state = initialState ?? { kind: \"unbound\" };\n\t}\n\t#requireConnected() {\n\t\tif (this.#state.kind !== \"connected\") throw driverError(\"DRIVER.NOT_CONNECTED\", NOT_CONNECTED_MESSAGE);\n\t\treturn this.#state;\n\t}\n\tget state() {\n\t\treturn this.#state.kind;\n\t}\n\tasync connect(binding) {\n\t\tif (this.#state.kind === \"connected\") throw driverError(\"DRIVER.ALREADY_CONNECTED\", ALREADY_CONNECTED_MESSAGE, { bindingKind: binding.kind });\n\t\tthis.#state = {\n\t\t\tkind: \"connected\",\n\t\t\tpath: binding.path,\n\t\t\tconn: new SqliteConnectionImpl(openConnection(binding.path))\n\t\t};\n\t}\n\tasync acquireConnection() {\n\t\tconst { path } = this.#requireConnected();\n\t\treturn new SqliteConnectionImpl(openConnection(path));\n\t}\n\tasync close() {\n\t\tif (this.#state.kind !== \"connected\") return;\n\t\tconst { conn } = this.#state;\n\t\tthis.#state = { kind: \"closed\" };\n\t\tawait conn.release();\n\t}\n\tquery(request) {\n\t\tif (this.#state.kind !== \"connected\") return unboundQuery();\n\t\treturn this.#state.conn.query(request);\n\t}\n\tasync execute(request) {\n\t\treturn this.#requireConnected().conn.execute(request);\n\t}\n\tasync explain(request) {\n\t\treturn this.#requireConnected().conn.explain(request);\n\t}\n};\n//#endregion\n//#region src/core/runtime/runtime-driver.ts\nconst sqliteRuntimeDriverDescriptor = {\n\t...sqliteDriverDescriptorMeta,\n\tcreate() {\n\t\treturn new SqliteDriver();\n\t}\n};\n//#endregion\nexport { sqliteRuntimeDriverDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;AAIA,SAAS,YAAY,MAAM,SAAS,SAAS;CAC5C,MAAM,QAAQ,IAAI,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EACrG,OAAO,KAAKA;CACb;CACA,IAAI,QAAQ;EACX,OAAO,KAAKA,OAAO;CACpB;CACA,MAAM,QAAQ,SAAS;EACtB,IAAI,KAAKA,OAAO,SAAS,aAAa,MAAM,YAAY,4BAA4B,2BAA2B,EAAE,aAAa,QAAQ,KAAK,CAAC;EAC5I,KAAKA,SAAS;GACb,MAAM;GACN,MAAM,QAAQ;GACd,MAAM,IAAI,qBAAqB,eAAe,QAAQ,IAAI,CAAC;EAC5D;CACD;CACA,MAAM,oBAAoB;EACzB,MAAM,EAAE,SAAS,KAAKC,kBAAkB;EACxC,OAAO,IAAI,qBAAqB,eAAe,IAAI,CAAC;CACrD;CACA,MAAM,QAAQ;EACb,IAAI,KAAKD,OAAO,SAAS,aAAa;EACtC,MAAM,EAAE,SAAS,KAAKA;EACtB,KAAKA,SAAS,EAAE,MAAM,SAAS;EAC/B,MAAM,KAAK,QAAQ;CACpB;CACA,MAAM,SAAS;EACd,IAAI,KAAKA,OAAO,SAAS,aAAa,OAAO,aAAa;EAC1D,OAAO,KAAKA,OAAO,KAAK,MAAM,OAAO;CACtC;CACA,MAAM,QAAQ,SAAS;EACtB,OAAO,KAAKC,kBAAkB,CAAC,CAAC,KAAK,QAAQ,OAAO;CACrD;CACA,MAAM,QAAQ,SAAS;EACtB,OAAO,KAAKA,kBAAkB,CAAC,CAAC,KAAK,QAAQ,OAAO;CACrD;AACD;AAGA,MAAM,gCAAgC;CACrC,GAAG;CACH,SAAS;EACR,OAAO,IAAI,aAAa;CACzB;AACD"}
package/dist/target.d.mts CHANGED
@@ -10,7 +10,7 @@ import "./codec-types-IproBv-Q.mjs";
10
10
  import "./codec-ids-9Fs9p6ST.mjs";
11
11
  import { n as quoteIdentifier, t as escapeLiteral } from "./sql-utils-BqHka8P6.mjs";
12
12
  import { n as readSqliteDefault, r as sqliteResolveDefault, t as SqliteReportedDefault } from "./default-normalizer-CtNsZNRZ.mjs";
13
- import { t as sqliteAggregateDescriptors } from "./aggregates-DNxUFwla.mjs";
13
+ import { t as sqliteAggregateDescriptors } from "./aggregates-Bee9csBL.mjs";
14
14
  import { a as buildSignMarkerBootstrapQueries, c as datetime, d as jsonText, f as sqliteTable, i as buildControlTableBootstrapQueries, l as indexExistsAst, m as text, n as IndexExistsCheckBuilder, o as columnExistsAst, p as tableExistsAst, r as TableExistsCheckBuilder, s as createTable, t as ColumnExistsCheckBuilder, u as integer } from "./contract-free-IqKgq8Pk.mjs";
15
15
  import { n as buildTargetDetails, t as SqlitePlanTargetDetails } from "./planner-target-details-B-qtfkmj-DIGpv7YQ.mjs";
16
16
  import { n as sqliteScalarTypeConstructors } from "./control-DGa_C2q6.mjs";
@@ -1,2 +1,2 @@
1
- import { t as sqliteAggregateDescriptors } from "./aggregates-DNxUFwla.mjs";
1
+ import { t as sqliteAggregateDescriptors } from "./aggregates-Bee9csBL.mjs";
2
2
  export { sqliteAggregateDescriptors };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-target-sqlite",
3
- "version": "8.0.0-rc.22-dev.10",
3
+ "version": "8.0.0-rc.22-dev.11",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -9,21 +9,21 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@prisma/orm-family-sql": "8.0.0-rc.22-dev.10",
13
- "@prisma/orm-framework": "8.0.0-rc.22-dev.10",
14
- "@prisma/orm-toolchain": "8.0.0-rc.22-dev.10",
12
+ "@prisma/orm-family-sql": "8.0.0-rc.22-dev.11",
13
+ "@prisma/orm-framework": "8.0.0-rc.22-dev.11",
14
+ "@prisma/orm-toolchain": "8.0.0-rc.22-dev.11",
15
15
  "@standard-schema/spec": "1.1.0",
16
16
  "arktype": "^2.2.2",
17
17
  "pathe": "^2.0.3",
18
18
  "temporal-spec": "1.0.1"
19
19
  },
20
20
  "devDependencies": {
21
- "@internal/adapter-sqlite": "8.0.0-rc.22-dev.10",
22
- "@internal/driver-sqlite": "8.0.0-rc.22-dev.10",
23
- "@internal/target-sqlite": "8.0.0-rc.22-dev.10",
24
- "@repo/test-utils": "8.0.0-rc.22-dev.10",
25
- "@repo/tsconfig": "8.0.0-rc.22-dev.10",
26
- "@repo/tsdown": "8.0.0-rc.22-dev.10",
21
+ "@internal/adapter-sqlite": "8.0.0-rc.22-dev.11",
22
+ "@internal/driver-sqlite": "8.0.0-rc.22-dev.11",
23
+ "@internal/target-sqlite": "8.0.0-rc.22-dev.11",
24
+ "@repo/test-utils": "8.0.0-rc.22-dev.11",
25
+ "@repo/tsconfig": "8.0.0-rc.22-dev.11",
26
+ "@repo/tsdown": "8.0.0-rc.22-dev.11",
27
27
  "tsdown": "0.22.14",
28
28
  "typescript": "5.9.3",
29
29
  "vitest": "5.0.0-rc.2"
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter-BLfNDWw-.d.mts","names":[],"sources":["../../../../3-targets/sqlite/2-adapter/dist/adapter.d.mts"],"mappings":";;;;cAGc,2BAA2B;WAC9B;aACE;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA;;;;;;;;cAQC;WACH,cAAc;aACZ;eACE;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;;;WAGJ;aACE;eACE;eACA;iBACE;;eAEF;iBACE;iBACA;;eAEF;eACA;eACA,6EAA6E;;eAE7E;eACA;iBACE;;eAEF;iBACE;iBACA;;eAEF;eACA;eACA,6EAA6E;;eAE7E,8EAA8E;eAC9E;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;eACA,6EAA6E;;eAE7E,8EAA8E;eAC9E;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA,8EAA8E;eAC9E;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;eACA,6EAA6E;;eAE7E;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;eACA,6EAA6E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter-gpb0ICA2-Ddnczc5D.mjs","names":["#codecs"],"sources":["../../../../3-targets/sqlite/2-adapter/dist/adapter-gpb0ICA2.mjs"],"sourcesContent":["import { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { RawExpr, collectOrderedParamRefs, encodeLiteralDefault, isDdlNode, renderOpaqueSql } from \"@internal/sql-relational-core/ast\";\nimport { SQLITE_NOW_EXPRESSION, createSqliteCodecRegistryWithBuiltins, jsonDocumentRetag, sqliteCodecRegistry, sqliteNowExpressionFor } from \"@internal/target-sqlite/codecs\";\nimport { sqliteDataTypes } from \"@internal/target-sqlite/data-types\";\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 { parseMarkerRowSafely, withMarkerReadErrorHandling } from \"@internal/errors/execution\";\nimport { checkSqlDefaultText, contractColumns, readColumnDefault } from \"@internal/family-sql/control\";\nimport { resolveIntrospectedColumnType } from \"@internal/family-sql/control-adapter\";\nimport { parseContractMarkerRow } from \"@internal/family-sql/verify\";\nimport { codecForRef } from \"@internal/framework-components/codec\";\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 { readSqliteDefault } from \"@internal/target-sqlite/default-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 ../../../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: [SQLITE_NOW_EXPRESSION],\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\tmarkerLocation = SQLITE_MARKER_TABLE;\n\tcodecRegistry;\n\tdeclaredDataTypes;\n\t/** `declaredDataTypes` are the stack's data types in assembly order, which introspection resolves each column's reported type over. */\n\tconstructor(codecRegistry, declaredDataTypes) {\n\t\tthis.codecRegistry = codecRegistry;\n\t\tthis.declaredDataTypes = declaredDataTypes;\n\t}\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\tasync renderColumnDefault(column, table) {\n\t\tif (column.default === void 0) return \"\";\n\t\treturn sqliteRenderDdlColumnDefault(column.default, this.codecRegistry, column.codecRef, {\n\t\t\ttable,\n\t\t\tcolumn: column.name\n\t\t});\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 numbered `?N` 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\tasync withTransaction(driver, fn) {\n\t\tawait driver.query(\"BEGIN IMMEDIATE\");\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await fn();\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tawait driver.query(\"ROLLBACK\");\n\t\t\t} catch (rollbackError) {\n\t\t\t\tif (error instanceof Error && error.cause === void 0) error.cause = rollbackError;\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tawait driver.query(\"COMMIT\");\n\t\treturn result;\n\t}\n\tasync lockMarker(_driver) {}\n\t/**\n\t* Appends a ledger entry for `space`. See the `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\t/**\n\t* Reads a column's reported default: a function or SQL NULL as itself, and a literal with the column's codec, when the contract declares the column. A literal of a column the contract does not declare keeps only its raw text. When the contract's default is an expression that writes a literal, the codec reads that literal too, for the diff to compare the two values.\n\t*/\n\tasync readReportedDefault(rawDefault, declaredType, column) {\n\t\tconst reported = readSqliteDefault(rawDefault, declaredType);\n\t\tif (reported.kind === \"function\") return { resolvedDefault: reported };\n\t\tif (reported.kind === \"null\") return { resolvedDefault: {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: null\n\t\t} };\n\t\tconst codec = column === void 0 ? void 0 : codecForRef(this.codecRegistry, column.codecRef);\n\t\tif (codec === void 0) return {};\n\t\tconst expression = column?.defaultExpression;\n\t\tconst written = expression === void 0 ? void 0 : readSqliteDefault(expression, declaredType);\n\t\treturn readColumnDefault(codec, {\n\t\t\tliteral: reported.literal,\n\t\t\traw: rawDefault\n\t\t}, expression !== void 0 && written?.kind === \"literal\" ? {\n\t\t\tliteral: written.literal,\n\t\t\texpression\n\t\t} : void 0);\n\t}\n\tasync introspect(driver, contract) {\n\t\tconst contractColumnsOf = contractColumns(contract);\n\t\tconst tablesResult = await driver.query(`SELECT name, sql 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(${quoteIdentifier(tableName)})`);\n\t\t\tconst fkResult = await driver.query(`PRAGMA foreign_key_list(${quoteIdentifier(tableName)})`);\n\t\t\tconst indexListResult = await driver.query(`PRAGMA index_list(${quoteIdentifier(tableName)})`);\n\t\t\tconst columns = {};\n\t\t\tconst pkColumns = [];\n\t\t\tconst autoincrementColumn = autoincrementColumnOf(tableRow.sql, columnsResult.rows);\n\t\t\tfor (const col of columnsResult.rows) {\n\t\t\t\tconst rawDefault = col.dflt_value ?? void 0;\n\t\t\t\tconst readDefault = col.name === autoincrementColumn ? { resolvedDefault: AUTOINCREMENT_DEFAULT } : rawDefault === void 0 ? {} : await this.readReportedDefault(rawDefault, col.type, contractColumnsOf.columnOf(void 0, tableName, col.name));\n\t\t\t\tconst reportedType = {\n\t\t\t\t\ttext: col.type,\n\t\t\t\t\tkind: void 0,\n\t\t\t\t\tschema: void 0,\n\t\t\t\t\tname: void 0\n\t\t\t\t};\n\t\t\t\tcolumns[col.name] = {\n\t\t\t\t\tname: col.name,\n\t\t\t\t\ttypeText: 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\t...readDefault,\n\t\t\t\t\treportedType,\n\t\t\t\t\t...resolveIntrospectedColumnType(reportedType, this.declaredDataTypes)\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(${quoteIdentifier(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};\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, where) {\n\tif (wire === null) return \"NULL\";\n\tif (typeof wire === \"boolean\") return wire ? \"1\" : \"0\";\n\tif (typeof wire === \"number\") {\n\t\tif (Number.isNaN(wire)) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", `Column \"${where.table}\".\"${where.column}\" has a NaN default, which SQLite stores as NULL`, { meta: {\n\t\t\ttable: where.table,\n\t\t\tcolumn: where.column,\n\t\t\tvalue: \"NaN\",\n\t\t\treason: \"nan-default\"\n\t\t} });\n\t\tif (!Number.isFinite(wire)) return wire > 0 ? \"9e999\" : \"-9e999\";\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\", `Column \"${where.table}\".\"${where.column}\" has an invalid Date default`, { meta: {\n\t\t\ttable: where.table,\n\t\t\tcolumn: where.column,\n\t\t\treason: \"invalid-date-default\"\n\t\t} });\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}\nconst AUTOINCREMENT_DEFAULT = {\n\tkind: \"function\",\n\texpression: \"autoincrement()\"\n};\n/** `CREATE TABLE` text with its string literals, quoted identifiers and comments removed. */\nfunction createTableKeywords(createSql) {\n\treturn createSql.replace(/'(?:[^']|'')*'|\"(?:[^\"]|\"\")*\"|`(?:[^`]|``)*`|\\[[^\\]]*\\]|--[^\\n]*|\\/\\*[\\s\\S]*?(?:\\*\\/|$)/g, \" \");\n}\n/**\n* The column SQLite numbers with `AUTOINCREMENT`, which it keeps only in the table's `CREATE TABLE`\n* text. SQLite accepts the keyword only on a table's sole `INTEGER PRIMARY KEY` column.\n* See https://www.sqlite.org/autoinc.html.\n*/\nfunction autoincrementColumnOf(createSql, columns) {\n\tif (!createSql || !/\\bAUTOINCREMENT\\b/i.test(createTableKeywords(createSql))) return;\n\tconst primaryKey = columns.filter((column) => column.pk > 0);\n\tconst [column] = primaryKey;\n\treturn primaryKey.length === 1 && column?.type.toUpperCase() === \"INTEGER\" ? column.name : void 0;\n}\nasync function sqliteRenderDdlColumnDefault(def, codecLookup, codecRef, where) {\n\tif (def.kind === \"function\") {\n\t\tif (def.expression.text === \"autoincrement()\") return \"\";\n\t\tif (def.expression.text === \"now()\") {\n\t\t\tconst dataType = codecRef === void 0 ? void 0 : codecLookup.descriptorFor(codecRef.codecId)?.dataType;\n\t\t\tconst now = sqliteNowExpressionFor(dataType);\n\t\t\tif (now === void 0) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", `The column \"${where.table}\".\"${where.column}\" has a now() default, but its data type ${dataType} stores no date or time, so there is no current value to write. Remove the default, or give the field a date or time type.`, { meta: {\n\t\t\t\ttable: where.table,\n\t\t\t\tcolumn: where.column,\n\t\t\t\tdataType,\n\t\t\t\treason: \"now-default-not-date-or-time\"\n\t\t\t} });\n\t\t\treturn `DEFAULT (${now})`;\n\t\t}\n\t\tif (checkSqlDefaultText(def.expression.text) !== void 0) throw structuredError(\"CONTRACT.DEFAULT_INVALID\", `Unsafe default expression in contract: \"${def.expression.text}\". Default expressions must not contain semicolons, SQL comment tokens, dollar-quoting, or subqueries.`, { meta: { expression: def.expression.text } });\n\t\treturn `DEFAULT (${renderOpaqueSql(def.expression)})`;\n\t}\n\tconst encoded = codecRef === void 0 ? void 0 : await encodeLiteralDefault(codecLookup, codecRef, def.value, where);\n\tif (encoded?.kind === \"sql-null\") return \"DEFAULT NULL\";\n\tif (encoded !== void 0) return `DEFAULT ${sqliteInlineLiteral(encoded.wire, where)}`;\n\treturn `DEFAULT ${sqliteInlineLiteral(def.value, where)}`;\n}\nasync function sqliteRenderDdlColumn(column, codecLookup, table) {\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\t\ttable,\n\t\t\tcolumn: column.name\n\t\t});\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, node.table)));\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/placeholders.ts\nconst QUOTE_CLOSERS = {\n\t\"'\": \"'\",\n\t\"\\\"\": \"\\\"\",\n\t\"`\": \"`\",\n\t\"[\": \"]\"\n};\nfunction skipQuoted(sql, start, closer) {\n\tlet index = start + 1;\n\twhile (index < sql.length) {\n\t\tif (sql[index] === closer) {\n\t\t\tif (closer !== \"]\" && sql[index + 1] === closer) {\n\t\t\t\tindex += 2;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn index + 1;\n\t\t}\n\t\tindex += 1;\n\t}\n\treturn index;\n}\nfunction skipUntil(sql, start, terminator) {\n\tconst end = sql.indexOf(terminator, start);\n\treturn end === -1 ? sql.length : end + terminator.length;\n}\nfunction isDigit(char) {\n\treturn char !== void 0 && char >= \"0\" && char <= \"9\";\n}\n/** The `?` placeholders in SQLite SQL text, in the order written, skipping quoted text, quoted identifiers and comments. */\nfunction scanPlaceholders(sql) {\n\tconst placeholders = [];\n\tlet index = 0;\n\twhile (index < sql.length) {\n\t\tconst char = sql[index] ?? \"\";\n\t\tconst closer = QUOTE_CLOSERS[char];\n\t\tif (closer !== void 0) index = skipQuoted(sql, index, closer);\n\t\telse if (sql.startsWith(\"--\", index)) index = skipUntil(sql, index + 2, \"\\n\");\n\t\telse if (sql.startsWith(\"/*\", index)) index = skipUntil(sql, index + 2, \"*/\");\n\t\telse if (char === \"?\") {\n\t\t\tlet end = index + 1;\n\t\t\twhile (isDigit(sql[end])) end += 1;\n\t\t\tplaceholders.push(sql.slice(index, end));\n\t\t\tindex = end;\n\t\t} else index += 1;\n\t}\n\treturn placeholders;\n}\nconst NUMBERED_PLACEHOLDER = /^\\?([1-9]\\d*)$/;\nfunction placeholdersMatchParams(placeholders, paramCount) {\n\tconst numbers = placeholders.map((placeholder) => Number(NUMBERED_PLACEHOLDER.exec(placeholder)?.[1] ?? NaN));\n\treturn numbers.every((number) => number >= 1 && number <= paramCount) && new Set(numbers).size === paramCount;\n}\nconst REPORTED_PLACEHOLDERS = 5;\nfunction plural(count, noun) {\n\treturn `${count} ${noun}${count === 1 ? \"\" : \"s\"}`;\n}\nfunction assertPlaceholdersMatchParams(sql, paramCount) {\n\tconst placeholders = scanPlaceholders(sql);\n\tif (placeholdersMatchParams(placeholders, paramCount)) return;\n\tconst firstPlaceholders = placeholders.slice(0, REPORTED_PLACEHOLDERS);\n\tconst starting = firstPlaceholders.length > 0 ? `, starting ${firstPlaceholders.join(\", \")}` : \"\";\n\tthrow structuredError(\"RUNTIME.PARAM_PLACEHOLDER_MISMATCH\", `The lowered SQLite statement writes ${plural(placeholders.length, \"placeholder\")} for ${plural(paramCount, \"parameter\")}${starting}; each parameter must be written as its own numbered placeholder, and no other placeholder may appear.`, {\n\t\twhy: \"A placeholder that does not match a parameter binds a value to the wrong place in the statement, or leaves a value unbound.\",\n\t\tfix: \"Pass values into raw SQL through interpolation rather than writing a `?` in the SQL text.\",\n\t\tmeta: {\n\t\t\tplaceholderCount: placeholders.length,\n\t\t\tparamCount,\n\t\t\tfirstPlaceholders\n\t\t}\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\tinsertOnConflictSkip: true,\n\tinsertOnConflictWithoutTarget: true\n} });\nvar SqliteAdapterImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"sqlite\";\n\tprofile;\n\t#codecs;\n\tconstructor(codecRegistry, declaredDataTypes, profileId) {\n\t\tthis.#codecs = codecRegistry;\n\t\tconst controlAdapter = new SqliteControlAdapter(codecRegistry, declaredDataTypes);\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 orderedRefs = collectOrderedParamRefs(ast);\n\tconst placeholderNumbers = /* @__PURE__ */ new Map();\n\tconst params = orderedRefs.map((ref, index) => {\n\t\tplaceholderNumbers.set(ref, index + 1);\n\t\treturn ref.kind === \"prepared-param-ref\" ? {\n\t\t\tkind: \"bind\",\n\t\t\tname: ref.name\n\t\t} : {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: ref.value\n\t\t};\n\t});\n\tconst ctx = {\n\t\tcontract,\n\t\tcodecs,\n\t\tplaceholderNumbers\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\tcase \"raw-query\":\n\t\t\tsql = renderParts(node.parts, ctx);\n\t\t\tbreak;\n\t\tdefault: throw new InternalError(`Unsupported AST node kind: ${nodeKind(node)}`);\n\t}\n\tassertPlaceholdersMatchParams(sql, params.length);\n\treturn Object.freeze({\n\t\tsql,\n\t\tparams\n\t});\n}\nfunction renderPlaceholder(ref, ctx) {\n\tconst number = ctx.placeholderNumbers.get(ref);\n\tif (number === void 0) throw new InternalError(\"ParamRef was written but not collected from the AST\");\n\treturn `?${number}`;\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\tif (ast.locking !== void 0 && ast.locking.length > 0) throw structuredError(\"RUNTIME.AST_UNSUPPORTED\", \"SQLite has no row locks, so a select cannot carry a locking clause such as FOR UPDATE\", { meta: {\n\t\ttarget: \"sqlite\",\n\t\tfeature: \"locking-clause\"\n\t} });\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 ${renderOrderByItems(ast.orderBy, ctx)}` : \"\",\n\t\tast.limit === void 0 && ast.offset !== void 0 ? \"LIMIT -1\" : renderLimitOffset(\"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 renderPlaceholder(node, ctx);\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 renderParts(parts, ctx) {\n\treturn parts.map((part) => typeof part === \"string\" ? part : renderExpr(part, ctx)).join(\"\");\n}\nfunction renderRawExpr(node, ctx) {\n\treturn renderParts(node.parts, ctx);\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\" && !Number.isNaN(expr.value) && !Number.isFinite(expr.value)) return expr.value > 0 ? \"9e999\" : \"-9e999\";\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\treturn expr.lowering.template.replace(/\\{\\{self\\}\\}|\\{\\{arg(\\d+)\\}\\}/g, (token, argIndex) => {\n\t\tif (token === \"{{self}}\") return self;\n\t\tconst arg = args[Number(argIndex)];\n\t\tif (arg === void 0) throw structuredError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Operation lowering template for \"${expr.method}\" referenced missing argument {{arg${argIndex}}}; template has ${args.length} arg(s)`, { meta: { method: expr.method } });\n\t\treturn arg;\n\t});\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 = renderPlaceholder(rightNode, ctx);\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\tisNotDistinctFrom: \"IS\",\n\t\tisDistinctFrom: \"IS NOT\",\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 renderPlaceholder(v, ctx);\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)}${ORDER_DIRECTION_SQL[item.dir]}${renderNullsPlacement(item)}`).join(\", \");\n}\nconst ORDER_DIRECTION_SQL = {\n\tasc: \" ASC\",\n\tdesc: \" DESC\"\n};\nconst ORDER_NULLS_SQL = {\n\tfirst: \" NULLS FIRST\",\n\tlast: \" NULLS LAST\"\n};\nfunction renderNullsPlacement(item) {\n\treturn item.nulls === void 0 ? \"\" : ORDER_NULLS_SQL[item.nulls];\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 renderPlaceholder(value, ctx);\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 = renderTableSource(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\tconst target = conflictColumns.length === 0 ? \"\" : ` (${conflictColumns.join(\", \")})`;\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${target} DO NOTHING`;\n\t\t\t\tbreak;\n\t\t\tcase \"do-update-set\":\n\t\t\t\tif (conflictColumns.length === 0) throw structuredError(\"RUNTIME.AST_INVALID\", \"INSERT onConflict requires at least one conflict column\", { meta: {\n\t\t\t\t\tnode: \"insert\",\n\t\t\t\t\ttable: ast.table.name\n\t\t\t\t} });\n\t\t\t\tonConflictClause = ` ON CONFLICT${target} DO UPDATE SET ${Object.entries(action.set).map(([colName, value]) => {\n\t\t\t\t\treturn `${quoteIdentifier(colName)} = ${renderExpr(value, ctx)}`;\n\t\t\t\t}).join(\", \")}`;\n\t\t\t\tbreak;\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 = renderTableSource(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 ${renderTableSource(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.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, sqliteDataTypes, options?.profileId));\n}\nfunction createSqliteAdapterWithCodecRegistry(codecRegistry, declaredDataTypes) {\n\treturn Object.freeze(new SqliteAdapterImpl(codecRegistry, declaredDataTypes));\n}\n//#endregion\nexport { SqliteControlAdapter as a, sqliteRawCodecInferer as i, createSqliteAdapterWithCodecRegistry as n, renderLoweredSql as r, createSqliteAdapter as t };\n\n//# sourceMappingURL=adapter-gpb0ICA2.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;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,gBAAgB,GAAG,EAAE,KAAK,WAAW,KAAK,GAAG;CACxD,CAAC;CACD,MAAM,cAAc,IAAI,QAAQ,UAAU,WAAW,IAAI,OAAO,GAAG,MAAM;CACzE,MAAM,kBAAkB,gBAAgB,IAAI,WAAW,GAAG;CAC1D,OAAO,UAAU,MAAM,OAAO,WAAW,KAAK,IAAI,IAAI,cAAc;AACrE;AACA,SAAS,aAAa,KAAK,KAAK;CAC/B,OAAO,eAAe,kBAAkB,IAAI,OAAO,GAAG,IAAI,IAAI,QAAQ,UAAU,WAAW,IAAI,OAAO,GAAG,MAAM,KAAK,gBAAgB,IAAI,WAAW,GAAG;AACvJ;AACA,SAAS,gBAAgB,WAAW,KAAK;CACxC,IAAI,CAAC,WAAW,QAAQ,OAAO;CAC/B,OAAO,cAAc,UAAU,KAAK,SAAS;EAC5C,IAAI,KAAK,KAAK,SAAS,cAAc;GACpC,MAAM,WAAW,gBAAgB,KAAK,KAAK,MAAM;GACjD,OAAO,KAAK,KAAK,WAAW,KAAK,QAAQ,WAAW,GAAG,SAAS,MAAM,gBAAgB,KAAK,KAAK;EACjG;EACA,OAAO,GAAG,WAAW,KAAK,MAAM,GAAG,EAAE,MAAM,gBAAgB,KAAK,KAAK;CACtE,CAAC,CAAC,CAAC,KAAK,IAAI;AACb;AACA,SAAS,oBAAoB,SAAS;CACrC,MAAM,gBAAgB,sCAAsC,SAAS,gBAAgB;CACrF,OAAO,OAAO,OAAO,IAAI,kBAAkB,eAAe,iBAAiB,SAAS,SAAS,CAAC;AAC/F;AACA,SAAS,qCAAqC,eAAe,mBAAmB;CAC/E,OAAO,OAAO,OAAO,IAAI,kBAAkB,eAAe,iBAAiB,CAAC;AAC7E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract-contributions-wweWdXMK-CwYZg4jC.mjs","names":[],"sources":["../../../../3-targets/sqlite/2-adapter/dist/contract-contributions-wweWdXMK.mjs"],"sourcesContent":["import { sqliteAggregateDescriptors } from \"@internal/target-sqlite/aggregates\";\n//#region src/core/capabilities.ts\nconst sqliteAdapterCapabilities = Object.freeze({ sql: {\n\torderBy: true,\n\tlimit: true,\n\tlateral: false,\n\tjsonAgg: true,\n\treturning: true,\n\tforeignKeys: true,\n\tenums: false,\n\tinsertOnConflictSkip: true,\n\tinsertOnConflictWithoutTarget: true\n} });\n//#endregion\n//#region src/core/contract-contributions.ts\n/**\n* What this adapter adds to every contract it runs: its capabilities and the aggregate overloads it lists. `prisma contract emit` reads them through the adapter's descriptor, and the TypeScript `defineContract` passes them to the contract build.\n*/\nconst sqliteAdapterContractContributions = {\n\tcapabilities: sqliteAdapterCapabilities,\n\ttypes: { aggregateDescriptors: sqliteAggregateDescriptors }\n};\n//#endregion\nexport { sqliteAdapterCapabilities as n, sqliteAdapterContractContributions as t };\n\n//# sourceMappingURL=contract-contributions-wweWdXMK.mjs.map"],"mappings":";;AAEA,MAAM,4BAA4B,OAAO,OAAO,EAAE,KAAK;CACtD,SAAS;CACT,OAAO;CACP,SAAS;CACT,SAAS;CACT,WAAW;CACX,aAAa;CACb,OAAO;CACP,sBAAsB;CACtB,+BAA+B;AAChC,EAAE,CAAC;;;;AAMH,MAAM,qCAAqC;CAC1C,cAAc;CACd,OAAO,EAAE,sBAAsB,2BAA2B;AAC3D"}