@prisma-next/sql-contract 0.14.0-dev.5 → 0.14.0-dev.51

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 (67) hide show
  1. package/dist/contract-view.d.mts +61 -0
  2. package/dist/contract-view.d.mts.map +1 -0
  3. package/dist/contract-view.mjs +39 -0
  4. package/dist/contract-view.mjs.map +1 -0
  5. package/dist/entity-kinds-CHiydmat.mjs +131 -0
  6. package/dist/entity-kinds-CHiydmat.mjs.map +1 -0
  7. package/dist/entity-kinds.d.mts +2 -1
  8. package/dist/entity-kinds.d.mts.map +1 -1
  9. package/dist/entity-kinds.mjs +1 -1
  10. package/dist/factories.d.mts +6 -4
  11. package/dist/factories.d.mts.map +1 -1
  12. package/dist/factories.mjs +5 -4
  13. package/dist/factories.mjs.map +1 -1
  14. package/dist/{foreign-key-BATxB95l.d.mts → foreign-key-DM1UTydh.d.mts} +3 -41
  15. package/dist/foreign-key-DM1UTydh.d.mts.map +1 -0
  16. package/dist/index-type-validation.d.mts +1 -1
  17. package/dist/referential-action-sql.d.mts +1 -1
  18. package/dist/resolve-storage-table.d.mts +2 -2
  19. package/dist/sql-node-V214WXQD.d.mts +42 -0
  20. package/dist/sql-node-V214WXQD.d.mts.map +1 -0
  21. package/dist/{sql-storage-Dga0jwP2.d.mts → sql-storage-BRB55sCP.d.mts} +62 -20
  22. package/dist/sql-storage-BRB55sCP.d.mts.map +1 -0
  23. package/dist/{storage-value-set-WnYsIFM8.d.mts → storage-table-Bj1ZN1P7.d.mts} +16 -39
  24. package/dist/storage-table-Bj1ZN1P7.d.mts.map +1 -0
  25. package/dist/{entity-kinds-Cl36zL5j.mjs → storage-value-set-C4XInPlX.mjs} +21 -128
  26. package/dist/storage-value-set-C4XInPlX.mjs.map +1 -0
  27. package/dist/storage-value-set-D-jww77l.d.mts +41 -0
  28. package/dist/storage-value-set-D-jww77l.d.mts.map +1 -0
  29. package/dist/types-KiOT4SAV.mjs +114 -0
  30. package/dist/types-KiOT4SAV.mjs.map +1 -0
  31. package/dist/{types-B1N8w0I2.d.mts → types-zBvpNCmg.d.mts} +25 -55
  32. package/dist/types-zBvpNCmg.d.mts.map +1 -0
  33. package/dist/types.d.mts +13 -5
  34. package/dist/types.d.mts.map +1 -0
  35. package/dist/types.mjs +3 -3
  36. package/dist/validators.d.mts +10 -7
  37. package/dist/validators.d.mts.map +1 -1
  38. package/dist/validators.mjs +109 -17
  39. package/dist/validators.mjs.map +1 -1
  40. package/dist/value-set-derivation-hook.d.mts +35 -0
  41. package/dist/value-set-derivation-hook.d.mts.map +1 -0
  42. package/dist/value-set-derivation-hook.mjs +22 -0
  43. package/dist/value-set-derivation-hook.mjs.map +1 -0
  44. package/package.json +9 -7
  45. package/src/column-type-resolution.ts +26 -0
  46. package/src/contract-view.ts +98 -0
  47. package/src/exports/contract-view.ts +11 -0
  48. package/src/exports/types.ts +17 -4
  49. package/src/exports/value-set-derivation-hook.ts +2 -0
  50. package/src/factories.ts +12 -2
  51. package/src/ir/sql-storage.ts +80 -17
  52. package/src/ir/storage-column.ts +3 -0
  53. package/src/ir/storage-entry-schemas.ts +1 -0
  54. package/src/ir/storage-table.ts +21 -0
  55. package/src/ir/storage-value-set.ts +5 -0
  56. package/src/types.ts +51 -8
  57. package/src/validators.ts +215 -40
  58. package/src/value-set-derivation-hook.ts +47 -0
  59. package/dist/entity-kinds-Cl36zL5j.mjs.map +0 -1
  60. package/dist/foreign-key-BATxB95l.d.mts.map +0 -1
  61. package/dist/sql-storage-Dga0jwP2.d.mts.map +0 -1
  62. package/dist/storage-value-set-WnYsIFM8.d.mts.map +0 -1
  63. package/dist/types-B-eiQXff.mjs +0 -191
  64. package/dist/types-B-eiQXff.mjs.map +0 -1
  65. package/dist/types-B1N8w0I2.d.mts.map +0 -1
  66. package/src/ir/build-sql-namespace.ts +0 -110
  67. package/src/ir/sql-unbound-namespace.ts +0 -74
@@ -0,0 +1,61 @@
1
+ import { s as SqlStorage } from "./sql-storage-BRB55sCP.mjs";
2
+ import { DefaultNamespaceEntries, NamespacedEntities, SingleNamespaceView } from "@prisma-next/framework-components/ir";
3
+ import { Contract } from "@prisma-next/contract/types";
4
+
5
+ //#region src/contract-view.d.ts
6
+ /**
7
+ * The SQL family's statically-named built-in entity kinds. `table` and
8
+ * `valueSet` are promoted to top-level view accessors; pack-contributed kinds
9
+ * (e.g. `policy`) stay under `.entries`.
10
+ */
11
+ declare const SQL_BUILTIN_KINDS: readonly ["table", "valueSet"];
12
+ type SqlBuiltinKind = (typeof SQL_BUILTIN_KINDS)[number];
13
+ type SqlEntries<TContract extends Contract<SqlStorage>> = DefaultNamespaceEntries<TContract['storage']>;
14
+ /**
15
+ * The single-namespace SQL accessors: `table`/`valueSet` top-level, pack kinds
16
+ * under `entries`. A target that never emits a built-in kind (SQLite has
17
+ * `sql.enums: false`, so it emits no `valueSet`) resolves that slot to an empty
18
+ * map.
19
+ */
20
+ type SqlSingleNamespaceAccessors<TContract extends Contract<SqlStorage>> = SingleNamespaceView<SqlEntries<TContract>, SqlBuiltinKind>;
21
+ /**
22
+ * Single-namespace SQL view: the deserialized contract intersected with the
23
+ * by-name accessors, so the value is substitutable for `Contract` while also
24
+ * exposing:
25
+ * - `view.table.<name>` / `view.valueSet.<name>` — built-in kinds, sole
26
+ * namespace unwrapped to the root; pack kinds under `view.entries.<kind>`.
27
+ * - `view.namespace.<id>` — the namespace-keyed entity map (SQLite's sole
28
+ * namespace is `__unbound__`). Mirrors the runtime `db.enums` pattern.
29
+ */
30
+ type SqlSingleNamespaceView<TContract extends Contract<SqlStorage>> = TContract & SqlSingleNamespaceAccessors<TContract> & {
31
+ readonly namespace: NamespacedEntities<TContract['storage'], SqlBuiltinKind>;
32
+ };
33
+ /**
34
+ * Builds the single-namespace SQL view: unwraps the sole namespace's SQL
35
+ * built-in kinds (`table`, `valueSet`) to the root, attaches the namespace-keyed
36
+ * `namespace` map, and layers both over the deserialized contract. Targets with
37
+ * one default namespace (SQLite) call this directly; Postgres qualifies by
38
+ * schema.
39
+ */
40
+ declare function buildSqlSingleNamespaceView<TContract extends Contract<SqlStorage>>(contract: TContract): SqlSingleNamespaceView<TContract>;
41
+ /**
42
+ * Schema-qualified SQL view: the deserialized contract intersected with a single
43
+ * `view.namespace.<id>` member — every schema reached by raw id
44
+ * (`view.namespace.public.table.users`), mirroring the runtime `db.enums.<ns>`
45
+ * keying exactly (the default schema keeps its literal `__unbound__` id). There
46
+ * is NO root schema-name promotion, so there is no collision with contract
47
+ * envelope fields — `view.storage` is always the contract's `storage`. Postgres
48
+ * uses this; SQLite (single default namespace) uses
49
+ * {@link buildSqlSingleNamespaceView}.
50
+ */
51
+ type SqlSchemaQualifiedView<TContract extends Contract<SqlStorage>> = TContract & {
52
+ readonly namespace: NamespacedEntities<TContract['storage'], SqlBuiltinKind>;
53
+ };
54
+ /**
55
+ * Builds the schema-qualified SQL view: attaches the namespace-keyed `namespace`
56
+ * map over the deserialized contract. Postgres uses this.
57
+ */
58
+ declare function buildSqlSchemaQualifiedView<TContract extends Contract<SqlStorage>>(contract: TContract): SqlSchemaQualifiedView<TContract>;
59
+ //#endregion
60
+ export { SQL_BUILTIN_KINDS, type SqlBuiltinKind, type SqlSchemaQualifiedView, type SqlSingleNamespaceAccessors, type SqlSingleNamespaceView, buildSqlSchemaQualifiedView, buildSqlSingleNamespaceView };
61
+ //# sourceMappingURL=contract-view.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-view.d.mts","names":[],"sources":["../src/contract-view.ts"],"mappings":";;;;;;;AAeA;;;cAAa,iBAAA;AAAA,KACD,cAAA,WAAyB,iBAAiB;AAAA,KAEjD,UAAA,mBAA6B,QAAA,CAAS,UAAA,KAAe,uBAAA,CACxD,SAAA;;;;AAHoD;AAAU;;KAYpD,2BAAA,mBAA8C,QAAA,CAAS,UAAA,KACjE,mBAAA,CAAoB,UAAA,CAAW,SAAA,GAAY,cAAA;;;;;;;;;;KAWjC,sBAAA,mBAAyC,QAAA,CAAS,UAAA,KAAe,SAAA,GAC3E,2BAAA,CAA4B,SAAA;EAAA,SACjB,SAAA,EAAW,kBAAA,CAAmB,SAAA,aAAsB,cAAA;AAAA;AAvBtD;AASX;;;;;;AATW,iBAiCK,2BAAA,mBAA8C,QAAA,CAAS,UAAA,GACrE,QAAA,EAAU,SAAA,GACT,sBAAA,CAAuB,SAAA;;;;;;;;;;;KAyBd,sBAAA,mBAAyC,QAAA,CAAS,UAAA,KAAe,SAAA;EAAA,SAClE,SAAA,EAAW,kBAAA,CAAmB,SAAA,aAAsB,cAAA;AAAA;AAxC/D;;;;AAAA,iBA+CgB,2BAAA,mBAA8C,QAAA,CAAS,UAAA,GACrE,QAAA,EAAU,SAAA,GACT,sBAAA,CAAuB,SAAA"}
@@ -0,0 +1,39 @@
1
+ import { buildNamespacedEntities, buildSingleNamespaceView } from "@prisma-next/framework-components/ir";
2
+ //#region src/contract-view.ts
3
+ /**
4
+ * The SQL family's statically-named built-in entity kinds. `table` and
5
+ * `valueSet` are promoted to top-level view accessors; pack-contributed kinds
6
+ * (e.g. `policy`) stay under `.entries`.
7
+ */
8
+ const SQL_BUILTIN_KINDS = ["table", "valueSet"];
9
+ /**
10
+ * Builds the single-namespace SQL view: unwraps the sole namespace's SQL
11
+ * built-in kinds (`table`, `valueSet`) to the root, attaches the namespace-keyed
12
+ * `namespace` map, and layers both over the deserialized contract. Targets with
13
+ * one default namespace (SQLite) call this directly; Postgres qualifies by
14
+ * schema.
15
+ */
16
+ function buildSqlSingleNamespaceView(contract) {
17
+ const rootAccessors = buildSingleNamespaceView(contract.storage, SQL_BUILTIN_KINDS);
18
+ const namespace = buildNamespacedEntities(contract.storage, SQL_BUILTIN_KINDS);
19
+ return {
20
+ ...contract,
21
+ ...rootAccessors,
22
+ namespace
23
+ };
24
+ }
25
+ /**
26
+ * Builds the schema-qualified SQL view: attaches the namespace-keyed `namespace`
27
+ * map over the deserialized contract. Postgres uses this.
28
+ */
29
+ function buildSqlSchemaQualifiedView(contract) {
30
+ const namespace = buildNamespacedEntities(contract.storage, SQL_BUILTIN_KINDS);
31
+ return {
32
+ ...contract,
33
+ namespace
34
+ };
35
+ }
36
+ //#endregion
37
+ export { SQL_BUILTIN_KINDS, buildSqlSchemaQualifiedView, buildSqlSingleNamespaceView };
38
+
39
+ //# sourceMappingURL=contract-view.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-view.mjs","names":[],"sources":["../src/contract-view.ts"],"sourcesContent":["import type { Contract } from '@prisma-next/contract/types';\nimport {\n buildNamespacedEntities,\n buildSingleNamespaceView,\n type DefaultNamespaceEntries,\n type NamespacedEntities,\n type SingleNamespaceView,\n} from '@prisma-next/framework-components/ir';\nimport type { SqlStorage } from './ir/sql-storage';\n\n/**\n * The SQL family's statically-named built-in entity kinds. `table` and\n * `valueSet` are promoted to top-level view accessors; pack-contributed kinds\n * (e.g. `policy`) stay under `.entries`.\n */\nexport const SQL_BUILTIN_KINDS = ['table', 'valueSet'] as const;\nexport type SqlBuiltinKind = (typeof SQL_BUILTIN_KINDS)[number];\n\ntype SqlEntries<TContract extends Contract<SqlStorage>> = DefaultNamespaceEntries<\n TContract['storage']\n>;\n\n/**\n * The single-namespace SQL accessors: `table`/`valueSet` top-level, pack kinds\n * under `entries`. A target that never emits a built-in kind (SQLite has\n * `sql.enums: false`, so it emits no `valueSet`) resolves that slot to an empty\n * map.\n */\nexport type SqlSingleNamespaceAccessors<TContract extends Contract<SqlStorage>> =\n SingleNamespaceView<SqlEntries<TContract>, SqlBuiltinKind>;\n\n/**\n * Single-namespace SQL view: the deserialized contract intersected with the\n * by-name accessors, so the value is substitutable for `Contract` while also\n * exposing:\n * - `view.table.<name>` / `view.valueSet.<name>` — built-in kinds, sole\n * namespace unwrapped to the root; pack kinds under `view.entries.<kind>`.\n * - `view.namespace.<id>` — the namespace-keyed entity map (SQLite's sole\n * namespace is `__unbound__`). Mirrors the runtime `db.enums` pattern.\n */\nexport type SqlSingleNamespaceView<TContract extends Contract<SqlStorage>> = TContract &\n SqlSingleNamespaceAccessors<TContract> & {\n readonly namespace: NamespacedEntities<TContract['storage'], SqlBuiltinKind>;\n };\n\n/**\n * Builds the single-namespace SQL view: unwraps the sole namespace's SQL\n * built-in kinds (`table`, `valueSet`) to the root, attaches the namespace-keyed\n * `namespace` map, and layers both over the deserialized contract. Targets with\n * one default namespace (SQLite) call this directly; Postgres qualifies by\n * schema.\n */\nexport function buildSqlSingleNamespaceView<TContract extends Contract<SqlStorage>>(\n contract: TContract,\n): SqlSingleNamespaceView<TContract> {\n const rootAccessors = buildSingleNamespaceView<SqlSingleNamespaceAccessors<TContract>>(\n contract.storage,\n SQL_BUILTIN_KINDS,\n );\n const namespace = buildNamespacedEntities<\n NamespacedEntities<TContract['storage'], SqlBuiltinKind>\n >(contract.storage, SQL_BUILTIN_KINDS);\n return {\n ...contract,\n ...rootAccessors,\n namespace,\n };\n}\n\n/**\n * Schema-qualified SQL view: the deserialized contract intersected with a single\n * `view.namespace.<id>` member — every schema reached by raw id\n * (`view.namespace.public.table.users`), mirroring the runtime `db.enums.<ns>`\n * keying exactly (the default schema keeps its literal `__unbound__` id). There\n * is NO root schema-name promotion, so there is no collision with contract\n * envelope fields — `view.storage` is always the contract's `storage`. Postgres\n * uses this; SQLite (single default namespace) uses\n * {@link buildSqlSingleNamespaceView}.\n */\nexport type SqlSchemaQualifiedView<TContract extends Contract<SqlStorage>> = TContract & {\n readonly namespace: NamespacedEntities<TContract['storage'], SqlBuiltinKind>;\n};\n\n/**\n * Builds the schema-qualified SQL view: attaches the namespace-keyed `namespace`\n * map over the deserialized contract. Postgres uses this.\n */\nexport function buildSqlSchemaQualifiedView<TContract extends Contract<SqlStorage>>(\n contract: TContract,\n): SqlSchemaQualifiedView<TContract> {\n const namespace = buildNamespacedEntities<\n NamespacedEntities<TContract['storage'], SqlBuiltinKind>\n >(contract.storage, SQL_BUILTIN_KINDS);\n return {\n ...contract,\n namespace,\n };\n}\n"],"mappings":";;;;;;;AAeA,MAAa,oBAAoB,CAAC,SAAS,UAAU;;;;;;;;AAqCrD,SAAgB,4BACd,UACmC;CACnC,MAAM,gBAAgB,yBACpB,SAAS,SACT,iBACF;CACA,MAAM,YAAY,wBAEhB,SAAS,SAAS,iBAAiB;CACrC,OAAO;EACL,GAAG;EACH,GAAG;EACH;CACF;AACF;;;;;AAoBA,SAAgB,4BACd,UACmC;CACnC,MAAM,YAAY,wBAEhB,SAAS,SAAS,iBAAiB;CACrC,OAAO;EACL,GAAG;EACH;CACF;AACF"}
@@ -0,0 +1,131 @@
1
+ import { r as StorageTable, t as StorageValueSet } from "./storage-value-set-C4XInPlX.mjs";
2
+ import { type } from "arktype";
3
+ //#region src/ir/storage-entry-schemas.ts
4
+ const literalKindSchema = type("'literal'");
5
+ const functionKindSchema = type("'function'");
6
+ const ControlPolicySchema = type("'managed' | 'tolerated' | 'external' | 'observed'");
7
+ const ColumnDefaultLiteralSchema = type.declare().type({
8
+ kind: literalKindSchema,
9
+ value: "string | number | boolean | null | unknown[] | Record<string, unknown>"
10
+ });
11
+ const ColumnDefaultFunctionSchema = type.declare().type({
12
+ kind: functionKindSchema,
13
+ expression: "string"
14
+ });
15
+ const ColumnDefaultSchema = ColumnDefaultLiteralSchema.or(ColumnDefaultFunctionSchema);
16
+ const StorageValueSetRefSchema = type({
17
+ plane: "'storage'",
18
+ namespaceId: "string",
19
+ entityKind: "'valueSet'",
20
+ entityName: "string",
21
+ "spaceId?": "string"
22
+ });
23
+ const StorageColumnSchema = type({
24
+ "+": "reject",
25
+ nativeType: "string",
26
+ codecId: "string",
27
+ nullable: "boolean",
28
+ "many?": "boolean",
29
+ "typeParams?": "Record<string, unknown>",
30
+ "typeRef?": "string",
31
+ "default?": ColumnDefaultSchema,
32
+ "control?": ControlPolicySchema,
33
+ "valueSet?": StorageValueSetRefSchema
34
+ }).narrow((col, ctx) => {
35
+ if (col.typeParams !== void 0 && col.typeRef !== void 0) return ctx.mustBe("a column with either typeParams or typeRef, not both");
36
+ return true;
37
+ });
38
+ /**
39
+ * Storage value-set entry under `storage.namespaces[id].entries.valueSet[name]`.
40
+ * Carries a `kind: 'valueSet'` discriminator (enumerable, survives JSON) and an
41
+ * ordered `values` array of codec-encoded permitted values.
42
+ */
43
+ const StorageValueSetSchema = type({
44
+ kind: "'valueSet'",
45
+ values: type("string | number | boolean | null | unknown[] | Record<string, unknown>").array().readonly()
46
+ });
47
+ const PrimaryKeySchema = type.declare().type({
48
+ columns: type.string.array().readonly(),
49
+ "name?": "string"
50
+ });
51
+ const UniqueConstraintSchema = type.declare().type({
52
+ columns: type.string.array().readonly(),
53
+ "name?": "string"
54
+ });
55
+ const IndexSchema = type({
56
+ columns: type.string.array().readonly(),
57
+ "name?": "string",
58
+ "type?": "string",
59
+ "options?": "Record<string, unknown>"
60
+ });
61
+ const ForeignKeyReferenceSchema = type({
62
+ "+": "reject",
63
+ namespaceId: "string",
64
+ tableName: "string",
65
+ columns: type.string.array().readonly(),
66
+ "spaceId?": "string"
67
+ });
68
+ const ForeignKeySourceSchema = type({
69
+ "+": "reject",
70
+ namespaceId: "string",
71
+ tableName: "string",
72
+ columns: type.string.array().readonly()
73
+ });
74
+ const ReferentialActionSchema = type.declare().type("'noAction' | 'restrict' | 'cascade' | 'setNull' | 'setDefault'");
75
+ const ForeignKeySchema = type.declare().type({
76
+ source: ForeignKeySourceSchema,
77
+ target: ForeignKeyReferenceSchema,
78
+ "name?": "string",
79
+ "onDelete?": ReferentialActionSchema,
80
+ "onUpdate?": ReferentialActionSchema,
81
+ constraint: "boolean",
82
+ index: "boolean"
83
+ });
84
+ const CheckConstraintSchema = type({
85
+ "+": "reject",
86
+ name: "string",
87
+ column: "string",
88
+ valueSet: StorageValueSetRefSchema
89
+ });
90
+ const StorageTableSchema = type({
91
+ "+": "reject",
92
+ columns: type({ "[string]": StorageColumnSchema }),
93
+ "primaryKey?": PrimaryKeySchema,
94
+ uniques: UniqueConstraintSchema.array().readonly(),
95
+ indexes: IndexSchema.array().readonly(),
96
+ foreignKeys: ForeignKeySchema.array().readonly(),
97
+ "control?": ControlPolicySchema,
98
+ "checks?": CheckConstraintSchema.array().readonly()
99
+ });
100
+ //#endregion
101
+ //#region src/entity-kinds.ts
102
+ const tableEntityKind = {
103
+ kind: "table",
104
+ schema: StorageTableSchema,
105
+ construct: (input) => new StorageTable(input)
106
+ };
107
+ const valueSetEntityKind = {
108
+ kind: "valueSet",
109
+ schema: StorageValueSetSchema,
110
+ construct: (input) => new StorageValueSet(input)
111
+ };
112
+ /**
113
+ * Assembles the `kind → descriptor` registry for SQL namespaces: the built-in
114
+ * `table` and `valueSet` kinds plus any target `packKinds`. This builds the
115
+ * lookup table — it does not touch contract data. `hydrateNamespaceEntities`
116
+ * later consumes this registry to turn a namespace's raw entries into IR
117
+ * instances, and `createSqlContractSchema` derives validation from the same
118
+ * registry. Throws on a duplicate kind.
119
+ */
120
+ function composeSqlEntityKinds(packKinds = []) {
121
+ const kinds = new Map([["table", tableEntityKind], ["valueSet", valueSetEntityKind]]);
122
+ for (const descriptor of packKinds) {
123
+ if (kinds.has(descriptor.kind)) throw new Error(`composeSqlEntityKinds: duplicate entity kind "${descriptor.kind}" — each kind may be registered only once`);
124
+ kinds.set(descriptor.kind, descriptor);
125
+ }
126
+ return kinds;
127
+ }
128
+ //#endregion
129
+ export { ColumnDefaultFunctionSchema as a, ForeignKeyReferenceSchema as c, IndexSchema as d, ReferentialActionSchema as f, CheckConstraintSchema as i, ForeignKeySchema as l, StorageValueSetSchema as m, tableEntityKind as n, ColumnDefaultLiteralSchema as o, StorageTableSchema as p, valueSetEntityKind as r, ColumnDefaultSchema as s, composeSqlEntityKinds as t, ForeignKeySourceSchema as u };
130
+
131
+ //# sourceMappingURL=entity-kinds-CHiydmat.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-kinds-CHiydmat.mjs","names":[],"sources":["../src/ir/storage-entry-schemas.ts","../src/entity-kinds.ts"],"sourcesContent":["import { type Type, type } from 'arktype';\nimport type { ForeignKeyInput, ReferentialAction } from './foreign-key';\nimport type { ForeignKeyReferenceInput } from './foreign-key-reference';\nimport type { PrimaryKeyInput } from './primary-key';\nimport type { UniqueConstraintInput } from './unique-constraint';\n\ntype ColumnDefaultLiteral = {\n readonly kind: 'literal';\n readonly value: string | number | boolean | Record<string, unknown> | unknown[] | null;\n};\ntype ColumnDefaultFunction = { readonly kind: 'function'; readonly expression: string };\n\nconst literalKindSchema = type(\"'literal'\");\nconst functionKindSchema = type(\"'function'\");\nconst ControlPolicySchema = type(\"'managed' | 'tolerated' | 'external' | 'observed'\");\n\nexport const ColumnDefaultLiteralSchema = type.declare<ColumnDefaultLiteral>().type({\n kind: literalKindSchema,\n value: 'string | number | boolean | null | unknown[] | Record<string, unknown>',\n});\n\nexport const ColumnDefaultFunctionSchema = type.declare<ColumnDefaultFunction>().type({\n kind: functionKindSchema,\n expression: 'string',\n});\n\nexport const ColumnDefaultSchema = ColumnDefaultLiteralSchema.or(ColumnDefaultFunctionSchema);\n\nconst StorageValueSetRefSchema = type({\n plane: \"'storage'\",\n namespaceId: 'string',\n entityKind: \"'valueSet'\",\n entityName: 'string',\n 'spaceId?': 'string',\n});\n\nconst StorageColumnSchema = type({\n '+': 'reject',\n nativeType: 'string',\n codecId: 'string',\n nullable: 'boolean',\n 'many?': 'boolean',\n 'typeParams?': 'Record<string, unknown>',\n 'typeRef?': 'string',\n 'default?': ColumnDefaultSchema,\n 'control?': ControlPolicySchema,\n 'valueSet?': StorageValueSetRefSchema,\n}).narrow((col, ctx) => {\n if (col.typeParams !== undefined && col.typeRef !== undefined) {\n return ctx.mustBe('a column with either typeParams or typeRef, not both');\n }\n return true;\n});\n\n/**\n * Storage value-set entry under `storage.namespaces[id].entries.valueSet[name]`.\n * Carries a `kind: 'valueSet'` discriminator (enumerable, survives JSON) and an\n * ordered `values` array of codec-encoded permitted values.\n */\nexport const StorageValueSetSchema = type({\n kind: \"'valueSet'\",\n values: type('string | number | boolean | null | unknown[] | Record<string, unknown>')\n .array()\n .readonly(),\n});\n\nconst PrimaryKeySchema = type.declare<PrimaryKeyInput>().type({\n columns: type.string.array().readonly(),\n 'name?': 'string',\n});\n\nconst UniqueConstraintSchema = type.declare<UniqueConstraintInput>().type({\n columns: type.string.array().readonly(),\n 'name?': 'string',\n});\n\nexport const IndexSchema = type({\n columns: type.string.array().readonly(),\n 'name?': 'string',\n 'type?': 'string',\n 'options?': 'Record<string, unknown>',\n});\n\nexport const ForeignKeyReferenceSchema = type({\n '+': 'reject',\n namespaceId: 'string',\n tableName: 'string',\n columns: type.string.array().readonly(),\n 'spaceId?': 'string',\n}) satisfies Type<ForeignKeyReferenceInput>;\n\nexport const ForeignKeySourceSchema = type({\n '+': 'reject',\n namespaceId: 'string',\n tableName: 'string',\n columns: type.string.array().readonly(),\n}) satisfies Type<ForeignKeyReferenceInput>;\n\nexport const ReferentialActionSchema = type\n .declare<ReferentialAction>()\n .type(\"'noAction' | 'restrict' | 'cascade' | 'setNull' | 'setDefault'\");\n\nexport const ForeignKeySchema = type.declare<ForeignKeyInput>().type({\n source: ForeignKeySourceSchema,\n target: ForeignKeyReferenceSchema,\n 'name?': 'string',\n 'onDelete?': ReferentialActionSchema,\n 'onUpdate?': ReferentialActionSchema,\n constraint: 'boolean',\n index: 'boolean',\n});\n\nexport const CheckConstraintSchema = type({\n '+': 'reject',\n name: 'string',\n column: 'string',\n valueSet: StorageValueSetRefSchema,\n});\n\nexport const StorageTableSchema = type({\n '+': 'reject',\n columns: type({ '[string]': StorageColumnSchema }),\n 'primaryKey?': PrimaryKeySchema,\n uniques: UniqueConstraintSchema.array().readonly(),\n indexes: IndexSchema.array().readonly(),\n foreignKeys: ForeignKeySchema.array().readonly(),\n 'control?': ControlPolicySchema,\n 'checks?': CheckConstraintSchema.array().readonly(),\n});\n","import type {\n AnyEntityKindDescriptor,\n EntityKindDescriptor,\n} from '@prisma-next/framework-components/ir';\nimport { StorageTableSchema, StorageValueSetSchema } from './ir/storage-entry-schemas';\nimport { StorageTable, type StorageTableInput } from './ir/storage-table';\nimport { StorageValueSet, type StorageValueSetInput } from './ir/storage-value-set';\n\nexport const tableEntityKind: EntityKindDescriptor<StorageTableInput, StorageTable> = {\n kind: 'table',\n schema: StorageTableSchema,\n construct: (input) => new StorageTable(input),\n};\n\nexport const valueSetEntityKind: EntityKindDescriptor<StorageValueSetInput, StorageValueSet> = {\n kind: 'valueSet',\n schema: StorageValueSetSchema,\n construct: (input) => new StorageValueSet(input),\n};\n\n/**\n * Assembles the `kind → descriptor` registry for SQL namespaces: the built-in\n * `table` and `valueSet` kinds plus any target `packKinds`. This builds the\n * lookup table — it does not touch contract data. `hydrateNamespaceEntities`\n * later consumes this registry to turn a namespace's raw entries into IR\n * instances, and `createSqlContractSchema` derives validation from the same\n * registry. Throws on a duplicate kind.\n */\nexport function composeSqlEntityKinds(\n packKinds: readonly AnyEntityKindDescriptor[] = [],\n): ReadonlyMap<string, AnyEntityKindDescriptor> {\n const kinds = new Map<string, AnyEntityKindDescriptor>([\n ['table', tableEntityKind],\n ['valueSet', valueSetEntityKind],\n ]);\n for (const descriptor of packKinds) {\n if (kinds.has(descriptor.kind)) {\n throw new Error(\n `composeSqlEntityKinds: duplicate entity kind \"${descriptor.kind}\" — each kind may be registered only once`,\n );\n }\n kinds.set(descriptor.kind, descriptor);\n }\n return kinds;\n}\n"],"mappings":";;;AAYA,MAAM,oBAAoB,KAAK,WAAW;AAC1C,MAAM,qBAAqB,KAAK,YAAY;AAC5C,MAAM,sBAAsB,KAAK,mDAAmD;AAEpF,MAAa,6BAA6B,KAAK,QAA8B,CAAC,CAAC,KAAK;CAClF,MAAM;CACN,OAAO;AACT,CAAC;AAED,MAAa,8BAA8B,KAAK,QAA+B,CAAC,CAAC,KAAK;CACpF,MAAM;CACN,YAAY;AACd,CAAC;AAED,MAAa,sBAAsB,2BAA2B,GAAG,2BAA2B;AAE5F,MAAM,2BAA2B,KAAK;CACpC,OAAO;CACP,aAAa;CACb,YAAY;CACZ,YAAY;CACZ,YAAY;AACd,CAAC;AAED,MAAM,sBAAsB,KAAK;CAC/B,KAAK;CACL,YAAY;CACZ,SAAS;CACT,UAAU;CACV,SAAS;CACT,eAAe;CACf,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,aAAa;AACf,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ;CACtB,IAAI,IAAI,eAAe,KAAA,KAAa,IAAI,YAAY,KAAA,GAClD,OAAO,IAAI,OAAO,sDAAsD;CAE1E,OAAO;AACT,CAAC;;;;;;AAOD,MAAa,wBAAwB,KAAK;CACxC,MAAM;CACN,QAAQ,KAAK,wEAAwE,CAAC,CACnF,MAAM,CAAC,CACP,SAAS;AACd,CAAC;AAED,MAAM,mBAAmB,KAAK,QAAyB,CAAC,CAAC,KAAK;CAC5D,SAAS,KAAK,OAAO,MAAM,CAAC,CAAC,SAAS;CACtC,SAAS;AACX,CAAC;AAED,MAAM,yBAAyB,KAAK,QAA+B,CAAC,CAAC,KAAK;CACxE,SAAS,KAAK,OAAO,MAAM,CAAC,CAAC,SAAS;CACtC,SAAS;AACX,CAAC;AAED,MAAa,cAAc,KAAK;CAC9B,SAAS,KAAK,OAAO,MAAM,CAAC,CAAC,SAAS;CACtC,SAAS;CACT,SAAS;CACT,YAAY;AACd,CAAC;AAED,MAAa,4BAA4B,KAAK;CAC5C,KAAK;CACL,aAAa;CACb,WAAW;CACX,SAAS,KAAK,OAAO,MAAM,CAAC,CAAC,SAAS;CACtC,YAAY;AACd,CAAC;AAED,MAAa,yBAAyB,KAAK;CACzC,KAAK;CACL,aAAa;CACb,WAAW;CACX,SAAS,KAAK,OAAO,MAAM,CAAC,CAAC,SAAS;AACxC,CAAC;AAED,MAAa,0BAA0B,KACpC,QAA2B,CAAC,CAC5B,KAAK,gEAAgE;AAExE,MAAa,mBAAmB,KAAK,QAAyB,CAAC,CAAC,KAAK;CACnE,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,aAAa;CACb,aAAa;CACb,YAAY;CACZ,OAAO;AACT,CAAC;AAED,MAAa,wBAAwB,KAAK;CACxC,KAAK;CACL,MAAM;CACN,QAAQ;CACR,UAAU;AACZ,CAAC;AAED,MAAa,qBAAqB,KAAK;CACrC,KAAK;CACL,SAAS,KAAK,EAAE,YAAY,oBAAoB,CAAC;CACjD,eAAe;CACf,SAAS,uBAAuB,MAAM,CAAC,CAAC,SAAS;CACjD,SAAS,YAAY,MAAM,CAAC,CAAC,SAAS;CACtC,aAAa,iBAAiB,MAAM,CAAC,CAAC,SAAS;CAC/C,YAAY;CACZ,WAAW,sBAAsB,MAAM,CAAC,CAAC,SAAS;AACpD,CAAC;;;ACxHD,MAAa,kBAAyE;CACpF,MAAM;CACN,QAAQ;CACR,YAAY,UAAU,IAAI,aAAa,KAAK;AAC9C;AAEA,MAAa,qBAAkF;CAC7F,MAAM;CACN,QAAQ;CACR,YAAY,UAAU,IAAI,gBAAgB,KAAK;AACjD;;;;;;;;;AAUA,SAAgB,sBACd,YAAgD,CAAC,GACH;CAC9C,MAAM,QAAQ,IAAI,IAAqC,CACrD,CAAC,SAAS,eAAe,GACzB,CAAC,YAAY,kBAAkB,CACjC,CAAC;CACD,KAAK,MAAM,cAAc,WAAW;EAClC,IAAI,MAAM,IAAI,WAAW,IAAI,GAC3B,MAAM,IAAI,MACR,iDAAiD,WAAW,KAAK,0CACnE;EAEF,MAAM,IAAI,WAAW,MAAM,UAAU;CACvC;CACA,OAAO;AACT"}
@@ -1,4 +1,5 @@
1
- import { i as StorageTableInput, n as StorageValueSetInput, r as StorageTable, t as StorageValueSet } from "./storage-value-set-WnYsIFM8.mjs";
1
+ import { n as StorageTableInput, t as StorageTable } from "./storage-table-Bj1ZN1P7.mjs";
2
+ import { n as StorageValueSetInput, t as StorageValueSet } from "./storage-value-set-D-jww77l.mjs";
2
3
  import { AnyEntityKindDescriptor, EntityKindDescriptor } from "@prisma-next/framework-components/ir";
3
4
 
4
5
  //#region src/entity-kinds.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"entity-kinds.d.mts","names":[],"sources":["../src/entity-kinds.ts"],"mappings":";;;;cAQa,eAAA,EAAiB,oBAAA,CAAqB,iBAAA,EAAmB,YAAA;AAAA,cAMzD,kBAAA,EAAoB,oBAAA,CAAqB,oBAAA,EAAsB,eAAA;;;;;;;;;iBAc5D,qBAAA,CACd,SAAA,YAAoB,uBAAA,KACnB,WAAA,SAAoB,uBAAA"}
1
+ {"version":3,"file":"entity-kinds.d.mts","names":[],"sources":["../src/entity-kinds.ts"],"mappings":";;;;;cAQa,eAAA,EAAiB,oBAAA,CAAqB,iBAAA,EAAmB,YAAA;AAAA,cAMzD,kBAAA,EAAoB,oBAAA,CAAqB,oBAAA,EAAsB,eAAA;AAN5E;;;;;;;;AAAA,iBAoBgB,qBAAA,CACd,SAAA,YAAoB,uBAAA,KACnB,WAAA,SAAoB,uBAAA"}
@@ -1,2 +1,2 @@
1
- import { n as tableEntityKind, r as valueSetEntityKind, t as composeSqlEntityKinds } from "./entity-kinds-Cl36zL5j.mjs";
1
+ import { n as tableEntityKind, r as valueSetEntityKind, t as composeSqlEntityKinds } from "./entity-kinds-CHiydmat.mjs";
2
2
  export { composeSqlEntityKinds, tableEntityKind, valueSetEntityKind };
@@ -1,10 +1,12 @@
1
- import { t as ForeignKey } from "./foreign-key-BATxB95l.mjs";
2
- import { a as UniqueConstraint, c as StorageColumnInput, d as PrimaryKey, l as Index, r as StorageTable, s as StorageColumn } from "./storage-value-set-WnYsIFM8.mjs";
3
- import { b as SqlModelFieldStorage, f as ForeignKeyOptions, x as SqlModelStorage } from "./types-B1N8w0I2.mjs";
1
+ import { a as StorageColumn, l as PrimaryKey, o as StorageColumnInput, r as UniqueConstraint, s as Index, t as StorageTable } from "./storage-table-Bj1ZN1P7.mjs";
2
+ import { t as ForeignKey } from "./foreign-key-DM1UTydh.mjs";
3
+ import { T as SqlModelStorage, m as ForeignKeyOptions, w as SqlModelFieldStorage } from "./types-zBvpNCmg.mjs";
4
4
  import { ScalarFieldType } from "@prisma-next/contract/types";
5
5
 
6
6
  //#region src/factories.d.ts
7
- declare function col(nativeType: string, codecId: string, nullable?: boolean): StorageColumn;
7
+ declare function col(nativeType: string, codecId: string, nullable?: boolean, opts?: {
8
+ readonly many?: boolean;
9
+ }): StorageColumn;
8
10
  declare function pk(...columns: readonly string[]): PrimaryKey;
9
11
  declare function unique(...columns: readonly string[]): UniqueConstraint;
10
12
  declare function index(...columns: readonly string[]): Index;
@@ -1 +1 @@
1
- {"version":3,"file":"factories.d.mts","names":[],"sources":["../src/factories.ts"],"mappings":";;;;;;iBAgBgB,GAAA,CAAI,UAAA,UAAoB,OAAA,UAAiB,QAAA,aAAmB,aAAa;AAAA,iBAIzE,EAAA,IAAM,OAAA,sBAA6B,UAAU;AAAA,iBAI7C,MAAA,IAAU,OAAA,sBAA6B,gBAAgB;AAAA,iBAIvD,KAAA,IAAS,OAAA,sBAA6B,KAAK;AAAA,iBAI3C,EAAA,CACd,YAAA,UACA,UAAA,qBACA,eAAA,UACA,aAAA,qBACA,IAAA,GAAO,iBAAA;EAAsB,UAAA;EAAsB,KAAA;EAAiB,WAAA;AAAA,IACnE,UAAU;AAAA,iBAcG,KAAA,CACd,OAAA,EAAS,MAAA,SAAe,aAAA,GAAgB,kBAAA,GACxC,IAAA;EACE,EAAA,GAAK,UAAA;EACL,OAAA,YAAmB,gBAAA;EACnB,OAAA,YAAmB,KAAA;EACnB,GAAA,YAAe,UAAA;AAAA,IAEhB,YAAA;AAAA,iBAUa,KAAA,CACd,SAAA,UACA,MAAA,EAAQ,MAAA,SAAe,oBAAA,GACvB,SAAA,GAAW,MAAA,mBACX,WAAA;EAEA,OAAA,EAAS,eAAA;EACT,MAAA,EAAQ,MAAA;IAAA,SAA0B,QAAA;IAAA,SAA4B,IAAA,EAAM,eAAA;EAAA;EACpE,SAAA,EAAW,MAAA;AAAA"}
1
+ {"version":3,"file":"factories.d.mts","names":[],"sources":["../src/factories.ts"],"mappings":";;;;;;iBAgBgB,GAAA,CACd,UAAA,UACA,OAAA,UACA,QAAA,YACA,IAAA;EAAA,SAAkB,IAAA;AAAA,IACjB,aAAa;AAAA,iBASA,EAAA,IAAM,OAAA,sBAA6B,UAAU;AAAA,iBAI7C,MAAA,IAAU,OAAA,sBAA6B,gBAAgB;AAAA,iBAIvD,KAAA,IAAS,OAAA,sBAA6B,KAAK;AAAA,iBAI3C,EAAA,CACd,YAAA,UACA,UAAA,qBACA,eAAA,UACA,aAAA,qBACA,IAAA,GAAO,iBAAA;EAAsB,UAAA;EAAsB,KAAA;EAAiB,WAAA;AAAA,IACnE,UAAU;AAAA,iBAcG,KAAA,CACd,OAAA,EAAS,MAAA,SAAe,aAAA,GAAgB,kBAAA,GACxC,IAAA;EACE,EAAA,GAAK,UAAA;EACL,OAAA,YAAmB,gBAAA;EACnB,OAAA,YAAmB,KAAA;EACnB,GAAA,YAAe,UAAA;AAAA,IAEhB,YAAA;AAAA,iBAUa,KAAA,CACd,SAAA,UACA,MAAA,EAAQ,MAAA,SAAe,oBAAA,GACvB,SAAA,GAAW,MAAA,mBACX,WAAA;EAEA,OAAA,EAAS,eAAA;EACT,MAAA,EAAQ,MAAA;IAAA,SAA0B,QAAA;IAAA,SAA4B,IAAA,EAAM,eAAA;EAAA;EACpE,SAAA,EAAW,MAAA;AAAA"}
@@ -1,13 +1,14 @@
1
- import { a as StorageTable, c as Index, l as PrimaryKey, o as UniqueConstraint, s as StorageColumn, u as ForeignKey } from "./entity-kinds-Cl36zL5j.mjs";
2
- import { r as applyFkDefaults } from "./types-B-eiQXff.mjs";
1
+ import { a as StorageColumn, c as ForeignKey, i as UniqueConstraint, o as Index, r as StorageTable, s as PrimaryKey } from "./storage-value-set-C4XInPlX.mjs";
2
+ import { r as applyFkDefaults } from "./types-KiOT4SAV.mjs";
3
3
  import { UNBOUND_NAMESPACE_ID } from "@prisma-next/framework-components/ir";
4
4
  import { asNamespaceId } from "@prisma-next/contract/types";
5
5
  //#region src/factories.ts
6
- function col(nativeType, codecId, nullable = false) {
6
+ function col(nativeType, codecId, nullable = false, opts) {
7
7
  return new StorageColumn({
8
8
  nativeType,
9
9
  codecId,
10
- nullable
10
+ nullable,
11
+ ...opts?.many !== void 0 && { many: opts.many }
11
12
  });
12
13
  }
13
14
  function pk(...columns) {
@@ -1 +1 @@
1
- {"version":3,"file":"factories.mjs","names":[],"sources":["../src/factories.ts"],"sourcesContent":["import { asNamespaceId, type ScalarFieldType } from '@prisma-next/contract/types';\nimport { UNBOUND_NAMESPACE_ID } from '@prisma-next/framework-components/ir';\nimport {\n applyFkDefaults,\n ForeignKey,\n type ForeignKeyOptions,\n Index,\n PrimaryKey,\n type SqlModelFieldStorage,\n type SqlModelStorage,\n StorageColumn,\n type StorageColumnInput,\n StorageTable,\n UniqueConstraint,\n} from './types';\n\nexport function col(nativeType: string, codecId: string, nullable = false): StorageColumn {\n return new StorageColumn({ nativeType, codecId, nullable });\n}\n\nexport function pk(...columns: readonly string[]): PrimaryKey {\n return new PrimaryKey({ columns });\n}\n\nexport function unique(...columns: readonly string[]): UniqueConstraint {\n return new UniqueConstraint({ columns });\n}\n\nexport function index(...columns: readonly string[]): Index {\n return new Index({ columns });\n}\n\nexport function fk(\n srcTableName: string,\n srcColumns: readonly string[],\n targetTableName: string,\n targetColumns: readonly string[],\n opts?: ForeignKeyOptions & { constraint?: boolean; index?: boolean; namespaceId?: string },\n): ForeignKey {\n const defaults = applyFkDefaults({ constraint: opts?.constraint, index: opts?.index });\n const namespaceId = asNamespaceId(opts?.namespaceId ?? UNBOUND_NAMESPACE_ID);\n return new ForeignKey({\n source: { namespaceId, tableName: srcTableName, columns: srcColumns },\n target: { namespaceId, tableName: targetTableName, columns: targetColumns },\n ...(opts?.name !== undefined && { name: opts.name }),\n ...(opts?.onDelete !== undefined && { onDelete: opts.onDelete }),\n ...(opts?.onUpdate !== undefined && { onUpdate: opts.onUpdate }),\n constraint: defaults.constraint,\n index: defaults.index,\n });\n}\n\nexport function table(\n columns: Record<string, StorageColumn | StorageColumnInput>,\n opts?: {\n pk?: PrimaryKey;\n uniques?: readonly UniqueConstraint[];\n indexes?: readonly Index[];\n fks?: readonly ForeignKey[];\n },\n): StorageTable {\n return new StorageTable({\n columns,\n ...(opts?.pk !== undefined && { primaryKey: opts.pk }),\n uniques: opts?.uniques ?? [],\n indexes: opts?.indexes ?? [],\n foreignKeys: opts?.fks ?? [],\n });\n}\n\nexport function model(\n tableName: string,\n fields: Record<string, SqlModelFieldStorage>,\n relations: Record<string, unknown> = {},\n namespaceId: string = UNBOUND_NAMESPACE_ID,\n): {\n storage: SqlModelStorage;\n fields: Record<string, { readonly nullable: boolean; readonly type: ScalarFieldType }>;\n relations: Record<string, unknown>;\n} {\n const storage: SqlModelStorage = { table: tableName, namespaceId, fields };\n const domainFields = Object.fromEntries(\n Object.entries(fields).map(([name, field]) => [\n name,\n {\n nullable: field.nullable ?? false,\n type: { kind: 'scalar' as const, codecId: field.codecId ?? 'core/unknown@1' },\n },\n ]),\n ) as Record<string, { nullable: boolean; type: ScalarFieldType }>;\n return {\n storage,\n fields: domainFields,\n relations,\n };\n}\n"],"mappings":";;;;;AAgBA,SAAgB,IAAI,YAAoB,SAAiB,WAAW,OAAsB;CACxF,OAAO,IAAI,cAAc;EAAE;EAAY;EAAS;CAAS,CAAC;AAC5D;AAEA,SAAgB,GAAG,GAAG,SAAwC;CAC5D,OAAO,IAAI,WAAW,EAAE,QAAQ,CAAC;AACnC;AAEA,SAAgB,OAAO,GAAG,SAA8C;CACtE,OAAO,IAAI,iBAAiB,EAAE,QAAQ,CAAC;AACzC;AAEA,SAAgB,MAAM,GAAG,SAAmC;CAC1D,OAAO,IAAI,MAAM,EAAE,QAAQ,CAAC;AAC9B;AAEA,SAAgB,GACd,cACA,YACA,iBACA,eACA,MACY;CACZ,MAAM,WAAW,gBAAgB;EAAE,YAAY,MAAM;EAAY,OAAO,MAAM;CAAM,CAAC;CACrF,MAAM,cAAc,cAAc,MAAM,eAAe,oBAAoB;CAC3E,OAAO,IAAI,WAAW;EACpB,QAAQ;GAAE;GAAa,WAAW;GAAc,SAAS;EAAW;EACpE,QAAQ;GAAE;GAAa,WAAW;GAAiB,SAAS;EAAc;EAC1E,GAAI,MAAM,SAAS,KAAA,KAAa,EAAE,MAAM,KAAK,KAAK;EAClD,GAAI,MAAM,aAAa,KAAA,KAAa,EAAE,UAAU,KAAK,SAAS;EAC9D,GAAI,MAAM,aAAa,KAAA,KAAa,EAAE,UAAU,KAAK,SAAS;EAC9D,YAAY,SAAS;EACrB,OAAO,SAAS;CAClB,CAAC;AACH;AAEA,SAAgB,MACd,SACA,MAMc;CACd,OAAO,IAAI,aAAa;EACtB;EACA,GAAI,MAAM,OAAO,KAAA,KAAa,EAAE,YAAY,KAAK,GAAG;EACpD,SAAS,MAAM,WAAW,CAAC;EAC3B,SAAS,MAAM,WAAW,CAAC;EAC3B,aAAa,MAAM,OAAO,CAAC;CAC7B,CAAC;AACH;AAEA,SAAgB,MACd,WACA,QACA,YAAqC,CAAC,GACtC,cAAsB,sBAKtB;CAWA,OAAO;EACL,SAAA;GAXiC,OAAO;GAAW;GAAa;EAW1D;EACN,QAXmB,OAAO,YAC1B,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAC5C,MACA;GACE,UAAU,MAAM,YAAY;GAC5B,MAAM;IAAE,MAAM;IAAmB,SAAS,MAAM,WAAW;GAAiB;EAC9E,CACF,CAAC,CAIkB;EACnB;CACF;AACF"}
1
+ {"version":3,"file":"factories.mjs","names":[],"sources":["../src/factories.ts"],"sourcesContent":["import { asNamespaceId, type ScalarFieldType } from '@prisma-next/contract/types';\nimport { UNBOUND_NAMESPACE_ID } from '@prisma-next/framework-components/ir';\nimport {\n applyFkDefaults,\n ForeignKey,\n type ForeignKeyOptions,\n Index,\n PrimaryKey,\n type SqlModelFieldStorage,\n type SqlModelStorage,\n StorageColumn,\n type StorageColumnInput,\n StorageTable,\n UniqueConstraint,\n} from './types';\n\nexport function col(\n nativeType: string,\n codecId: string,\n nullable = false,\n opts?: { readonly many?: boolean },\n): StorageColumn {\n return new StorageColumn({\n nativeType,\n codecId,\n nullable,\n ...(opts?.many !== undefined && { many: opts.many }),\n });\n}\n\nexport function pk(...columns: readonly string[]): PrimaryKey {\n return new PrimaryKey({ columns });\n}\n\nexport function unique(...columns: readonly string[]): UniqueConstraint {\n return new UniqueConstraint({ columns });\n}\n\nexport function index(...columns: readonly string[]): Index {\n return new Index({ columns });\n}\n\nexport function fk(\n srcTableName: string,\n srcColumns: readonly string[],\n targetTableName: string,\n targetColumns: readonly string[],\n opts?: ForeignKeyOptions & { constraint?: boolean; index?: boolean; namespaceId?: string },\n): ForeignKey {\n const defaults = applyFkDefaults({ constraint: opts?.constraint, index: opts?.index });\n const namespaceId = asNamespaceId(opts?.namespaceId ?? UNBOUND_NAMESPACE_ID);\n return new ForeignKey({\n source: { namespaceId, tableName: srcTableName, columns: srcColumns },\n target: { namespaceId, tableName: targetTableName, columns: targetColumns },\n ...(opts?.name !== undefined && { name: opts.name }),\n ...(opts?.onDelete !== undefined && { onDelete: opts.onDelete }),\n ...(opts?.onUpdate !== undefined && { onUpdate: opts.onUpdate }),\n constraint: defaults.constraint,\n index: defaults.index,\n });\n}\n\nexport function table(\n columns: Record<string, StorageColumn | StorageColumnInput>,\n opts?: {\n pk?: PrimaryKey;\n uniques?: readonly UniqueConstraint[];\n indexes?: readonly Index[];\n fks?: readonly ForeignKey[];\n },\n): StorageTable {\n return new StorageTable({\n columns,\n ...(opts?.pk !== undefined && { primaryKey: opts.pk }),\n uniques: opts?.uniques ?? [],\n indexes: opts?.indexes ?? [],\n foreignKeys: opts?.fks ?? [],\n });\n}\n\nexport function model(\n tableName: string,\n fields: Record<string, SqlModelFieldStorage>,\n relations: Record<string, unknown> = {},\n namespaceId: string = UNBOUND_NAMESPACE_ID,\n): {\n storage: SqlModelStorage;\n fields: Record<string, { readonly nullable: boolean; readonly type: ScalarFieldType }>;\n relations: Record<string, unknown>;\n} {\n const storage: SqlModelStorage = { table: tableName, namespaceId, fields };\n const domainFields = Object.fromEntries(\n Object.entries(fields).map(([name, field]) => [\n name,\n {\n nullable: field.nullable ?? false,\n type: { kind: 'scalar' as const, codecId: field.codecId ?? 'core/unknown@1' },\n },\n ]),\n ) as Record<string, { nullable: boolean; type: ScalarFieldType }>;\n return {\n storage,\n fields: domainFields,\n relations,\n };\n}\n"],"mappings":";;;;;AAgBA,SAAgB,IACd,YACA,SACA,WAAW,OACX,MACe;CACf,OAAO,IAAI,cAAc;EACvB;EACA;EACA;EACA,GAAI,MAAM,SAAS,KAAA,KAAa,EAAE,MAAM,KAAK,KAAK;CACpD,CAAC;AACH;AAEA,SAAgB,GAAG,GAAG,SAAwC;CAC5D,OAAO,IAAI,WAAW,EAAE,QAAQ,CAAC;AACnC;AAEA,SAAgB,OAAO,GAAG,SAA8C;CACtE,OAAO,IAAI,iBAAiB,EAAE,QAAQ,CAAC;AACzC;AAEA,SAAgB,MAAM,GAAG,SAAmC;CAC1D,OAAO,IAAI,MAAM,EAAE,QAAQ,CAAC;AAC9B;AAEA,SAAgB,GACd,cACA,YACA,iBACA,eACA,MACY;CACZ,MAAM,WAAW,gBAAgB;EAAE,YAAY,MAAM;EAAY,OAAO,MAAM;CAAM,CAAC;CACrF,MAAM,cAAc,cAAc,MAAM,eAAe,oBAAoB;CAC3E,OAAO,IAAI,WAAW;EACpB,QAAQ;GAAE;GAAa,WAAW;GAAc,SAAS;EAAW;EACpE,QAAQ;GAAE;GAAa,WAAW;GAAiB,SAAS;EAAc;EAC1E,GAAI,MAAM,SAAS,KAAA,KAAa,EAAE,MAAM,KAAK,KAAK;EAClD,GAAI,MAAM,aAAa,KAAA,KAAa,EAAE,UAAU,KAAK,SAAS;EAC9D,GAAI,MAAM,aAAa,KAAA,KAAa,EAAE,UAAU,KAAK,SAAS;EAC9D,YAAY,SAAS;EACrB,OAAO,SAAS;CAClB,CAAC;AACH;AAEA,SAAgB,MACd,SACA,MAMc;CACd,OAAO,IAAI,aAAa;EACtB;EACA,GAAI,MAAM,OAAO,KAAA,KAAa,EAAE,YAAY,KAAK,GAAG;EACpD,SAAS,MAAM,WAAW,CAAC;EAC3B,SAAS,MAAM,WAAW,CAAC;EAC3B,aAAa,MAAM,OAAO,CAAC;CAC7B,CAAC;AACH;AAEA,SAAgB,MACd,WACA,QACA,YAAqC,CAAC,GACtC,cAAsB,sBAKtB;CAWA,OAAO;EACL,SAAA;GAXiC,OAAO;GAAW;GAAa;EAW1D;EACN,QAXmB,OAAO,YAC1B,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW,CAC5C,MACA;GACE,UAAU,MAAM,YAAY;GAC5B,MAAM;IAAE,MAAM;IAAmB,SAAS,MAAM,WAAW;GAAiB;EAC9E,CACF,CAAC,CAIkB;EACnB;CACF;AACF"}
@@ -1,44 +1,6 @@
1
- import { IRNodeBase } from "@prisma-next/framework-components/ir";
1
+ import { t as SqlNode } from "./sql-node-V214WXQD.mjs";
2
2
  import { NamespaceId } from "@prisma-next/contract/types";
3
3
 
4
- //#region src/ir/sql-node.d.ts
5
- /**
6
- * SQL family IR node base. Carries the family-level `kind` discriminator
7
- * `'sql'` and inherits the framework's `freezeNode` affordance.
8
- *
9
- * Single family-level discriminator (not per-leaf) reflects the fact that
10
- * SQL IR has no polymorphic dispatch today — verifiers and serializers
11
- * walk by structural position (`storage.tables[name].columns[name]`),
12
- * not by inspecting `kind`. The abstract bar for per-leaf discriminators
13
- * isn't earned until a future polymorphic consumer arrives.
14
- *
15
- * `kind` is installed as a non-enumerable own property on every instance,
16
- * which keeps three things clean simultaneously:
17
- *
18
- * - `JSON.stringify(node)` produces the canonical pre-lift JSON envelope
19
- * shape (no `kind` field), so emitted contract.json files and the
20
- * `validateSqlContractFully` arktype schemas stay unchanged.
21
- * - Test assertions that use `toEqual({...})` against the pre-lift flat
22
- * shape continue to pass — only enumerable own properties are
23
- * compared.
24
- * - Direct access (`node.kind`) and runtime narrowing
25
- * (`if (node.kind === 'sql')`) still work, so future polymorphic
26
- * dispatch can begin reading `kind` without a runtime change.
27
- *
28
- * Future per-leaf overrides land cleanly: a class that gains a
29
- * polymorphic-dispatch consumer (e.g. an enum type instance walked
30
- * alongside other types) overrides `kind` with its narrower literal
31
- * at that leaf level. Per-leaf overrides will use enumerable kind
32
- * (matching the Mongo per-class-discriminator precedent) because they
33
- * encode dispatch-relevant information that callers need to see in
34
- * JSON envelopes; the family-level `'sql'` is uniform across all SQL
35
- * IR and carries no dispatch-relevant information.
36
- */
37
- declare abstract class SqlNode extends IRNodeBase {
38
- readonly kind?: string;
39
- constructor();
40
- }
41
- //#endregion
42
4
  //#region src/ir/foreign-key-reference.d.ts
43
5
  /**
44
6
  * Input for a foreign-key reference (one side of a foreign-key declaration).
@@ -117,5 +79,5 @@ declare class ForeignKey extends SqlNode {
117
79
  constructor(input: ForeignKeyInput);
118
80
  }
119
81
  //#endregion
120
- export { ForeignKeyReferenceInput as a, ForeignKeyReference as i, ForeignKeyInput as n, SqlNode as o, ReferentialAction as r, ForeignKey as t };
121
- //# sourceMappingURL=foreign-key-BATxB95l.d.mts.map
82
+ export { ForeignKeyReferenceInput as a, ForeignKeyReference as i, ForeignKeyInput as n, ReferentialAction as r, ForeignKey as t };
83
+ //# sourceMappingURL=foreign-key-DM1UTydh.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foreign-key-DM1UTydh.d.mts","names":[],"sources":["../src/ir/foreign-key-reference.ts","../src/ir/foreign-key.ts"],"mappings":";;;;;;AAeA;;;;;;;;;UAAiB,wBAAA;EAAA,SACN,WAAA;EAAA,SACA,SAAA;EAAA,SACA,OAAA;EAAA,SACA,OAAA;AAAA;;;;;;;;;;;;;;AAyBkC;;;cANhC,mBAAA,SAA4B,OAAA;EAAA,SAC9B,WAAA,EAAa,WAAA;EAAA,SACb,SAAA;EAAA,SACA,OAAA;EAAA,SACQ,OAAA;cAEL,KAAA,EAAO,wBAAA;AAAA;;;KCxCT,iBAAA;AAAA,UAEK,eAAA;EAAA,SACN,MAAA,EAAQ,mBAAA,GAAsB,wBAAA;EAAA,SAC9B,MAAA,EAAQ,mBAAA,GAAsB,wBAAA;EAAA,SAC9B,IAAA;EAAA,SACA,QAAA,GAAW,iBAAA;EAAA,SACX,QAAA,GAAW,iBAAA;EDMX;EAAA,SCJA,UAAA;EDMA;EAAA,SCJA,KAAA;AAAA;ADuBX;;;;;;;;;;;;AAAA,cCRa,UAAA,SAAmB,OAAA;EAAA,SACrB,MAAA,EAAQ,mBAAA;EAAA,SACR,MAAA,EAAQ,mBAAA;EAAA,SACR,UAAA;EAAA,SACA,KAAA;EAAA,SACQ,IAAA;EAAA,SACA,QAAA,GAAW,iBAAA;EAAA,SACX,QAAA,GAAW,iBAAA;cAEhB,KAAA,EAAO,eAAA;AAAA"}
@@ -1,4 +1,4 @@
1
- import { i as SqlStorage } from "./sql-storage-Dga0jwP2.mjs";
1
+ import { s as SqlStorage } from "./sql-storage-BRB55sCP.mjs";
2
2
  import { a as IndexTypeRegistry } from "./index-types-Czsyu7Iw.mjs";
3
3
  import { Contract } from "@prisma-next/contract/types";
4
4
 
@@ -1,4 +1,4 @@
1
- import { r as ReferentialAction } from "./foreign-key-BATxB95l.mjs";
1
+ import { r as ReferentialAction } from "./foreign-key-DM1UTydh.mjs";
2
2
 
3
3
  //#region src/referential-action-sql.d.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
- import { r as StorageTable } from "./storage-value-set-WnYsIFM8.mjs";
2
- import { i as SqlStorage } from "./sql-storage-Dga0jwP2.mjs";
1
+ import { t as StorageTable } from "./storage-table-Bj1ZN1P7.mjs";
2
+ import { s as SqlStorage } from "./sql-storage-BRB55sCP.mjs";
3
3
 
4
4
  //#region src/resolve-storage-table.d.ts
5
5
  interface ResolvedStorageTable {
@@ -0,0 +1,42 @@
1
+ import { IRNodeBase } from "@prisma-next/framework-components/ir";
2
+
3
+ //#region src/ir/sql-node.d.ts
4
+ /**
5
+ * SQL family IR node base. Carries the family-level `kind` discriminator
6
+ * `'sql'` and inherits the framework's `freezeNode` affordance.
7
+ *
8
+ * Single family-level discriminator (not per-leaf) reflects the fact that
9
+ * SQL IR has no polymorphic dispatch today — verifiers and serializers
10
+ * walk by structural position (`storage.tables[name].columns[name]`),
11
+ * not by inspecting `kind`. The abstract bar for per-leaf discriminators
12
+ * isn't earned until a future polymorphic consumer arrives.
13
+ *
14
+ * `kind` is installed as a non-enumerable own property on every instance,
15
+ * which keeps three things clean simultaneously:
16
+ *
17
+ * - `JSON.stringify(node)` produces the canonical pre-lift JSON envelope
18
+ * shape (no `kind` field), so emitted contract.json files and the
19
+ * `validateSqlContractFully` arktype schemas stay unchanged.
20
+ * - Test assertions that use `toEqual({...})` against the pre-lift flat
21
+ * shape continue to pass — only enumerable own properties are
22
+ * compared.
23
+ * - Direct access (`node.kind`) and runtime narrowing
24
+ * (`if (node.kind === 'sql')`) still work, so future polymorphic
25
+ * dispatch can begin reading `kind` without a runtime change.
26
+ *
27
+ * Future per-leaf overrides land cleanly: a class that gains a
28
+ * polymorphic-dispatch consumer (e.g. an enum type instance walked
29
+ * alongside other types) overrides `kind` with its narrower literal
30
+ * at that leaf level. Per-leaf overrides will use enumerable kind
31
+ * (matching the Mongo per-class-discriminator precedent) because they
32
+ * encode dispatch-relevant information that callers need to see in
33
+ * JSON envelopes; the family-level `'sql'` is uniform across all SQL
34
+ * IR and carries no dispatch-relevant information.
35
+ */
36
+ declare abstract class SqlNode extends IRNodeBase {
37
+ readonly kind?: string;
38
+ constructor();
39
+ }
40
+ //#endregion
41
+ export { SqlNode as t };
42
+ //# sourceMappingURL=sql-node-V214WXQD.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-node-V214WXQD.d.mts","names":[],"sources":["../src/ir/sql-node.ts"],"mappings":";;;;;AAkCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAAsB,OAAA,SAAgB,UAAU;EAAA,SACrC,IAAA"}
@@ -1,7 +1,9 @@
1
- import { o as SqlNode } from "./foreign-key-BATxB95l.mjs";
2
- import { r as StorageTable, t as StorageValueSet } from "./storage-value-set-WnYsIFM8.mjs";
3
- import { Namespace, Storage, StorageType } from "@prisma-next/framework-components/ir";
1
+ import { t as SqlNode } from "./sql-node-V214WXQD.mjs";
2
+ import { t as StorageTable } from "./storage-table-Bj1ZN1P7.mjs";
3
+ import { t as StorageValueSet } from "./storage-value-set-D-jww77l.mjs";
4
+ import { Namespace, NamespaceBase, Storage, StorageType } from "@prisma-next/framework-components/ir";
4
5
  import { StorageHashBase } from "@prisma-next/contract/types";
6
+ import { AuthoringContributions } from "@prisma-next/framework-components/authoring";
5
7
 
6
8
  //#region src/ir/storage-type-instance.d.ts
7
9
  /**
@@ -60,14 +62,34 @@ declare function isStorageTypeInstance(value: unknown): value is StorageTypeInst
60
62
  * `entries.type` slot on `PostgresSchema` (target layer), not here.
61
63
  */
62
64
  type SqlStorageTypeEntry = StorageTypeInstance | StorageTypeInstanceInput;
63
- interface SqlNamespaceTablesInput {
65
+ interface SqlNamespaceInput {
64
66
  readonly id: string;
65
67
  readonly entries: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
66
68
  }
69
+ /**
70
+ * Target-supplied factory that materializes a `Namespace` from a SQL
71
+ * `SqlNamespaceInput` (used to populate `SqlStorage.namespaces`).
72
+ */
73
+ type SqlNamespaceFactory = (input: SqlNamespaceInput) => Namespace;
74
+ /**
75
+ * SQL-family extension of the framework `AuthoringContributions`. SQL target
76
+ * packs add a `createNamespace` factory so the PSL/TS authoring paths can
77
+ * materialize namespaces (and merge lowered extension-block entities) without
78
+ * each consumer re-specifying it. The factory is SQL-specific, so it lives here
79
+ * rather than on the framework `AuthoringContributions` base.
80
+ */
81
+ interface SqlAuthoringContributions extends AuthoringContributions {
82
+ readonly createNamespace?: SqlNamespaceFactory;
83
+ }
84
+ /**
85
+ * Narrows framework `AuthoringContributions` to the SQL-family shape by testing
86
+ * for the SQL-specific `createNamespace` capability.
87
+ */
88
+ declare function isSqlAuthoringContributions(authoring: AuthoringContributions | undefined): authoring is SqlAuthoringContributions;
67
89
  interface SqlStorageInput<THash extends string = string> {
68
90
  readonly storageHash: StorageHashBase<THash>;
69
91
  readonly types?: Record<string, SqlStorageTypeEntry>;
70
- readonly namespaces: Readonly<Record<string, SqlNamespace>>;
92
+ readonly namespaces: Readonly<Record<string, SqlNamespaceBase>>;
71
93
  }
72
94
  /**
73
95
  * SQL Contract IR root node for the `storage` field.
@@ -101,22 +123,42 @@ type SqlNamespaceEntries = Readonly<Record<string, Readonly<Record<string, unkno
101
123
  readonly valueSet?: Readonly<Record<string, StorageValueSet>>;
102
124
  };
103
125
  /**
104
- * SQL family namespace. `entries` is the open ADR 224 dictionary —
105
- * `entries[entityKind][entityName]` addresses any entity. Emitted
106
- * contract literals satisfy this structurally (no prototype getters
107
- * needed). For typed access to specific kinds, use the class getters
108
- * on the concretion or `ns.entries.table` / `ns.entries.valueSet` directly.
126
+ * Structural interface for SQL family namespaces. Generated `.d.ts` contract
127
+ * types satisfy this structurally (no prototype methods). The runtime
128
+ * abstract class `SqlNamespaceBase` extends this.
129
+ *
130
+ * `qualifyTable` is optional so JSON-shaped contract types (which carry no
131
+ * methods) are accepted where `SqlNamespace` is required. Hydrated
132
+ * `SqlNamespaceBase` instances always have it.
109
133
  */
110
- type SqlNamespace = Namespace & {
134
+ interface SqlNamespace {
135
+ readonly kind: string;
136
+ readonly id: string;
111
137
  readonly entries: SqlNamespaceEntries;
112
- /**
113
- * Render a dialect-qualified table reference for runtime SQL emission.
114
- * Present on materialised target concretions (`PostgresSchema`,
115
- * `SqliteDatabase`, …) and family placeholders; omitted on emitted
116
- * contract structural namespace literals (methods are not serialised).
117
- */
118
138
  qualifyTable?(tableName: string): string;
119
- };
139
+ }
140
+ /**
141
+ * Abstract SQL family namespace base class. Target concretions (`PostgresSchema`,
142
+ * `SqliteDatabase`, …) extend this — it is never instantiated directly.
143
+ * `entries` is the open ADR 224 dictionary: `entries[entityKind][entityName]`
144
+ * addresses any entity.
145
+ */
146
+ declare abstract class SqlNamespaceBase extends NamespaceBase implements SqlNamespace {
147
+ abstract readonly id: string;
148
+ abstract readonly entries: SqlNamespaceEntries;
149
+ abstract qualifyTable(tableName: string): string;
150
+ }
151
+ /**
152
+ * Realm-safe guard for hydrated `SqlNamespaceBase` concretions. Checks
153
+ * `qualifyTable` structurally instead of `instanceof NamespaceBase`, so it
154
+ * survives duplicate-module boundaries (e.g. dist e2e where the target and
155
+ * the family carry separate copies of `@prisma-next/framework-components`).
156
+ *
157
+ * Every concrete `SqlNamespaceBase` subclass (`PostgresSchema`, `SqliteDatabase`,
158
+ * `TestSqlNamespace`, …) implements `qualifyTable`. Raw `SqlNamespaceInput`
159
+ * objects (`{ id, entries }`) do not.
160
+ */
161
+ declare function isMaterializedSqlNamespace(x: unknown): x is SqlNamespaceBase;
120
162
  declare class SqlStorage<THash extends string = string> extends SqlNode implements Storage {
121
163
  readonly storageHash: StorageHashBase<THash>;
122
164
  readonly namespaces: Readonly<Record<string, SqlNamespace>>;
@@ -124,5 +166,5 @@ declare class SqlStorage<THash extends string = string> extends SqlNode implemen
124
166
  constructor(input: SqlStorageInput<THash>);
125
167
  }
126
168
  //#endregion
127
- export { SqlStorageInput as a, StorageTypeInstance as c, toStorageTypeInstance as d, SqlStorage as i, StorageTypeInstanceInput as l, SqlNamespaceEntries as n, SqlStorageTypeEntry as o, SqlNamespaceTablesInput as r, CODEC_INSTANCE_KIND as s, SqlNamespace as t, isStorageTypeInstance as u };
128
- //# sourceMappingURL=sql-storage-Dga0jwP2.d.mts.map
169
+ export { SqlNamespaceFactory as a, SqlStorageInput as c, isSqlAuthoringContributions as d, CODEC_INSTANCE_KIND as f, toStorageTypeInstance as g, isStorageTypeInstance as h, SqlNamespaceEntries as i, SqlStorageTypeEntry as l, StorageTypeInstanceInput as m, SqlNamespace as n, SqlNamespaceInput as o, StorageTypeInstance as p, SqlNamespaceBase as r, SqlStorage as s, SqlAuthoringContributions as t, isMaterializedSqlNamespace as u };
170
+ //# sourceMappingURL=sql-storage-BRB55sCP.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-storage-BRB55sCP.d.mts","names":[],"sources":["../src/ir/storage-type-instance.ts","../src/ir/sql-storage.ts"],"mappings":";;;;;;;;;;;;;;;cASa,mBAAA;;;;AAA+C;AAU5D;;;;UAAiB,mBAAA,SAA4B,WAAA;EAAA,SAClC,IAAA,SAAa,mBAAA;EAAA,SACb,OAAA;EAAA,SACA,UAAA;EAAA,SACA,UAAA,EAAY,MAAA;AAAA;;;;;;;AAAM;UAUZ,wBAAA;EAAA,SACN,OAAA;EAAA,SACA,UAAA;EAAA,SACA,UAAA,GAAa,MAAM;AAAA;;;;;AAAA;iBAQd,qBAAA,CAAsB,KAAA,EAAO,wBAAA,GAA2B,mBAAmB;;;;;;iBAc3E,qBAAA,CAAsB,KAAA,YAAiB,KAAA,IAAS,mBAAmB;;;;AAjDnF;;;;AAA4D;AAU5D;KCOY,mBAAA,GAAsB,mBAAA,GAAsB,wBAAwB;AAAA,UAE/D,iBAAA;EAAA,SACN,EAAA;EAAA,SACA,OAAA,EAAS,QAAA,CAAS,MAAA,SAAe,QAAA,CAAS,MAAA;AAAA;;;;;KAOzC,mBAAA,IAAuB,KAAA,EAAO,iBAAA,KAAsB,SAAS;;;;;;ADd5C;AAU7B;UCaiB,yBAAA,SAAkC,sBAAsB;EAAA,SAC9D,eAAA,GAAkB,mBAAA;AAAA;;;;;iBAOb,2BAAA,CACd,SAAA,EAAW,sBAAA,eACV,SAAA,IAAa,yBAAyB;AAAA,UAOxB,eAAA;EAAA,SACN,WAAA,EAAa,eAAA,CAAgB,KAAA;EAAA,SAC7B,KAAA,GAAQ,MAAA,SAAe,mBAAA;EAAA,SACvB,UAAA,EAAY,QAAA,CAAS,MAAA,SAAe,gBAAA;AAAA;;;;;ADtB4C;AAc3F;;;;;;;;AAAmF;;;;AChCnF;;;;AAAgF;AAEhF;;;;;AAFgF,KAsEpE,mBAAA,GAAsB,QAAA,CAAS,MAAA,SAAe,QAAA,CAAS,MAAA;EAAA,SACxD,KAAA,GAAQ,QAAA,CAAS,MAAA,SAAe,YAAA;EAAA,SAChC,QAAA,GAAW,QAAA,CAAS,MAAA,SAAe,eAAA;AAAA;;;;;;;;AApEa;AAO3D;UAyEiB,YAAA;EAAA,SACN,IAAA;EAAA,SACA,EAAA;EAAA,SACA,OAAA,EAAS,mBAAmB;EACrC,YAAA,EAAc,SAAA;AAAA;;AA7EyD;AASzE;;;;uBA6EsB,gBAAA,SAAyB,aAAA,YAAyB,YAAA;EAAA,kBAC3C,EAAA;EAAA,kBACA,OAAA,EAAS,mBAAA;EAAA,SAE3B,YAAA,CAAa,SAAA;AAAA;AAzExB;;;;;;;;;AAEyC;AAFzC,iBAsFgB,0BAAA,CAA2B,CAAA,YAAa,CAAA,IAAK,gBAAgB;AAAA,cAKhE,UAAA,wCAAkD,OAAA,YAAmB,OAAA;EAAA,SACvE,WAAA,EAAa,eAAA,CAAgB,KAAA;EAAA,SAC7B,UAAA,EAAY,QAAA,CAAS,MAAA,SAAe,YAAA;EAAA,SAC5B,KAAA,GAAQ,QAAA,CAAS,MAAA,SAAe,mBAAA;cAErC,KAAA,EAAO,eAAA,CAAgB,KAAA;AAAA"}