@prisma-next/target-sqlite 0.13.0-dev.33 → 0.13.0-dev.35

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.
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-target.ts","../src/core/sqlite-unbound-database.ts"],"mappings":";;;;;;cAgCM,6BAAA,EAA+B,0BAA0B,WAAW,uBAAA;;;KCnB9D,mBAAA;EAAA,SACD,EAAA;EAAA,SACA,OAAA,EAAS,mBAAmB;AAAA;ADF4C;;;;AAmBc;AAnBd,cCYtE,cAAA,SAAuB,aAAA;EAAA,SACjB,IAAA;EAAA,SAER,EAAA;EAAA,SACA,OAAA,EAAS,mBAAA;cAEN,KAAA,EAAO,mBAAA;EAAA,IAiCf,KAAA,IAAS,QAAA,CAAS,MAAA,SAAe,YAAA;EAIrC,SAAA;EAIA,YAAA,CAAa,SAAA;AAAA;;;AAzDwB;AAUvC;;;;;;;;;;;;;;cAqEa,qBAAA,SAA8B,cAAc;EAAA,gBACvC,QAAA,EAAU,qBAAA;EAAA,QAEnB,WAAA;AAAA;;;;;;;;;AAzBuB;AAsBhC;iBAmCgB,qBAAA,CACd,KAAA,EAAO,uBAAA,GACN,cAAA,GAAiB,qBAAA"}
1
+ {"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-target.ts","../src/core/sqlite-unbound-database.ts"],"mappings":";;;;;;cAgCM,6BAAA,EAA+B,0BAA0B,WAAW,uBAAA;;;KClB9D,mBAAA;EAAA,SACD,EAAA;EAAA,SACA,OAAA,EAAS,mBAAmB;AAAA;ADH4C;;;;AAmBc;AAnBd,cCatE,cAAA,SAAuB,aAAA;EAAA,SACjB,IAAA;EAAA,SAER,EAAA;EAAA,SACA,OAAA,EAAS,mBAAA;cAEN,KAAA,EAAO,mBAAA;EAAA,IAyBf,KAAA,IAAS,QAAA,CAAS,MAAA,SAAe,YAAA;EAIrC,SAAA;EAIA,YAAA,CAAa,SAAA;AAAA;;;AAjDwB;AAUvC;;;;;;;;;;;;;;cA6Da,qBAAA,SAA8B,cAAc;EAAA,gBACvC,QAAA,EAAU,qBAAA;EAAA,QAEnB,WAAA;AAAA;;;;;;;;;AAzBuB;AAsBhC;iBAmCgB,qBAAA,CACd,KAAA,EAAO,uBAAA,GACN,cAAA,GAAiB,qBAAA"}
package/dist/control.mjs CHANGED
@@ -4,7 +4,7 @@ import { t as normalizeSqliteNativeType } from "./native-type-normalizer-CiSyVmM
4
4
  import { r as MARKER_TABLE_NAME } from "./control-tables-7KwMyJ6i.mjs";
5
5
  import { y as renderDefaultLiteral } from "./op-factory-call-z4TT72k3.mjs";
6
6
  import { n as createSqliteMigrationPlanner } from "./planner-jMHqfl1A.mjs";
7
- import { n as SqliteUnboundDatabase, r as sqliteCreateNamespace, t as SqliteContractSerializer } from "./sqlite-contract-serializer-B_Cu0o3G.mjs";
7
+ import { n as SqliteUnboundDatabase, r as sqliteCreateNamespace, t as SqliteContractSerializer } from "./sqlite-contract-serializer-Cq9mXdXi.mjs";
8
8
  import { contractToSchemaIR, runnerFailure, runnerSuccess } from "@prisma-next/family-sql/control";
9
9
  import { SqlStorage } from "@prisma-next/sql-contract/types";
10
10
  import { verifySqlSchema } from "@prisma-next/family-sql/schema-verify";
package/dist/runtime.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as sqliteTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-BkXK3OjD.mjs";
2
- import { t as SqliteContractSerializer } from "./sqlite-contract-serializer-B_Cu0o3G.mjs";
2
+ import { t as SqliteContractSerializer } from "./sqlite-contract-serializer-Cq9mXdXi.mjs";
3
3
  //#region src/core/runtime-target.ts
4
4
  const sqliteRuntimeTargetDescriptor = {
5
5
  ...sqliteTargetDescriptorMetaRuntime,
@@ -1,7 +1,7 @@
1
- import { StorageTable } from "@prisma-next/sql-contract/types";
2
- import { NamespaceBase, UNBOUND_NAMESPACE_ID, freezeNode } from "@prisma-next/framework-components/ir";
1
+ import { NamespaceBase, UNBOUND_NAMESPACE_ID, freezeNode, hydrateNamespaceEntities } from "@prisma-next/framework-components/ir";
3
2
  import { blindCast } from "@prisma-next/utils/casts";
4
3
  import { SqlContractSerializerBase } from "@prisma-next/family-sql/ir";
4
+ import { tableEntityKind } from "@prisma-next/sql-contract/entity-kinds";
5
5
  //#region src/core/sqlite-unbound-database.ts
6
6
  const SQLITE_NAMESPACE_KIND = "sqlite-namespace";
7
7
  /**
@@ -15,17 +15,8 @@ var SqliteDatabase = class extends NamespaceBase {
15
15
  constructor(input) {
16
16
  super();
17
17
  this.id = input.id;
18
- const carried = {};
19
- let table = Object.freeze({});
20
- for (const [kind, rawMap] of Object.entries(input.entries)) if (kind === "table") {
21
- const tableMap = {};
22
- for (const [name, v] of Object.entries(blindCast(rawMap))) tableMap[name] = new StorageTable(v);
23
- table = Object.freeze(tableMap);
24
- } else carried[kind] = Object.freeze(rawMap);
25
- this.entries = Object.freeze({
26
- ...carried,
27
- table
28
- });
18
+ const dispatched = hydrateNamespaceEntities(input.entries, new Map([["table", tableEntityKind]]), "carry");
19
+ this.entries = Object.freeze(blindCast(dispatched));
29
20
  Object.defineProperty(this, "kind", {
30
21
  value: SQLITE_NAMESPACE_KIND,
31
22
  writable: false,
@@ -114,4 +105,4 @@ var SqliteContractSerializer = class extends SqlContractSerializerBase {
114
105
  //#endregion
115
106
  export { SqliteUnboundDatabase as n, sqliteCreateNamespace as r, SqliteContractSerializer as t };
116
107
 
117
- //# sourceMappingURL=sqlite-contract-serializer-B_Cu0o3G.mjs.map
108
+ //# sourceMappingURL=sqlite-contract-serializer-Cq9mXdXi.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite-contract-serializer-Cq9mXdXi.mjs","names":[],"sources":["../src/core/sqlite-unbound-database.ts","../src/core/sqlite-contract-serializer.ts"],"sourcesContent":["import {\n freezeNode,\n hydrateNamespaceEntities,\n NamespaceBase,\n UNBOUND_NAMESPACE_ID,\n} from '@prisma-next/framework-components/ir';\nimport { tableEntityKind } from '@prisma-next/sql-contract/entity-kinds';\nimport type {\n SqlNamespaceEntries,\n SqlNamespaceTablesInput,\n StorageTable,\n} from '@prisma-next/sql-contract/types';\nimport { blindCast } from '@prisma-next/utils/casts';\n\nexport type SqliteDatabaseInput = {\n readonly id: string;\n readonly entries: SqlNamespaceEntries;\n};\n\nconst SQLITE_NAMESPACE_KIND = 'sqlite-namespace' as const;\n\n/**\n * SQLite namespace concretion carrying table metadata under\n * `entries.table` and unqualified `qualifyTable()` emission for runtime\n * SQL rendering.\n */\nexport class SqliteDatabase extends NamespaceBase {\n declare readonly kind: string;\n\n readonly id: string;\n readonly entries: SqlNamespaceEntries;\n\n constructor(input: SqliteDatabaseInput) {\n super();\n this.id = input.id;\n\n const dispatched = hydrateNamespaceEntities(\n input.entries,\n new Map([['table', tableEntityKind]]),\n 'carry',\n );\n\n this.entries = Object.freeze(\n blindCast<\n SqlNamespaceEntries,\n \"SQLite's table-only descriptor map hydrates table→StorageTable and carries every other kind raw, so this open-dict result satisfies SqlNamespaceEntries; the descriptor Map erases the per-kind Node type from the return.\"\n >(dispatched),\n );\n Object.defineProperty(this, 'kind', {\n value: SQLITE_NAMESPACE_KIND,\n writable: false,\n enumerable: false,\n configurable: true,\n });\n freezeNode(this);\n }\n\n get table(): Readonly<Record<string, StorageTable>> {\n return this.entries.table ?? Object.freeze({});\n }\n\n qualifier(): string {\n return '';\n }\n\n qualifyTable(tableName: string): string {\n return `\"${tableName}\"`;\n }\n}\n\n/**\n * SQLite target `Namespace` concretion. SQLite has no schema or\n * database-namespacing concept at the SQL level — there is exactly one\n * effective namespace per connection, so the target ships a single\n * singleton bound to the framework's `UNBOUND_NAMESPACE_ID` slot.\n *\n * Qualifier emission elides the prefix entirely: rendered DDL and\n * queries look unqualified (`CREATE TABLE \"users\" (...)`), matching\n * SQLite's native dialect. Call sites stay polymorphic — they ask the\n * namespace for its qualifier and consume the empty/unqualified result\n * the same way Postgres consumes a `\"schema\"` prefix.\n *\n * The SQLite PSL interpreter rejects every explicit `namespace { … }`\n * block with a diagnostic naming SQLite; only the implicit\n * `__unspecified__` AST bucket reaches the SQLite interpreter, which\n * lowers it to this singleton.\n */\nexport class SqliteUnboundDatabase extends SqliteDatabase {\n static readonly instance: SqliteUnboundDatabase = new SqliteUnboundDatabase();\n\n private constructor() {\n super({ id: UNBOUND_NAMESPACE_ID, entries: { table: {} } });\n }\n}\n\nexport function buildSqliteNamespace(\n input: SqlNamespaceTablesInput,\n): SqliteDatabase | SqliteUnboundDatabase {\n if (input.id !== UNBOUND_NAMESPACE_ID) {\n throw new Error(\n `buildSqliteNamespace: SQLite has no schema concept; the only valid namespace id is \"${UNBOUND_NAMESPACE_ID}\" (received \"${input.id}\").`,\n );\n }\n const tableKind = input.entries['table'];\n const tableCount = tableKind !== undefined ? Object.keys(tableKind).length : 0;\n const hasUnknownKinds = Object.keys(input.entries).some((kind) => kind !== 'table');\n if (tableCount === 0 && !hasUnknownKinds) {\n return SqliteUnboundDatabase.instance;\n }\n return new SqliteDatabase({ id: input.id, entries: input.entries });\n}\n\n/**\n * Target-supplied `Namespace` factory the SQLite target plumbs through\n * `defineContract({ createNamespace })`. SQLite has only one\n * effective namespace slot — the framework `UNBOUND_NAMESPACE_ID`\n * sentinel — so the factory always returns the singleton or a fresh\n * `SqliteDatabase` for the unbound slot with tables. The SQL family's\n * defensive validation in `defineContract` already rejects\n * user-declared SQLite namespaces, so this throw is a structural\n * safety net rather than a user-facing surface.\n */\nexport function sqliteCreateNamespace(\n input: SqlNamespaceTablesInput,\n): SqliteDatabase | SqliteUnboundDatabase {\n return buildSqliteNamespace(input);\n}\n","import type { Contract } from '@prisma-next/contract/types';\nimport { SqlContractSerializerBase } from '@prisma-next/family-sql/ir';\nimport { type Namespace, NamespaceBase } from '@prisma-next/framework-components/ir';\nimport type { SqlNamespaceTablesInput, SqlStorage } from '@prisma-next/sql-contract/types';\nimport { blindCast } from '@prisma-next/utils/casts';\nimport { buildSqliteNamespace } from './sqlite-unbound-database';\n\n/**\n * SQLite target `ContractSerializer` concretion. Mirrors the Postgres\n * shape: inherits the full SQL-family deserialization pipeline and\n * materialises namespace entries as SQLite database concretions that\n * expose `qualifyTable()` for runtime SQL rendering.\n */\nexport class SqliteContractSerializer extends SqlContractSerializerBase<Contract<SqlStorage>> {\n constructor() {\n super(new Map());\n }\n\n protected override hydrateSqlNamespaceEntry(\n nsId: string,\n raw: Namespace | Record<string, unknown>,\n ): Namespace | SqlNamespaceTablesInput {\n if (raw instanceof NamespaceBase) {\n return raw;\n }\n const hydrated = blindCast<\n SqlNamespaceTablesInput,\n 'super.hydrateSqlNamespaceEntry returns the tables form when raw is not a NamespaceBase'\n >(super.hydrateSqlNamespaceEntry(nsId, raw));\n return buildSqliteNamespace(hydrated);\n }\n}\n"],"mappings":";;;;;AAmBA,MAAM,wBAAwB;;;;;;AAO9B,IAAa,iBAAb,cAAoC,cAAc;CAGhD;CACA;CAEA,YAAY,OAA4B;EACtC,MAAM;EACN,KAAK,KAAK,MAAM;EAEhB,MAAM,aAAa,yBACjB,MAAM,SACN,IAAI,IAAI,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,GACpC,OACF;EAEA,KAAK,UAAU,OAAO,OACpB,UAGE,UAAU,CACd;EACA,OAAO,eAAe,MAAM,QAAQ;GAClC,OAAO;GACP,UAAU;GACV,YAAY;GACZ,cAAc;EAChB,CAAC;EACD,WAAW,IAAI;CACjB;CAEA,IAAI,QAAgD;EAClD,OAAO,KAAK,QAAQ,SAAS,OAAO,OAAO,CAAC,CAAC;CAC/C;CAEA,YAAoB;EAClB,OAAO;CACT;CAEA,aAAa,WAA2B;EACtC,OAAO,IAAI,UAAU;CACvB;AACF;;;;;;;;;;;;;;;;;;AAmBA,IAAa,wBAAb,MAAa,8BAA8B,eAAe;CACxD,OAAgB,WAAkC,IAAI,sBAAsB;CAE5E,cAAsB;EACpB,MAAM;GAAE,IAAI;GAAsB,SAAS,EAAE,OAAO,CAAC,EAAE;EAAE,CAAC;CAC5D;AACF;AAEA,SAAgB,qBACd,OACwC;CACxC,IAAI,MAAM,OAAO,sBACf,MAAM,IAAI,MACR,uFAAuF,qBAAqB,eAAe,MAAM,GAAG,IACtI;CAEF,MAAM,YAAY,MAAM,QAAQ;CAChC,MAAM,aAAa,cAAc,KAAA,IAAY,OAAO,KAAK,SAAS,CAAC,CAAC,SAAS;CAC7E,MAAM,kBAAkB,OAAO,KAAK,MAAM,OAAO,CAAC,CAAC,MAAM,SAAS,SAAS,OAAO;CAClF,IAAI,eAAe,KAAK,CAAC,iBACvB,OAAO,sBAAsB;CAE/B,OAAO,IAAI,eAAe;EAAE,IAAI,MAAM;EAAI,SAAS,MAAM;CAAQ,CAAC;AACpE;;;;;;;;;;;AAYA,SAAgB,sBACd,OACwC;CACxC,OAAO,qBAAqB,KAAK;AACnC;;;;;;;;;ACjHA,IAAa,2BAAb,cAA8C,0BAAgD;CAC5F,cAAc;EACZ,sBAAM,IAAI,IAAI,CAAC;CACjB;CAEA,yBACE,MACA,KACqC;EACrC,IAAI,eAAe,eACjB,OAAO;EAMT,OAAO,qBAJU,UAGf,MAAM,yBAAyB,MAAM,GAAG,CACP,CAAC;CACtC;AACF"}
package/package.json CHANGED
@@ -1,30 +1,30 @@
1
1
  {
2
2
  "name": "@prisma-next/target-sqlite",
3
- "version": "0.13.0-dev.33",
3
+ "version": "0.13.0-dev.35",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "dependencies": {
8
- "@prisma-next/cli": "0.13.0-dev.33",
9
- "@prisma-next/contract": "0.13.0-dev.33",
10
- "@prisma-next/errors": "0.13.0-dev.33",
11
- "@prisma-next/family-sql": "0.13.0-dev.33",
12
- "@prisma-next/framework-components": "0.13.0-dev.33",
13
- "@prisma-next/migration-tools": "0.13.0-dev.33",
14
- "@prisma-next/sql-contract": "0.13.0-dev.33",
15
- "@prisma-next/sql-errors": "0.13.0-dev.33",
16
- "@prisma-next/sql-relational-core": "0.13.0-dev.33",
17
- "@prisma-next/sql-runtime": "0.13.0-dev.33",
18
- "@prisma-next/sql-schema-ir": "0.13.0-dev.33",
19
- "@prisma-next/ts-render": "0.13.0-dev.33",
20
- "@prisma-next/utils": "0.13.0-dev.33",
8
+ "@prisma-next/cli": "0.13.0-dev.35",
9
+ "@prisma-next/contract": "0.13.0-dev.35",
10
+ "@prisma-next/errors": "0.13.0-dev.35",
11
+ "@prisma-next/family-sql": "0.13.0-dev.35",
12
+ "@prisma-next/framework-components": "0.13.0-dev.35",
13
+ "@prisma-next/migration-tools": "0.13.0-dev.35",
14
+ "@prisma-next/sql-contract": "0.13.0-dev.35",
15
+ "@prisma-next/sql-errors": "0.13.0-dev.35",
16
+ "@prisma-next/sql-relational-core": "0.13.0-dev.35",
17
+ "@prisma-next/sql-runtime": "0.13.0-dev.35",
18
+ "@prisma-next/sql-schema-ir": "0.13.0-dev.35",
19
+ "@prisma-next/ts-render": "0.13.0-dev.35",
20
+ "@prisma-next/utils": "0.13.0-dev.35",
21
21
  "@standard-schema/spec": "1.1.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@prisma-next/driver-sqlite": "0.13.0-dev.33",
25
- "@prisma-next/test-utils": "0.13.0-dev.33",
26
- "@prisma-next/tsconfig": "0.13.0-dev.33",
27
- "@prisma-next/tsdown": "0.13.0-dev.33",
24
+ "@prisma-next/driver-sqlite": "0.13.0-dev.35",
25
+ "@prisma-next/test-utils": "0.13.0-dev.35",
26
+ "@prisma-next/tsconfig": "0.13.0-dev.35",
27
+ "@prisma-next/tsdown": "0.13.0-dev.35",
28
28
  "tsdown": "0.22.1",
29
29
  "typescript": "5.9.3",
30
30
  "vitest": "4.1.8"
@@ -1,13 +1,14 @@
1
1
  import {
2
2
  freezeNode,
3
+ hydrateNamespaceEntities,
3
4
  NamespaceBase,
4
5
  UNBOUND_NAMESPACE_ID,
5
6
  } from '@prisma-next/framework-components/ir';
6
- import {
7
- type SqlNamespaceEntries,
8
- type SqlNamespaceTablesInput,
7
+ import { tableEntityKind } from '@prisma-next/sql-contract/entity-kinds';
8
+ import type {
9
+ SqlNamespaceEntries,
10
+ SqlNamespaceTablesInput,
9
11
  StorageTable,
10
- type StorageTableInput,
11
12
  } from '@prisma-next/sql-contract/types';
12
13
  import { blindCast } from '@prisma-next/utils/casts';
13
14
 
@@ -33,26 +34,18 @@ export class SqliteDatabase extends NamespaceBase {
33
34
  super();
34
35
  this.id = input.id;
35
36
 
36
- const carried: Record<string, Readonly<Record<string, unknown>>> = {};
37
- let table: Readonly<Record<string, StorageTable>> = Object.freeze({});
38
- for (const [kind, rawMap] of Object.entries(input.entries)) {
39
- if (kind === 'table') {
40
- const tableMap: Record<string, StorageTable> = {};
41
- for (const [name, v] of Object.entries(
42
- blindCast<
43
- Record<string, StorageTableInput>,
44
- 'entries[table] holds StorageTableInput by construction'
45
- >(rawMap),
46
- )) {
47
- tableMap[name] = new StorageTable(v);
48
- }
49
- table = Object.freeze(tableMap);
50
- } else {
51
- carried[kind] = Object.freeze(rawMap);
52
- }
53
- }
37
+ const dispatched = hydrateNamespaceEntities(
38
+ input.entries,
39
+ new Map([['table', tableEntityKind]]),
40
+ 'carry',
41
+ );
54
42
 
55
- this.entries = Object.freeze({ ...carried, table });
43
+ this.entries = Object.freeze(
44
+ blindCast<
45
+ SqlNamespaceEntries,
46
+ "SQLite's table-only descriptor map hydrates table→StorageTable and carries every other kind raw, so this open-dict result satisfies SqlNamespaceEntries; the descriptor Map erases the per-kind Node type from the return."
47
+ >(dispatched),
48
+ );
56
49
  Object.defineProperty(this, 'kind', {
57
50
  value: SQLITE_NAMESPACE_KIND,
58
51
  writable: false,
@@ -1 +0,0 @@
1
- {"version":3,"file":"sqlite-contract-serializer-B_Cu0o3G.mjs","names":[],"sources":["../src/core/sqlite-unbound-database.ts","../src/core/sqlite-contract-serializer.ts"],"sourcesContent":["import {\n freezeNode,\n NamespaceBase,\n UNBOUND_NAMESPACE_ID,\n} from '@prisma-next/framework-components/ir';\nimport {\n type SqlNamespaceEntries,\n type SqlNamespaceTablesInput,\n StorageTable,\n type StorageTableInput,\n} from '@prisma-next/sql-contract/types';\nimport { blindCast } from '@prisma-next/utils/casts';\n\nexport type SqliteDatabaseInput = {\n readonly id: string;\n readonly entries: SqlNamespaceEntries;\n};\n\nconst SQLITE_NAMESPACE_KIND = 'sqlite-namespace' as const;\n\n/**\n * SQLite namespace concretion carrying table metadata under\n * `entries.table` and unqualified `qualifyTable()` emission for runtime\n * SQL rendering.\n */\nexport class SqliteDatabase extends NamespaceBase {\n declare readonly kind: string;\n\n readonly id: string;\n readonly entries: SqlNamespaceEntries;\n\n constructor(input: SqliteDatabaseInput) {\n super();\n this.id = input.id;\n\n const carried: Record<string, Readonly<Record<string, unknown>>> = {};\n let table: Readonly<Record<string, StorageTable>> = Object.freeze({});\n for (const [kind, rawMap] of Object.entries(input.entries)) {\n if (kind === 'table') {\n const tableMap: Record<string, StorageTable> = {};\n for (const [name, v] of Object.entries(\n blindCast<\n Record<string, StorageTableInput>,\n 'entries[table] holds StorageTableInput by construction'\n >(rawMap),\n )) {\n tableMap[name] = new StorageTable(v);\n }\n table = Object.freeze(tableMap);\n } else {\n carried[kind] = Object.freeze(rawMap);\n }\n }\n\n this.entries = Object.freeze({ ...carried, table });\n Object.defineProperty(this, 'kind', {\n value: SQLITE_NAMESPACE_KIND,\n writable: false,\n enumerable: false,\n configurable: true,\n });\n freezeNode(this);\n }\n\n get table(): Readonly<Record<string, StorageTable>> {\n return this.entries.table ?? Object.freeze({});\n }\n\n qualifier(): string {\n return '';\n }\n\n qualifyTable(tableName: string): string {\n return `\"${tableName}\"`;\n }\n}\n\n/**\n * SQLite target `Namespace` concretion. SQLite has no schema or\n * database-namespacing concept at the SQL level — there is exactly one\n * effective namespace per connection, so the target ships a single\n * singleton bound to the framework's `UNBOUND_NAMESPACE_ID` slot.\n *\n * Qualifier emission elides the prefix entirely: rendered DDL and\n * queries look unqualified (`CREATE TABLE \"users\" (...)`), matching\n * SQLite's native dialect. Call sites stay polymorphic — they ask the\n * namespace for its qualifier and consume the empty/unqualified result\n * the same way Postgres consumes a `\"schema\"` prefix.\n *\n * The SQLite PSL interpreter rejects every explicit `namespace { … }`\n * block with a diagnostic naming SQLite; only the implicit\n * `__unspecified__` AST bucket reaches the SQLite interpreter, which\n * lowers it to this singleton.\n */\nexport class SqliteUnboundDatabase extends SqliteDatabase {\n static readonly instance: SqliteUnboundDatabase = new SqliteUnboundDatabase();\n\n private constructor() {\n super({ id: UNBOUND_NAMESPACE_ID, entries: { table: {} } });\n }\n}\n\nexport function buildSqliteNamespace(\n input: SqlNamespaceTablesInput,\n): SqliteDatabase | SqliteUnboundDatabase {\n if (input.id !== UNBOUND_NAMESPACE_ID) {\n throw new Error(\n `buildSqliteNamespace: SQLite has no schema concept; the only valid namespace id is \"${UNBOUND_NAMESPACE_ID}\" (received \"${input.id}\").`,\n );\n }\n const tableKind = input.entries['table'];\n const tableCount = tableKind !== undefined ? Object.keys(tableKind).length : 0;\n const hasUnknownKinds = Object.keys(input.entries).some((kind) => kind !== 'table');\n if (tableCount === 0 && !hasUnknownKinds) {\n return SqliteUnboundDatabase.instance;\n }\n return new SqliteDatabase({ id: input.id, entries: input.entries });\n}\n\n/**\n * Target-supplied `Namespace` factory the SQLite target plumbs through\n * `defineContract({ createNamespace })`. SQLite has only one\n * effective namespace slot — the framework `UNBOUND_NAMESPACE_ID`\n * sentinel — so the factory always returns the singleton or a fresh\n * `SqliteDatabase` for the unbound slot with tables. The SQL family's\n * defensive validation in `defineContract` already rejects\n * user-declared SQLite namespaces, so this throw is a structural\n * safety net rather than a user-facing surface.\n */\nexport function sqliteCreateNamespace(\n input: SqlNamespaceTablesInput,\n): SqliteDatabase | SqliteUnboundDatabase {\n return buildSqliteNamespace(input);\n}\n","import type { Contract } from '@prisma-next/contract/types';\nimport { SqlContractSerializerBase } from '@prisma-next/family-sql/ir';\nimport { type Namespace, NamespaceBase } from '@prisma-next/framework-components/ir';\nimport type { SqlNamespaceTablesInput, SqlStorage } from '@prisma-next/sql-contract/types';\nimport { blindCast } from '@prisma-next/utils/casts';\nimport { buildSqliteNamespace } from './sqlite-unbound-database';\n\n/**\n * SQLite target `ContractSerializer` concretion. Mirrors the Postgres\n * shape: inherits the full SQL-family deserialization pipeline and\n * materialises namespace entries as SQLite database concretions that\n * expose `qualifyTable()` for runtime SQL rendering.\n */\nexport class SqliteContractSerializer extends SqlContractSerializerBase<Contract<SqlStorage>> {\n constructor() {\n super(new Map());\n }\n\n protected override hydrateSqlNamespaceEntry(\n nsId: string,\n raw: Namespace | Record<string, unknown>,\n ): Namespace | SqlNamespaceTablesInput {\n if (raw instanceof NamespaceBase) {\n return raw;\n }\n const hydrated = blindCast<\n SqlNamespaceTablesInput,\n 'super.hydrateSqlNamespaceEntry returns the tables form when raw is not a NamespaceBase'\n >(super.hydrateSqlNamespaceEntry(nsId, raw));\n return buildSqliteNamespace(hydrated);\n }\n}\n"],"mappings":";;;;;AAkBA,MAAM,wBAAwB;;;;;;AAO9B,IAAa,iBAAb,cAAoC,cAAc;CAGhD;CACA;CAEA,YAAY,OAA4B;EACtC,MAAM;EACN,KAAK,KAAK,MAAM;EAEhB,MAAM,UAA6D,CAAC;EACpE,IAAI,QAAgD,OAAO,OAAO,CAAC,CAAC;EACpE,KAAK,MAAM,CAAC,MAAM,WAAW,OAAO,QAAQ,MAAM,OAAO,GACvD,IAAI,SAAS,SAAS;GACpB,MAAM,WAAyC,CAAC;GAChD,KAAK,MAAM,CAAC,MAAM,MAAM,OAAO,QAC7B,UAGE,MAAM,CACV,GACE,SAAS,QAAQ,IAAI,aAAa,CAAC;GAErC,QAAQ,OAAO,OAAO,QAAQ;EAChC,OACE,QAAQ,QAAQ,OAAO,OAAO,MAAM;EAIxC,KAAK,UAAU,OAAO,OAAO;GAAE,GAAG;GAAS;EAAM,CAAC;EAClD,OAAO,eAAe,MAAM,QAAQ;GAClC,OAAO;GACP,UAAU;GACV,YAAY;GACZ,cAAc;EAChB,CAAC;EACD,WAAW,IAAI;CACjB;CAEA,IAAI,QAAgD;EAClD,OAAO,KAAK,QAAQ,SAAS,OAAO,OAAO,CAAC,CAAC;CAC/C;CAEA,YAAoB;EAClB,OAAO;CACT;CAEA,aAAa,WAA2B;EACtC,OAAO,IAAI,UAAU;CACvB;AACF;;;;;;;;;;;;;;;;;;AAmBA,IAAa,wBAAb,MAAa,8BAA8B,eAAe;CACxD,OAAgB,WAAkC,IAAI,sBAAsB;CAE5E,cAAsB;EACpB,MAAM;GAAE,IAAI;GAAsB,SAAS,EAAE,OAAO,CAAC,EAAE;EAAE,CAAC;CAC5D;AACF;AAEA,SAAgB,qBACd,OACwC;CACxC,IAAI,MAAM,OAAO,sBACf,MAAM,IAAI,MACR,uFAAuF,qBAAqB,eAAe,MAAM,GAAG,IACtI;CAEF,MAAM,YAAY,MAAM,QAAQ;CAChC,MAAM,aAAa,cAAc,KAAA,IAAY,OAAO,KAAK,SAAS,CAAC,CAAC,SAAS;CAC7E,MAAM,kBAAkB,OAAO,KAAK,MAAM,OAAO,CAAC,CAAC,MAAM,SAAS,SAAS,OAAO;CAClF,IAAI,eAAe,KAAK,CAAC,iBACvB,OAAO,sBAAsB;CAE/B,OAAO,IAAI,eAAe;EAAE,IAAI,MAAM;EAAI,SAAS,MAAM;CAAQ,CAAC;AACpE;;;;;;;;;;;AAYA,SAAgB,sBACd,OACwC;CACxC,OAAO,qBAAqB,KAAK;AACnC;;;;;;;;;ACxHA,IAAa,2BAAb,cAA8C,0BAAgD;CAC5F,cAAc;EACZ,sBAAM,IAAI,IAAI,CAAC;CACjB;CAEA,yBACE,MACA,KACqC;EACrC,IAAI,eAAe,eACjB,OAAO;EAMT,OAAO,qBAJU,UAGf,MAAM,yBAAyB,MAAM,GAAG,CACP,CAAC;CACtC;AACF"}