@prisma/orm-family-sql 8.0.0-rc.12-dev.10 → 8.0.0-rc.12-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 (50) hide show
  1. package/dist/{authoring-type-constructors-C1ogrr_x-D8KVlpwM.mjs → authoring-type-constructors-C1ogrr_x-ChQC5e1v.mjs} +2 -2
  2. package/dist/{authoring-type-constructors-C1ogrr_x-D8KVlpwM.mjs.map → authoring-type-constructors-C1ogrr_x-ChQC5e1v.mjs.map} +1 -1
  3. package/dist/{config-types-BFnBqnfx.mjs → config-types-Dqe0LWuW.mjs} +2 -2
  4. package/dist/{config-types-BFnBqnfx.mjs.map → config-types-Dqe0LWuW.mjs.map} +1 -1
  5. package/dist/{contract-builder-tTGQ_MGg.d.mts → contract-builder-C2VKBKK5.d.mts} +4 -53
  6. package/dist/contract-builder-C2VKBKK5.d.mts.map +1 -0
  7. package/dist/{contract-builder-Vu-9o_FQ.mjs → contract-builder-CojarVwS.mjs} +9 -60
  8. package/dist/contract-builder-CojarVwS.mjs.map +1 -0
  9. package/dist/contract-prisma7__provider.mjs +3 -3
  10. package/dist/contract-psl.d.mts +1 -1
  11. package/dist/contract-psl.mjs +1 -1
  12. package/dist/contract-psl__provider.mjs +2 -2
  13. package/dist/contract-psl__provider.mjs.map +1 -1
  14. package/dist/contract-ts.d.mts +1 -1
  15. package/dist/contract-ts.mjs +3 -3
  16. package/dist/contract-ts__config-types.mjs +1 -1
  17. package/dist/contract-ts__contract-builder.d.mts +1 -1
  18. package/dist/contract-ts__contract-builder.mjs +2 -2
  19. package/dist/contract.mjs +1 -1
  20. package/dist/contract__validators.mjs +1 -1
  21. package/dist/{control-DcpmxWtu.d.mts → control-BLOiyNq-.d.mts} +14 -134
  22. package/dist/{control-DcpmxWtu.d.mts.map → control-BLOiyNq-.d.mts.map} +1 -1
  23. package/dist/{control-DTKBQtcA.mjs → control-BynSKZfp.mjs} +53 -5
  24. package/dist/control-BynSKZfp.mjs.map +1 -0
  25. package/dist/{derived-checks-BiClpWj6-chqISMq1.mjs → derived-checks-BiClpWj6-Czjj2esH.mjs} +2 -2
  26. package/dist/{derived-checks-BiClpWj6-chqISMq1.mjs.map → derived-checks-BiClpWj6-Czjj2esH.mjs.map} +1 -1
  27. package/dist/family.d.mts +2 -2
  28. package/dist/family.mjs +5 -6
  29. package/dist/family__control.d.mts +2 -2
  30. package/dist/family__control.mjs +3 -4
  31. package/dist/family__ir.mjs +1 -1
  32. package/dist/family__pack.mjs +1 -1
  33. package/dist/family__runtime.mjs +1 -1
  34. package/dist/{interpreter-CYD009gd-KeytabKd.mjs → interpreter-Cy7S6Jh9-BIa0lyc-.mjs} +6 -407
  35. package/dist/interpreter-Cy7S6Jh9-BIa0lyc-.mjs.map +1 -0
  36. package/dist/{runtime-DfvE_FqD.mjs → runtime-DzmRvRj_.mjs} +2 -2
  37. package/dist/runtime-DzmRvRj_.mjs.map +1 -0
  38. package/dist/{sql-contract-serializer-0a4k494z-ClMyRBHo.mjs → sql-contract-serializer-0a4k494z-tI6ajwvm.mjs} +2 -2
  39. package/dist/{sql-contract-serializer-0a4k494z-ClMyRBHo.mjs.map → sql-contract-serializer-0a4k494z-tI6ajwvm.mjs.map} +1 -1
  40. package/dist/{validators-CSjiy5BN.mjs → validators-DecqO0rE.mjs} +3 -30
  41. package/dist/validators-DecqO0rE.mjs.map +1 -0
  42. package/package.json +18 -18
  43. package/dist/contract-builder-Vu-9o_FQ.mjs.map +0 -1
  44. package/dist/contract-builder-tTGQ_MGg.d.mts.map +0 -1
  45. package/dist/control-DTKBQtcA.mjs.map +0 -1
  46. package/dist/interpreter-CYD009gd-KeytabKd.mjs.map +0 -1
  47. package/dist/runtime-DfvE_FqD.mjs.map +0 -1
  48. package/dist/timestamp-now-generator-CVrEeaJp-Bt_PHBSf.mjs +0 -181
  49. package/dist/timestamp-now-generator-CVrEeaJp-Bt_PHBSf.mjs.map +0 -1
  50. package/dist/validators-CSjiy5BN.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-DfvE_FqD.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/runtime.mjs"],"sourcesContent":["import { t as TIMESTAMP_NOW_GENERATOR_ID } from \"./timestamp-now-generator-CVrEeaJp.mjs\";\nimport { UNBOUND_DOMAIN_NAMESPACE_ID, resolveDomainModel } from \"@internal/contract/types\";\nimport { resolveStorageTable } from \"@internal/sql-contract/resolve-storage-table\";\n//#region src/core/runtime-instance.ts\n/**\n* Creates a SQL execution-plane family instance.\n*\n* This will be renamed to `createSqlExecutionFamilyInstance()` as part of `TML-1842`.\n*/\nfunction createSqlRuntimeFamilyInstance() {\n\treturn { familyId: \"sql\" };\n}\n//#endregion\n//#region src/core/runtime-descriptor.ts\n/**\n* SQL execution-plane family descriptor.\n*\n* Note: this is currently named `sqlRuntimeFamilyDescriptor` because the execution plane\n* framework types are still using the `Runtime*` naming (`RuntimeFamilyDescriptor`, etc.).\n*\n* This will be renamed to `sqlExecutionFamilyDescriptor` as part of `TML-1842`.\n*/\nconst sqlRuntimeFamilyDescriptor = {\n\tkind: \"family\",\n\tid: \"sql\",\n\tfamilyId: \"sql\",\n\tversion: \"0.0.1\",\n\tcreate() {\n\t\treturn createSqlRuntimeFamilyInstance();\n\t}\n};\nObject.freeze(sqlRuntimeFamilyDescriptor);\n//#endregion\n//#region src/core/timestamp-now-runtime-generator.ts\n/**\n* Builds the canonical runtime-plane generator for the wall-clock-now\n* mutation default. Returns `new Date()`; semantics are target-agnostic\n* so all SQL targets share this single implementation.\n*\n* Declares `stability: 'query'` so a single ORM bulk operation\n* (e.g. `createAll([...])`) shares one timestamp across every row and\n* every timestamp-defaulted column. Matches Prisma 6's `@updatedAt`\n* semantics: one `new Date()` per lowered mutation, not per row.\n*\n* Lives in a runtime-plane-only module so the control-plane\n* `timestamp-now-generator.ts` (descriptor + authoring presets) stays\n* free of `@internal/sql-runtime` imports.\n*/\nfunction timestampNowRuntimeGenerator() {\n\treturn {\n\t\tid: TIMESTAMP_NOW_GENERATOR_ID,\n\t\tgenerate: () => /* @__PURE__ */ new Date(),\n\t\tstability: \"query\"\n\t};\n}\n//#endregion\n//#region src/exports/runtime.ts\nvar runtime_default = sqlRuntimeFamilyDescriptor;\n//#endregion\nexport { UNBOUND_DOMAIN_NAMESPACE_ID, runtime_default as default, resolveDomainModel, resolveStorageTable, timestampNowRuntimeGenerator };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;AASA,SAAS,iCAAiC;CACzC,OAAO,EAAE,UAAU,MAAM;AAC1B;;;;;;;;;AAWA,MAAM,6BAA6B;CAClC,MAAM;CACN,IAAI;CACJ,UAAU;CACV,SAAS;CACT,SAAS;EACR,OAAO,+BAA+B;CACvC;AACD;AACA,OAAO,OAAO,0BAA0B;;;;;;;;;;;;;;;AAiBxC,SAAS,+BAA+B;CACvC,OAAO;EACN,IAAI;EACJ,gCAAgC,IAAI,KAAK;EACzC,WAAW;CACZ;AACD;AAGA,IAAI,kBAAkB"}
@@ -1,181 +0,0 @@
1
- //#region ../../../2-sql/9-family/dist/timestamp-now-generator-CVrEeaJp.mjs
2
- /**
3
- * Canonical id for the wall-clock-now mutation default generator.
4
- *
5
- * Owned by `family-sql` because that's where the generator lives. The
6
- * id flows out from here to (1) the control-plane descriptor and the
7
- * temporal field-preset pair below, (2) the runtime-plane sibling
8
- * `timestamp-now-runtime-generator.ts`, and (3) authoring surfaces
9
- * (PSL `temporal.updatedAt()`, TS `field.temporal.updatedAt()`) via
10
- * the descriptor flow. Co-locating the constant with its only owner
11
- * keeps the framework layer free of concrete generator ids.
12
- */
13
- const TIMESTAMP_NOW_GENERATOR_ID = "timestampNow";
14
- /**
15
- * Builds the canonical control-plane descriptor for the wall-clock-now
16
- * mutation default generator. The descriptor's `id` and `buildPhases`
17
- * are target-agnostic so PSL `temporal.updatedAt()` and TS
18
- * `field.temporal.updatedAt()` lower to byte-identical contracts.
19
- *
20
- * `applicableCodecIds` is omitted: `timestampNow` is preset-only (not
21
- * reachable via `@default(timestampNow())` lowering), and the codec is
22
- * co-registered by the preset descriptor itself, so the
23
- * `@default(...)` compatibility check has no role to play here.
24
- */
25
- function timestampNowControlDescriptor() {
26
- return {
27
- id: TIMESTAMP_NOW_GENERATOR_ID,
28
- buildPhases: () => ({
29
- onCreate: {
30
- kind: "generator",
31
- id: TIMESTAMP_NOW_GENERATOR_ID
32
- },
33
- onUpdate: {
34
- kind: "generator",
35
- id: TIMESTAMP_NOW_GENERATOR_ID
36
- }
37
- })
38
- };
39
- }
40
- /**
41
- * Builds the canonical `temporal.{createdAt,updatedAt}` field-preset pair
42
- * for a SQL target. `createdAt` lowers to an execution generator on `onCreate`;
43
- * `updatedAt` lowers to the same generator on both `onCreate` and
44
- * `onUpdate` (RD: "last modified time", non-null). Targets supply the
45
- * codec/native-type pair that matches their timestamp column; everything
46
- * else is shared so PSL `temporal.updatedAt()` and TS
47
- * `field.temporal.updatedAt()` lower to byte-identical contracts across
48
- * targets by construction.
49
- */
50
- /* @__NO_SIDE_EFFECTS__ */
51
- function temporalAuthoringPresets(input) {
52
- const { codecId, nativeType } = input;
53
- const generatorId = input.generatorId ?? "timestampNow";
54
- return {
55
- createdAt: {
56
- kind: "fieldPreset",
57
- output: {
58
- codecId,
59
- nativeType,
60
- executionDefaults: { onCreate: {
61
- kind: "generator",
62
- id: generatorId
63
- } }
64
- }
65
- },
66
- updatedAt: {
67
- kind: "fieldPreset",
68
- output: {
69
- codecId,
70
- nativeType,
71
- executionDefaults: {
72
- onCreate: {
73
- kind: "generator",
74
- id: generatorId
75
- },
76
- onUpdate: {
77
- kind: "generator",
78
- id: generatorId
79
- }
80
- }
81
- }
82
- }
83
- };
84
- }
85
- function temporalStringAuthoringPresets(input) {
86
- const presets = /* @__PURE__ */ temporalAuthoringPresets(input);
87
- return {
88
- createdAtString: presets.createdAt,
89
- updatedAtString: presets.updatedAt
90
- };
91
- }
92
- const TEMPORAL_PRECISION_ARG = {
93
- name: "precision",
94
- kind: "number",
95
- optional: true,
96
- integer: true,
97
- minimum: 0
98
- };
99
- const TEMPORAL_ON_CREATE_ARG = {
100
- name: "onCreate",
101
- kind: "option",
102
- values: ["now"],
103
- optional: true
104
- };
105
- const TEMPORAL_ON_UPDATE_ARG = {
106
- name: "onUpdate",
107
- kind: "option",
108
- values: ["now"],
109
- optional: true
110
- };
111
- /**
112
- * Selects a generator descriptor for the preset's `now` token. The token is preset vocabulary; the
113
- * generator id never appears in a user's spelling (ADR 169 — these generators are preset-only).
114
- */
115
- function temporalPhaseTemplate(index, generatorId) {
116
- return {
117
- kind: "select",
118
- index,
119
- cases: { now: {
120
- kind: "generator",
121
- id: generatorId
122
- } }
123
- };
124
- }
125
- /**
126
- * Builds a `temporal.<codec>` field preset for a codec that takes a precision
127
- * parameter (`pg/timestamp-temporal@1`, `pg/timestamptz-temporal@1`). Arguments change field
128
- * properties only — never the codec, which the caller fixes here.
129
- *
130
- * All three arguments are optional: omitting `precision` omits `typeParams`
131
- * entirely, and omitting a phase omits that phase (both omitted omits
132
- * `executionDefaults`).
133
- */
134
- /* @__NO_SIDE_EFFECTS__ */
135
- function temporalCodecPresetWithPrecision(input) {
136
- const generatorId = input.generatorId ?? "timestampNow";
137
- return {
138
- kind: "fieldPreset",
139
- args: [
140
- TEMPORAL_PRECISION_ARG,
141
- TEMPORAL_ON_CREATE_ARG,
142
- TEMPORAL_ON_UPDATE_ARG
143
- ],
144
- output: {
145
- codecId: input.codecId,
146
- nativeType: input.nativeType,
147
- typeParams: { precision: {
148
- kind: "arg",
149
- index: 0
150
- } },
151
- executionDefaults: {
152
- onCreate: temporalPhaseTemplate(1, generatorId),
153
- onUpdate: temporalPhaseTemplate(2, generatorId)
154
- }
155
- }
156
- };
157
- }
158
- /**
159
- * Builds a `temporal.<codec>` field preset for a codec with no type
160
- * parameters (`sqlite/datetime@1`). As with the precision-bearing variant,
161
- * both phase arguments are optional and omitting one omits that phase.
162
- */
163
- /* @__NO_SIDE_EFFECTS__ */
164
- function temporalCodecPreset(input) {
165
- return {
166
- kind: "fieldPreset",
167
- args: [TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG],
168
- output: {
169
- codecId: input.codecId,
170
- nativeType: input.nativeType,
171
- executionDefaults: {
172
- onCreate: temporalPhaseTemplate(0, TIMESTAMP_NOW_GENERATOR_ID),
173
- onUpdate: temporalPhaseTemplate(1, TIMESTAMP_NOW_GENERATOR_ID)
174
- }
175
- }
176
- };
177
- }
178
- //#endregion
179
- export { temporalStringAuthoringPresets as a, temporalCodecPresetWithPrecision as i, temporalAuthoringPresets as n, timestampNowControlDescriptor as o, temporalCodecPreset as r, TIMESTAMP_NOW_GENERATOR_ID as t };
180
-
181
- //# sourceMappingURL=timestamp-now-generator-CVrEeaJp-Bt_PHBSf.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timestamp-now-generator-CVrEeaJp-Bt_PHBSf.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/timestamp-now-generator-CVrEeaJp.mjs"],"sourcesContent":["//#region src/core/timestamp-now-generator.ts\n/**\n* Canonical id for the wall-clock-now mutation default generator.\n*\n* Owned by `family-sql` because that's where the generator lives. The\n* id flows out from here to (1) the control-plane descriptor and the\n* temporal field-preset pair below, (2) the runtime-plane sibling\n* `timestamp-now-runtime-generator.ts`, and (3) authoring surfaces\n* (PSL `temporal.updatedAt()`, TS `field.temporal.updatedAt()`) via\n* the descriptor flow. Co-locating the constant with its only owner\n* keeps the framework layer free of concrete generator ids.\n*/\nconst TIMESTAMP_NOW_GENERATOR_ID = \"timestampNow\";\n/**\n* Builds the canonical control-plane descriptor for the wall-clock-now\n* mutation default generator. The descriptor's `id` and `buildPhases`\n* are target-agnostic so PSL `temporal.updatedAt()` and TS\n* `field.temporal.updatedAt()` lower to byte-identical contracts.\n*\n* `applicableCodecIds` is omitted: `timestampNow` is preset-only (not\n* reachable via `@default(timestampNow())` lowering), and the codec is\n* co-registered by the preset descriptor itself, so the\n* `@default(...)` compatibility check has no role to play here.\n*/\nfunction timestampNowControlDescriptor() {\n\treturn {\n\t\tid: TIMESTAMP_NOW_GENERATOR_ID,\n\t\tbuildPhases: () => ({\n\t\t\tonCreate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: TIMESTAMP_NOW_GENERATOR_ID\n\t\t\t},\n\t\t\tonUpdate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: TIMESTAMP_NOW_GENERATOR_ID\n\t\t\t}\n\t\t})\n\t};\n}\n/**\n* Builds the canonical `temporal.{createdAt,updatedAt}` field-preset pair\n* for a SQL target. `createdAt` lowers to an execution generator on `onCreate`;\n* `updatedAt` lowers to the same generator on both `onCreate` and\n* `onUpdate` (RD: \"last modified time\", non-null). Targets supply the\n* codec/native-type pair that matches their timestamp column; everything\n* else is shared so PSL `temporal.updatedAt()` and TS\n* `field.temporal.updatedAt()` lower to byte-identical contracts across\n* targets by construction.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction temporalAuthoringPresets(input) {\n\tconst { codecId, nativeType } = input;\n\tconst generatorId = input.generatorId ?? \"timestampNow\";\n\treturn {\n\t\tcreatedAt: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId,\n\t\t\t\tnativeType,\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: generatorId\n\t\t\t\t} }\n\t\t\t}\n\t\t},\n\t\tupdatedAt: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId,\n\t\t\t\tnativeType,\n\t\t\t\texecutionDefaults: {\n\t\t\t\t\tonCreate: {\n\t\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\t\tid: generatorId\n\t\t\t\t\t},\n\t\t\t\t\tonUpdate: {\n\t\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\t\tid: generatorId\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\nfunction temporalStringAuthoringPresets(input) {\n\tconst presets = /* @__PURE__ */ temporalAuthoringPresets(input);\n\treturn {\n\t\tcreatedAtString: presets.createdAt,\n\t\tupdatedAtString: presets.updatedAt\n\t};\n}\nconst TEMPORAL_PRECISION_ARG = {\n\tname: \"precision\",\n\tkind: \"number\",\n\toptional: true,\n\tinteger: true,\n\tminimum: 0\n};\nconst TEMPORAL_ON_CREATE_ARG = {\n\tname: \"onCreate\",\n\tkind: \"option\",\n\tvalues: [\"now\"],\n\toptional: true\n};\nconst TEMPORAL_ON_UPDATE_ARG = {\n\tname: \"onUpdate\",\n\tkind: \"option\",\n\tvalues: [\"now\"],\n\toptional: true\n};\n/**\n* Selects a generator descriptor for the preset's `now` token. The token is preset vocabulary; the\n* generator id never appears in a user's spelling (ADR 169 — these generators are preset-only).\n*/\nfunction temporalPhaseTemplate(index, generatorId) {\n\treturn {\n\t\tkind: \"select\",\n\t\tindex,\n\t\tcases: { now: {\n\t\t\tkind: \"generator\",\n\t\t\tid: generatorId\n\t\t} }\n\t};\n}\n/**\n* Builds a `temporal.<codec>` field preset for a codec that takes a precision\n* parameter (`pg/timestamp-temporal@1`, `pg/timestamptz-temporal@1`). Arguments change field\n* properties only — never the codec, which the caller fixes here.\n*\n* All three arguments are optional: omitting `precision` omits `typeParams`\n* entirely, and omitting a phase omits that phase (both omitted omits\n* `executionDefaults`).\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction temporalCodecPresetWithPrecision(input) {\n\tconst generatorId = input.generatorId ?? \"timestampNow\";\n\treturn {\n\t\tkind: \"fieldPreset\",\n\t\targs: [\n\t\t\tTEMPORAL_PRECISION_ARG,\n\t\t\tTEMPORAL_ON_CREATE_ARG,\n\t\t\tTEMPORAL_ON_UPDATE_ARG\n\t\t],\n\t\toutput: {\n\t\t\tcodecId: input.codecId,\n\t\t\tnativeType: input.nativeType,\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} },\n\t\t\texecutionDefaults: {\n\t\t\t\tonCreate: temporalPhaseTemplate(1, generatorId),\n\t\t\t\tonUpdate: temporalPhaseTemplate(2, generatorId)\n\t\t\t}\n\t\t}\n\t};\n}\n/**\n* Builds a `temporal.<codec>` field preset for a codec with no type\n* parameters (`sqlite/datetime@1`). As with the precision-bearing variant,\n* both phase arguments are optional and omitting one omits that phase.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction temporalCodecPreset(input) {\n\treturn {\n\t\tkind: \"fieldPreset\",\n\t\targs: [TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG],\n\t\toutput: {\n\t\t\tcodecId: input.codecId,\n\t\t\tnativeType: input.nativeType,\n\t\t\texecutionDefaults: {\n\t\t\t\tonCreate: temporalPhaseTemplate(0, TIMESTAMP_NOW_GENERATOR_ID),\n\t\t\t\tonUpdate: temporalPhaseTemplate(1, TIMESTAMP_NOW_GENERATOR_ID)\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\nexport { temporalStringAuthoringPresets as a, temporalCodecPresetWithPrecision as i, temporalAuthoringPresets as n, timestampNowControlDescriptor as o, temporalCodecPreset as r, TIMESTAMP_NOW_GENERATOR_ID as t };\n\n//# sourceMappingURL=timestamp-now-generator-CVrEeaJp.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,6BAA6B;;;;;;;;;;;;AAYnC,SAAS,gCAAgC;CACxC,OAAO;EACN,IAAI;EACJ,oBAAoB;GACnB,UAAU;IACT,MAAM;IACN,IAAI;GACL;GACA,UAAU;IACT,MAAM;IACN,IAAI;GACL;EACD;CACD;AACD;;;;;;;;;;;;AAYA,SAAS,yBAAyB,OAAO;CACxC,MAAM,EAAE,SAAS,eAAe;CAChC,MAAM,cAAc,MAAM,eAAe;CACzC,OAAO;EACN,WAAW;GACV,MAAM;GACN,QAAQ;IACP;IACA;IACA,mBAAmB,EAAE,UAAU;KAC9B,MAAM;KACN,IAAI;IACL,EAAE;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ACD;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"validators-CSjiy5BN.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/validators.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { a as ColumnDefaultFunctionSchema, c as ForeignKeyReferenceSchema, d as IndexSchema, f as ReferentialActionSchema, i as CheckConstraintSchema, l as ForeignKeySchema, m as StorageValueSetSchema, o as ColumnDefaultLiteralSchema, p as StorageTableSchema, s as ColumnDefaultSchema, t as composeSqlEntityKinds, u as ForeignKeySourceSchema } from \"./entity-kinds-D7vwoN_T.mjs\";\nimport { computeCheckContentHash, computeIndexContentHash } from \"@internal/sql-schema-ir/naming\";\nimport { isPlainRecord } from \"@internal/framework-components/ir\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { type } from \"arktype\";\nimport { CrossReferenceSchema } from \"@internal/contract/types\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { validateContractDomain } from \"@internal/contract/validate-domain\";\n//#region src/default-sql-body.ts\nconst UNSAFE_DEFAULT_BODY = /;|--|\\/\\*|\\$\\$|\\bSELECT\\b/i;\n/** Returns undefined when the body may be rendered as `DEFAULT (<body>)`, else the reason. */\nfunction checkSqlDefaultBody(body) {\n\treturn UNSAFE_DEFAULT_BODY.test(body) ? \"Default SQL must not contain semicolons, SQL comment tokens, dollar-quoting, or subqueries.\" : void 0;\n}\n/**\n* Names the Prisma default function a raw SQL body spells exactly, ignoring surrounding whitespace. The planners treat the contract expressions `now()` and `autoincrement()` as those functions, so a raw body with that text would not be used as written.\n*/\nfunction reservedSqlDefaultBody(body) {\n\tswitch (body.trim()) {\n\t\tcase \"now()\": return \"now\";\n\t\tcase \"autoincrement()\": return \"autoincrement\";\n\t\tdefault: return;\n\t}\n}\n//#endregion\n//#region src/relation-storage.ts\nfunction sameColumns(left, right) {\n\treturn left.length === right.length && left.every((column, index) => column === right[index]);\n}\n/**\n* The storage facts behind a same-space to-one relation's nullability: which side owns the\n* foreign key, and whether each local column is nullable.\n*/\nfunction resolveSqlToOneRelationStorage(contract, modelStorage, relation) {\n\tconst table = blindCast(contract.storage.namespaces[modelStorage.namespaceId]?.entries.table?.[modelStorage.table]);\n\tconst columns = relation.on.localFields.map((fieldName) => {\n\t\tconst columnName = modelStorage.fields[fieldName]?.column;\n\t\tconst column = columnName === void 0 ? void 0 : table?.columns[columnName];\n\t\treturn {\n\t\t\tname: columnName ?? fieldName,\n\t\t\tnullable: column?.nullable ?? true\n\t\t};\n\t});\n\tconst columnNames = columns.map((column) => column.name);\n\treturn {\n\t\townsForeignKey: relation.cardinality === \"N:1\" || (table?.foreignKeys ?? []).some((foreignKey) => sameColumns(foreignKey.source.columns, columnNames)),\n\t\tcolumns\n\t};\n}\n//#endregion\n//#region src/validators.ts\nconst generatorKindSchema = type(\"'generator'\");\nconst ControlPolicySchema = type(\"'managed' | 'tolerated' | 'external' | 'observed'\");\nconst ExecutionMutationDefaultValueSchema = type({\n\t\"+\": \"reject\",\n\tkind: generatorKindSchema,\n\tid: type(\"string\").narrow((value, ctx) => {\n\t\treturn /^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(value) ? true : ctx.mustBe(\"a flat generator id\");\n\t}),\n\t\"params?\": \"Record<string, unknown>\"\n});\nconst ExecutionSchema = type({\n\t\"+\": \"reject\",\n\texecutionHash: \"string\",\n\tmutations: {\n\t\t\"+\": \"reject\",\n\t\tdefaults: type({\n\t\t\t\"+\": \"reject\",\n\t\t\tref: {\n\t\t\t\t\"+\": \"reject\",\n\t\t\t\tnamespace: \"string\",\n\t\t\t\tentry: \"string\",\n\t\t\t\tfield: \"string\"\n\t\t\t},\n\t\t\t\"onCreate?\": ExecutionMutationDefaultValueSchema,\n\t\t\t\"onUpdate?\": ExecutionMutationDefaultValueSchema\n\t\t}).array().readonly()\n\t}\n});\nconst DomainEnumRefSchema = type({\n\tplane: \"'domain'\",\n\tnamespaceId: \"string\",\n\tentityKind: \"'enum'\",\n\tentityName: \"string\",\n\t\"spaceId?\": \"string\"\n});\n/** Document-scoped `storage.types`: codec triples only. */\nconst DocumentScopedStorageTypeSchema = type.declare().type({\n\tkind: \"'codec-instance'\",\n\tcodecId: \"string\",\n\tnativeType: \"string\",\n\t\"typeParams?\": \"Record<string, unknown>\"\n});\n/**\n* Domain enum entry under `domain.namespaces[id].enum[name]`.\n* Carries the codec id and an ordered `members` array of `{name, value}` pairs.\n*/\nconst ContractEnumSchema = type({\n\t\"+\": \"reject\",\n\tcodecId: \"string\",\n\tmembers: type({\n\t\tname: \"string\",\n\t\tvalue: \"string | number | boolean | null | unknown[] | Record<string, unknown>\"\n\t}).array().readonly()\n});\n/**\n* Derives a schema map from a descriptor map: maps each kind's key to its\n* `schema` field. Used by validation functions to validate entries.\n*/\nfunction schemaViewOf(kinds) {\n\treturn new Map([...kinds].map(([k, d]) => [k, d.schema]));\n}\nconst DEFAULT_SQL_KINDS = composeSqlEntityKinds();\n/**\n* Builds the per-namespace entry schema for `storage.namespaces[id]`.\n*\n* Validation is descriptor-driven: the `kinds` map carries both the schema\n* (used here for structural validation) and the construct function (used at\n* hydration time). An unregistered key fails validation naming the kind and\n* the namespace id, so validation fails closed.\n*/\nfunction createNamespaceEntrySchema(kinds) {\n\tconst schemas = schemaViewOf(kinds);\n\tconst knownKinds = new Set(kinds.keys());\n\treturn type({\n\t\t\"+\": \"reject\",\n\t\tid: \"string\",\n\t\t\"kind?\": \"string\",\n\t\tentries: \"object\"\n\t}).narrow((ns, ctx) => {\n\t\tif (!isPlainRecord(ns.entries)) return ctx.mustBe(\"an entries object\");\n\t\tfor (const [key, innerMap] of Object.entries(ns.entries)) {\n\t\t\tif (!knownKinds.has(key)) return ctx.reject({ expected: `entries key \"${key}\" in namespace \"${ns.id}\" is not a registered entity kind` });\n\t\t\tif (!isPlainRecord(innerMap)) return ctx.reject({ expected: `entries[\"${key}\"] in namespace \"${ns.id}\" must be an object` });\n\t\t\tconst entrySchema = blindCast(schemas.get(key));\n\t\t\tfor (const [, value] of Object.entries(innerMap)) {\n\t\t\t\tconst parsed = entrySchema(value);\n\t\t\t\tif (parsed instanceof type.errors) return ctx.reject({ expected: parsed.summary });\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t});\n}\n/**\n* Builds the storage schema. Pack contributions reach the per-namespace\n* entry shape through {@link createNamespaceEntrySchema}; the\n* document-scoped `storage.types` field (codec triples only) and the\n* storage hash stay family-shared.\n*/\nfunction createSqlStorageSchema(kinds) {\n\tconst namespaceEntry = createNamespaceEntrySchema(kinds);\n\treturn type({\n\t\t\"+\": \"reject\",\n\t\tstorageHash: \"string\",\n\t\t\"types?\": type({ \"[string]\": DocumentScopedStorageTypeSchema }),\n\t\t\"namespaces?\": type({ \"[string]\": namespaceEntry })\n\t});\n}\nconst StorageSchema = createSqlStorageSchema(DEFAULT_SQL_KINDS);\n/**\n* Any entries entity that declares both a `tableName` and a physical `name`\n* (e.g. a target's RLS policy entities) shares one physical-name space per\n* table: two such entries of one kind on the same table would collide as\n* DDL (`CREATE POLICY \"<name>\" ON <table>` fails on the second), while the\n* same name on different tables is legal. Structural — no entry-kind\n* vocabulary; `table` entries are keyed by name already and are excluded.\n*/\nfunction validateTableScopedEntryNames(storage, errors) {\n\tfor (const [namespaceId, ns] of Object.entries(storage.namespaces)) {\n\t\tif (!isPlainRecord(ns.entries)) continue;\n\t\tfor (const [entriesKind, slot] of Object.entries(ns.entries)) {\n\t\t\tif (entriesKind === \"table\" || !isPlainRecord(slot)) continue;\n\t\t\tconst seen = /* @__PURE__ */ new Map();\n\t\t\tfor (const entity of Object.values(slot)) {\n\t\t\t\tif (typeof entity !== \"object\" || entity === null) continue;\n\t\t\t\tconst record = blindCast(entity);\n\t\t\t\tconst name = record[\"name\"];\n\t\t\t\tconst tableName = record[\"tableName\"];\n\t\t\t\tif (typeof name !== \"string\" || typeof tableName !== \"string\") continue;\n\t\t\t\tconst key = JSON.stringify([tableName, name]);\n\t\t\t\tseen.set(key, (seen.get(key) ?? 0) + 1);\n\t\t\t\tif (seen.get(key) === 2) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": ${entriesKind} \"${name}\" is declared multiple times`);\n\t\t\t}\n\t\t}\n\t}\n}\nfunction eachStorageTable(storage) {\n\treturn Object.entries(storage.namespaces).flatMap(([namespaceId, ns]) => Object.entries(ns.entries[\"table\"] ?? {}).map(([tableName, table]) => ({\n\t\tnamespaceId,\n\t\ttableName,\n\t\ttable\n\t})));\n}\nfunction findDuplicateValue(values) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const value of values) {\n\t\tif (seen.has(value)) return value;\n\t\tseen.add(value);\n\t}\n}\n/** A column may appear at most once in one index's element tuple. */\nfunction rejectRepeatedIndexColumns(indexes, coordinate, errors) {\n\tfor (const index of indexes) {\n\t\tconst duplicateColumn = findDuplicateValue(index.columns ?? []);\n\t\tif (duplicateColumn !== void 0) errors.push(`${coordinate}: index contains duplicate column \"${duplicateColumn}\"`);\n\t}\n}\n/**\n* Two wire-named indexes with the same content are one index written twice —\n* the content hash is their identity, so neither spelling can survive. An\n* exact-named index is identified by its name instead, so content twins under\n* two names are legal and a repeated name is rejected by the named-object\n* check.\n*/\nfunction rejectDuplicateWireNamedIndexContent(indexes, coordinate, errors) {\n\tconst seenContent = /* @__PURE__ */ new Set();\n\tfor (const index of indexes) {\n\t\tif (index.prefix === void 0) continue;\n\t\tconst content = computeIndexContentHash(index);\n\t\tif (seenContent.has(content)) {\n\t\t\terrors.push(`${coordinate}: duplicate index definition on columns [${(index.columns ?? []).join(\", \")}]`);\n\t\t\tcontinue;\n\t\t}\n\t\tseenContent.add(content);\n\t}\n}\n/**\n* Two wire-named checks with the same predicate are one check written twice —\n* the content hash is their identity, so neither spelling can survive, and\n* whitespace variants of one predicate collapse onto the same hash. An\n* exact-named check is identified by its name instead, so content twins under\n* two names are legal (the legacy shape a database adopts from) and a repeated\n* name is rejected by the named-object check.\n*/\nfunction rejectDuplicateWireNamedCheckContent(checks, coordinate, errors) {\n\tconst seenContent = /* @__PURE__ */ new Set();\n\tfor (const check of checks) {\n\t\tif (check.prefix === void 0) continue;\n\t\tconst content = computeCheckContentHash(check.expression);\n\t\tif (seenContent.has(content)) {\n\t\t\terrors.push(`${coordinate}: duplicate check constraint definition (expression \"${check.expression}\")`);\n\t\t\tcontinue;\n\t\t}\n\t\tseenContent.add(content);\n\t}\n}\nfunction isContractFieldType(value) {\n\tif (!isPlainRecord(value)) return false;\n\tconst kind = value[\"kind\"];\n\tif (kind === \"scalar\") {\n\t\tif (typeof value[\"codecId\"] !== \"string\") return false;\n\t\tconst typeParams = value[\"typeParams\"];\n\t\tif (typeParams !== void 0 && !isPlainRecord(typeParams)) return false;\n\t\treturn true;\n\t}\n\tif (kind === \"valueObject\") return typeof value[\"name\"] === \"string\";\n\tif (kind === \"union\") {\n\t\tconst members = value[\"members\"];\n\t\tif (!Array.isArray(members)) return false;\n\t\treturn members.every((m) => isContractFieldType(m));\n\t}\n\treturn false;\n}\nconst ModelFieldSchema = type({\n\t\"+\": \"reject\",\n\tnullable: \"boolean\",\n\ttype: type(\"unknown\").narrow((value, ctx) => isContractFieldType(value) ? true : ctx.mustBe(\"scalar, valueObject, or union field type\")),\n\t\"many?\": \"true\",\n\t\"dict?\": \"true\",\n\t\"valueSet?\": DomainEnumRefSchema\n});\nconst ModelStorageSchema = type({\n\ttable: \"string\",\n\tnamespaceId: \"string\",\n\tfields: type({ \"[string]\": type({\n\t\tcolumn: \"string\",\n\t\t\"codecId?\": \"string\",\n\t\t\"nullable?\": \"boolean\"\n\t}) })\n});\nconst ContractRelationThroughSchema = type({\n\t\"+\": \"reject\",\n\ttable: \"string\",\n\tnamespaceId: \"string\",\n\tparentColumns: type.string.array().readonly(),\n\tchildColumns: type.string.array().readonly(),\n\ttargetColumns: type.string.array().readonly()\n});\nconst ContractRelationOnSchema = type({\n\t\"+\": \"reject\",\n\tlocalFields: type.string.array().readonly(),\n\ttargetFields: type.string.array().readonly()\n});\nconst ContractManyToManyRelationSchema = type({\n\t\"+\": \"reject\",\n\tto: CrossReferenceSchema,\n\tcardinality: \"'N:M'\",\n\ton: ContractRelationOnSchema,\n\tthrough: ContractRelationThroughSchema\n});\nconst ContractToOneRelationSchema = type({\n\t\"+\": \"reject\",\n\tto: CrossReferenceSchema,\n\tcardinality: \"'1:1' | 'N:1'\",\n\t\"nullable?\": \"boolean\",\n\ton: ContractRelationOnSchema\n});\nconst ContractToManyRelationSchema = type({\n\t\"+\": \"reject\",\n\tto: CrossReferenceSchema,\n\tcardinality: \"'1:N'\",\n\ton: ContractRelationOnSchema\n});\nconst ContractReferenceRelationSchema = ContractManyToManyRelationSchema.or(ContractToOneRelationSchema).or(ContractToManyRelationSchema);\nconst ContractEmbedRelationSchema = type({\n\t\"+\": \"reject\",\n\tto: CrossReferenceSchema,\n\tcardinality: \"'1:1' | '1:N'\"\n});\nconst ContractRelationSchema = ContractReferenceRelationSchema.or(ContractEmbedRelationSchema);\nconst ModelSchema = type({\n\tstorage: ModelStorageSchema,\n\t\"fields?\": type({ \"[string]\": ModelFieldSchema }),\n\t\"relations?\": type({ \"[string]\": ContractRelationSchema }),\n\t\"discriminator?\": \"unknown\",\n\t\"variants?\": \"unknown\",\n\t\"base?\": CrossReferenceSchema,\n\t\"owner?\": \"string\"\n});\nconst ContractMetaSchema = type({ \"[string]\": \"unknown\" });\n/**\n* Builds the full SQL contract schema. The storage subtree threads\n* pack contributions through {@link createSqlStorageSchema}; the rest\n* of the contract envelope is family-shared.\n*/\nfunction createSqlContractSchema(kinds) {\n\tconst storage = createSqlStorageSchema(kinds);\n\treturn type({\n\t\t\"+\": \"reject\",\n\t\ttarget: \"string\",\n\t\ttargetFamily: \"'sql'\",\n\t\t\"coreHash?\": \"string\",\n\t\tprofileHash: \"string\",\n\t\t\"capabilities?\": \"Record<string, Record<string, boolean>>\",\n\t\t\"extensions?\": \"Record<string, unknown>\",\n\t\t\"meta?\": ContractMetaSchema,\n\t\t\"defaultControlPolicy?\": ControlPolicySchema,\n\t\t\"roots?\": type({ \"[string]\": CrossReferenceSchema }),\n\t\tdomain: type({ namespaces: type({ \"[string]\": type({\n\t\t\tmodels: type({ \"[string]\": ModelSchema }),\n\t\t\t\"valueObjects?\": \"Record<string, unknown>\",\n\t\t\t\"enum?\": type({ \"[string]\": ContractEnumSchema })\n\t\t}) }) }),\n\t\tstorage,\n\t\t\"execution?\": ExecutionSchema\n\t});\n}\nconst SqlContractSchema = createSqlContractSchema(DEFAULT_SQL_KINDS);\n/**\n* Validates the structural shape of SqlStorage using Arktype. Pure\n* structural check: namespace IR is never materialized here (that needs\n* a target concretion via the serializer hydration path), so this throws\n* on invalid input and constructs nothing.\n*\n* @param value - The storage value to validate\n* @throws Error if the storage structure is invalid\n*/\nfunction validateStorage(value) {\n\tconst result = StorageSchema(value);\n\tif (result instanceof type.errors) {\n\t\tconst errors = result.map((p) => p.message);\n\t\tthrow contractError(\"CONTRACT.VALIDATION_FAILED\", `Storage validation failed: ${errors.join(\"; \")}`, { meta: { errors } });\n\t}\n}\nfunction validateModel(value) {\n\tconst result = ModelSchema(value);\n\tif (result instanceof type.errors) {\n\t\tconst errors = result.map((p) => p.message);\n\t\tthrow contractError(\"CONTRACT.VALIDATION_FAILED\", `Model validation failed: ${errors.join(\"; \")}`, { meta: { errors } });\n\t}\n\treturn result;\n}\n/**\n* Structural arktype validation of an SQL contract envelope. Internal\n* helper for {@link validateSqlContractFully} — exposed only inside\n* this module, since the family seam-of-record is the\n* `SqlContractSerializerBase.deserializeContract` SPI.\n*/\nfunction validateSqlContractStructure(value, contractSchema) {\n\tif (typeof value !== \"object\" || value === null) throw new ContractValidationError(\"Contract structural validation failed: value must be an object\", \"structural\");\n\tconst rawValue = value;\n\tif (rawValue.targetFamily !== void 0 && rawValue.targetFamily !== \"sql\") throw new ContractValidationError(`Unsupported target family: ${rawValue.targetFamily}`, \"structural\");\n\tconst contractResult = contractSchema(value);\n\tif (contractResult instanceof type.errors) throw new ContractValidationError(`Contract structural validation failed: ${contractResult.map((p) => p.message).join(\"; \")}`, \"structural\");\n\treturn contractResult;\n}\n/**\n* Validates semantic constraints on SqlStorage that cannot be expressed in Arktype schemas.\n*\n* Returns an array of human-readable error strings. Empty array = valid.\n*\n* Currently checks:\n* - duplicate named primary key / unique / index / foreign key objects within a table\n* - duplicate unique, index, or foreign key declarations within a table\n* - duplicate columns within primary key / unique / index definitions\n* - nullable columns in primary key definitions\n* - `setNull` referential action on a non-nullable FK column (would fail at runtime)\n* - `setDefault` referential action on a non-nullable FK column without a DEFAULT (would fail at runtime)\n*/\nfunction validateStorageSemantics(storage) {\n\tconst errors = [];\n\tvalidateTableScopedEntryNames(storage, errors);\n\tfor (const { namespaceId, tableName, table: rawTable } of eachStorageTable(storage)) {\n\t\tconst table = rawTable;\n\t\tconst namedObjects = /* @__PURE__ */ new Map();\n\t\tconst registerNamedObject = (kind, name) => {\n\t\t\tif (!name) return;\n\t\t\tnamedObjects.set(name, [...namedObjects.get(name) ?? [], kind]);\n\t\t};\n\t\tregisterNamedObject(\"primary key\", table.primaryKey?.name);\n\t\tfor (const unique of table.uniques) registerNamedObject(\"unique constraint\", unique.name);\n\t\tfor (const index of table.indexes) registerNamedObject(\"index\", index.name);\n\t\tfor (const fk of table.foreignKeys) registerNamedObject(\"foreign key\", fk.name);\n\t\tfor (const check of table.checks ?? []) registerNamedObject(\"check constraint\", check.name);\n\t\tfor (const [name, kinds] of namedObjects) if (kinds.length > 1) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": named object \"${name}\" is declared multiple times (${kinds.join(\", \")})`);\n\t\tif (table.primaryKey) {\n\t\t\tconst duplicateColumn = findDuplicateValue(table.primaryKey.columns);\n\t\t\tif (duplicateColumn !== void 0) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": primary key contains duplicate column \"${duplicateColumn}\"`);\n\t\t\tfor (const columnName of table.primaryKey.columns) if (table.columns[columnName]?.nullable === true) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": primary key column \"${columnName}\" is nullable; primary key columns must be NOT NULL`);\n\t\t}\n\t\tconst seenUniqueDefinitions = /* @__PURE__ */ new Set();\n\t\tfor (const unique of table.uniques) {\n\t\t\tconst duplicateColumn = findDuplicateValue(unique.columns);\n\t\t\tif (duplicateColumn !== void 0) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": unique constraint contains duplicate column \"${duplicateColumn}\"`);\n\t\t\tconst signature = JSON.stringify({ columns: unique.columns });\n\t\t\tif (seenUniqueDefinitions.has(signature)) {\n\t\t\t\terrors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": duplicate unique constraint definition on columns [${unique.columns.join(\", \")}]`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenUniqueDefinitions.add(signature);\n\t\t}\n\t\tconst tableCoordinate = `Namespace \"${namespaceId}\" table \"${tableName}\"`;\n\t\trejectRepeatedIndexColumns(table.indexes, tableCoordinate, errors);\n\t\trejectDuplicateWireNamedIndexContent(table.indexes, tableCoordinate, errors);\n\t\tconst seenForeignKeyDefinitions = /* @__PURE__ */ new Set();\n\t\tfor (const fk of table.foreignKeys) {\n\t\t\tconst signature = JSON.stringify({\n\t\t\t\tsource: fk.source,\n\t\t\t\ttarget: fk.target,\n\t\t\t\tonDelete: fk.onDelete ?? null,\n\t\t\t\tonUpdate: fk.onUpdate ?? null\n\t\t\t});\n\t\t\tif (seenForeignKeyDefinitions.has(signature)) {\n\t\t\t\terrors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": duplicate foreign key definition on columns [${fk.source.columns.join(\", \")}]`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenForeignKeyDefinitions.add(signature);\n\t\t}\n\t\tfor (const fk of table.foreignKeys) for (const colName of fk.source.columns) {\n\t\t\tconst column = table.columns[colName];\n\t\t\tif (!column) continue;\n\t\t\tif (fk.onDelete === \"setNull\" && !column.nullable) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": onDelete setNull on foreign key column \"${colName}\" which is NOT NULL`);\n\t\t\tif (fk.onUpdate === \"setNull\" && !column.nullable) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": onUpdate setNull on foreign key column \"${colName}\" which is NOT NULL`);\n\t\t\tif (fk.onDelete === \"setDefault\" && !column.nullable && column.default === void 0) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": onDelete setDefault on foreign key column \"${colName}\" which is NOT NULL and has no DEFAULT`);\n\t\t\tif (fk.onUpdate === \"setDefault\" && !column.nullable && column.default === void 0) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": onUpdate setDefault on foreign key column \"${colName}\" which is NOT NULL and has no DEFAULT`);\n\t\t}\n\t\trejectDuplicateWireNamedCheckContent(table.checks ?? [], tableCoordinate, errors);\n\t}\n\treturn errors;\n}\n/**\n* SQL storage logical-consistency checks: every model.storage.table\n* resolves to a real table, every model.storage.fields[*].column\n* resolves to a real column, and value-object fields land on JSON-native\n* columns. Throws `ContractValidationError` on the first mismatch.\n*/\nfunction validateModelStorageReferences(contract) {\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst models = namespace.models;\n\t\tfor (const [modelName, model] of Object.entries(models)) {\n\t\t\tconst qualifiedName = `${namespaceId}:${modelName}`;\n\t\t\tconst storageNamespaceId = model.storage.namespaceId;\n\t\t\tif (storageNamespaceId !== namespaceId) throw new ContractValidationError(`Model \"${qualifiedName}\" storage.namespaceId \"${storageNamespaceId}\" does not match domain namespace \"${namespaceId}\"`, \"storage\");\n\t\t\tconst storageTable = model.storage.table;\n\t\t\tconst rawTable = contract.storage.namespaces[storageNamespaceId]?.entries.table?.[storageTable];\n\t\t\tif (rawTable === void 0) throw new ContractValidationError(`Model \"${qualifiedName}\" references non-existent table \"${storageNamespaceId}.${storageTable}\"`, \"storage\");\n\t\t\tconst table = rawTable;\n\t\t\tconst columnNames = new Set(Object.keys(table.columns));\n\t\t\tfor (const [fieldName, field] of Object.entries(model.storage.fields)) if (!columnNames.has(field.column)) throw new ContractValidationError(`Model \"${qualifiedName}\" field \"${fieldName}\" references non-existent column \"${field.column}\" in table \"${storageTable}\"`, \"storage\");\n\t\t\tconst JSON_NATIVE_TYPES = /* @__PURE__ */ new Set([\"json\", \"jsonb\"]);\n\t\t\tfor (const [fieldName, domainField] of Object.entries(model.fields ?? {})) {\n\t\t\t\tif (domainField.type?.kind !== \"valueObject\") continue;\n\t\t\t\tconst storageField = model.storage.fields[fieldName];\n\t\t\t\tif (!storageField) continue;\n\t\t\t\tconst column = table.columns[storageField.column];\n\t\t\t\tif (!column) continue;\n\t\t\t\tif (!JSON_NATIVE_TYPES.has(column.nativeType)) throw new ContractValidationError(`Model \"${qualifiedName}\" field \"${fieldName}\" is a value object but storage column \"${storageField.column}\" has nativeType \"${column.nativeType}\" (expected json or jsonb)`, \"storage\");\n\t\t\t}\n\t\t}\n\t}\n}\n/**\n* Cross-table consistency checks for SQL storage: primary key, unique,\n* index, and foreign key column references resolve to real columns;\n* NOT NULL columns don't carry a literal `null` default; FK column\n* counts match their referenced columns. Throws on the first mismatch.\n*/\nfunction validateSqlStorageConsistency(contract) {\n\tfor (const { namespaceId, tableName, table: rawTable } of eachStorageTable(contract.storage)) {\n\t\tconst table = rawTable;\n\t\tconst columnNames = new Set(Object.keys(table.columns));\n\t\tif (table.primaryKey) {\n\t\t\tfor (const colName of table.primaryKey.columns) if (!columnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" primaryKey references non-existent column \"${colName}\"`, \"storage\");\n\t\t}\n\t\tfor (const unique of table.uniques) for (const colName of unique.columns) if (!columnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" unique constraint references non-existent column \"${colName}\"`, \"storage\");\n\t\tfor (const index of table.indexes) for (const colName of index.columns ?? []) if (!columnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" index references non-existent column \"${colName}\"`, \"storage\");\n\t\tfor (const [colName, column] of Object.entries(table.columns)) if (!column.nullable && column.default?.kind === \"literal\" && column.default.value === null) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" column \"${colName}\" is NOT NULL but has a literal null default`, \"storage\");\n\t\tfor (const fk of table.foreignKeys) {\n\t\t\tif (fk.source.namespaceId !== namespaceId || fk.source.tableName !== tableName) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" contains foreignKey with mismatched source coordinates (${fk.source.namespaceId}.${fk.source.tableName})`, \"storage\");\n\t\t\tfor (const colName of fk.source.columns) if (!columnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" foreignKey references non-existent column \"${colName}\"`, \"storage\");\n\t\t\tif (fk.target.spaceId === void 0) {\n\t\t\t\tconst referencedRaw = contract.storage.namespaces[fk.target.namespaceId]?.entries.table?.[fk.target.tableName];\n\t\t\t\tif (referencedRaw === void 0) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" foreignKey references non-existent table \"${fk.target.namespaceId}.${fk.target.tableName}\"`, \"storage\");\n\t\t\t\tconst referencedColumnNames = new Set(Object.keys(referencedRaw.columns));\n\t\t\t\tfor (const colName of fk.target.columns) if (!referencedColumnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" foreignKey references non-existent column \"${colName}\" in table \"${fk.target.tableName}\"`, \"storage\");\n\t\t\t}\n\t\t\tif (fk.source.columns.length !== fk.target.columns.length) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" foreignKey column count (${fk.source.columns.length}) does not match referenced column count (${fk.target.columns.length})`, \"storage\");\n\t\t}\n\t}\n}\n/**\n* Full SQL contract validation: structural (arktype) +\n* framework-shared domain + SQL storage logical-consistency + SQL\n* storage semantic + model ↔ storage reference checks. Throws\n* `ContractValidationError` on the first failure. Returns the\n* validated flat-data shape; IR class hydration happens in the SPI\n* base on top of this helper.\n*/\nfunction validateSqlContractFully(value, options) {\n\tconst validated = validateSqlContractStructure(typeof value === \"object\" && value !== null ? (() => {\n\t\tconst { schemaVersion: _, _generated: _g, ...rest } = value;\n\t\treturn rest;\n\t})() : value, options?.contractSchema ?? SqlContractSchema);\n\tvalidateContractDomain({\n\t\troots: validated.roots,\n\t\tdomain: validated.domain\n\t});\n\tvalidateSqlStorageConsistency(validated);\n\tconst semanticErrors = validateStorageSemantics(validated.storage);\n\tif (semanticErrors.length > 0) throw new ContractValidationError(`Contract semantic validation failed: ${semanticErrors.join(\"; \")}`, \"storage\");\n\tvalidateModelStorageReferences(validated);\n\tvalidateRelationThroughConsistency(validated);\n\tvalidateToOneRelationNullabilityAgainstStorage(validated);\n\treturn validated;\n}\n/**\n* A same-space to-one relation that states `nullable` must agree with its local FK columns:\n* nullable exactly when one of them is nullable (a column that cannot be resolved counts as\n* nullable). A relation without the flag is left to hydration, which derives it the same way.\n*/\nfunction validateToOneRelationNullabilityAgainstStorage(contract) {\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) for (const [modelName, model] of Object.entries(namespace.models)) {\n\t\tconst storage = blindCast(model.storage);\n\t\tfor (const [relationName, relation] of Object.entries(model.relations)) {\n\t\t\tif (!(\"on\" in relation && (relation.cardinality === \"1:1\" || relation.cardinality === \"N:1\") && relation.to.space === void 0) || relation.nullable === void 0) continue;\n\t\t\tconst location = `Relation \"${relationName}\" on model \"${namespaceId}:${modelName}\"`;\n\t\t\tconst { ownsForeignKey, columns } = resolveSqlToOneRelationStorage(contract, storage, relation);\n\t\t\tif (!ownsForeignKey) {\n\t\t\t\tif (relation.nullable) continue;\n\t\t\t\tthrow new ContractValidationError(`${location} is required but does not own the foreign key, so nothing in storage guarantees the related row exists`, \"storage\");\n\t\t\t}\n\t\t\tconst anyNullable = columns.some((column) => column.nullable);\n\t\t\tif (relation.nullable === anyNullable) continue;\n\t\t\tconst columnList = columns.filter((column) => column.nullable !== relation.nullable).map((column) => `\"${column.name}\"`).join(\", \");\n\t\t\tthrow new ContractValidationError(relation.nullable ? `${location} is nullable but every local FK column is NOT NULL (columns ${columnList})` : `${location} is required but a local FK column is nullable (columns ${columnList})`, \"storage\");\n\t\t}\n\t}\n}\n/** Storage column lookup for through-consistency validation. */\nfunction lookupStorageColumn(contract, namespaceId, tableName, columnName) {\n\tconst rawTable = contract.storage.namespaces[namespaceId]?.entries.table?.[tableName];\n\tif (rawTable === void 0) return;\n\treturn blindCast(rawTable).columns[columnName];\n}\n/**\n* Two storage columns share a type when their `nativeType` and `typeParams`\n* match. The contract is canonicalized, so `typeParams` key order is stable and\n* a JSON comparison is exact. `codecId` and `nullable` are intentionally not\n* compared: they do not change the database-level type that governs a join.\n*/\nfunction sameStorageType(a, b) {\n\treturn a.nativeType === b.nativeType && JSON.stringify(a.typeParams ?? null) === JSON.stringify(b.typeParams ?? null);\n}\nfunction describeColumnType(column) {\n\treturn column.typeParams === void 0 ? column.nativeType : `${column.nativeType} ${JSON.stringify(column.typeParams)}`;\n}\n/**\n* Validates one side of an N:M join: the junction columns and the model\n* columns they pair against positionally must be equal in number, exist in\n* their tables, and share the same storage type (`nativeType` + `typeParams`).\n* The junction's storage foreign keys already guarantee this for user-declared\n* FK constraints, but `through` is a logical descriptor never tied to them by\n* the rest of validation — and the TS builder accepts explicit join columns\n* without requiring a junction FK at all — so this checks the columns directly\n* against storage, one path regardless of how the junction was authored.\n*\n* Joined columns must be the *same* storage type, not merely compatible:\n* relying on implicit conversion (e.g. `text`↔`character`) is unsafe on writes\n* — `character(n)` space-padding makes such coercions non-associative — and no\n* ADR sanctions heterogeneous junction columns. Equality is the conservative\n* default; it can be relaxed deliberately if a real use case ever appears.\n*/\nfunction validateThroughJoinSide(input) {\n\tconst fail = (detail) => new ContractValidationError(`Many-to-many relation \"${input.qualifiedName}\" ${detail}`, \"storage\");\n\tif (input.junctionColumns.length !== input.modelColumns.length) throw fail(`pairs ${input.junctionColumnsLabel} (${input.junctionColumns.length}) with ${input.modelColumnsLabel} (${input.modelColumns.length}) of differing length; they join positionally and must match.`);\n\tfor (const [index, junctionColumnName] of input.junctionColumns.entries()) {\n\t\tconst modelColumnRef = input.modelColumns[index];\n\t\tif (modelColumnRef === void 0) continue;\n\t\tconst junctionColumn = lookupStorageColumn(input.contract, input.junctionNamespaceId, input.junctionTable, junctionColumnName);\n\t\tif (junctionColumn === void 0) throw fail(`${input.junctionColumnsLabel} references column \"${junctionColumnName}\" absent from junction table \"${input.junctionNamespaceId}.${input.junctionTable}\".`);\n\t\tconst model = input.model;\n\t\tif (model === void 0) continue;\n\t\tlet modelColumnName = modelColumnRef;\n\t\tif (model.fieldToColumn !== void 0) {\n\t\t\tconst mapped = model.fieldToColumn[modelColumnRef];\n\t\t\tif (mapped === void 0) throw fail(`${input.modelColumnsLabel} references field \"${modelColumnRef}\" absent from model on table \"${model.namespaceId}.${model.table}\".`);\n\t\t\tmodelColumnName = mapped.column;\n\t\t}\n\t\tconst modelColumn = lookupStorageColumn(input.contract, model.namespaceId, model.table, modelColumnName);\n\t\tif (modelColumn === void 0) throw fail(`${input.modelColumnsLabel} references column \"${modelColumnName}\" absent from table \"${model.namespaceId}.${model.table}\".`);\n\t\tif (!sameStorageType(junctionColumn, modelColumn)) throw fail(`joins \"${input.junctionTable}.${junctionColumnName}\" (${describeColumnType(junctionColumn)}) with \"${model.table}.${modelColumnName}\" (${describeColumnType(modelColumn)}) of differing storage type; junction columns must match the type of the column they reference.`);\n\t}\n}\n/**\n* Validates that every N:M relation's `through` descriptor is consistent with\n* the storage columns it joins: both join sides match in column count,\n* reference columns that exist in their tables, and pair columns of the same\n* storage type. Without this, a `through` that disagrees with storage surfaces\n* as a silently wrong JOIN at query time rather than a validation error here.\n*/\nfunction validateRelationThroughConsistency(contract) {\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) for (const [modelName, model] of Object.entries(namespace.models)) for (const [relationName, relation] of Object.entries(model.relations)) {\n\t\tif (relation.cardinality !== \"N:M\") continue;\n\t\tconst qualifiedName = `${namespaceId}.${modelName}.${relationName}`;\n\t\tconst { on, through } = relation;\n\t\tconst modelStorage = blindCast(model.storage);\n\t\tvalidateThroughJoinSide({\n\t\t\tcontract,\n\t\t\tqualifiedName,\n\t\t\tmodelColumns: on.localFields,\n\t\t\tmodelColumnsLabel: \"on.localFields\",\n\t\t\tmodel: {\n\t\t\t\tnamespaceId,\n\t\t\t\ttable: modelStorage.table,\n\t\t\t\tfieldToColumn: modelStorage.fields\n\t\t\t},\n\t\t\tjunctionColumns: through.parentColumns,\n\t\t\tjunctionColumnsLabel: \"through.parentColumns\",\n\t\t\tjunctionNamespaceId: through.namespaceId,\n\t\t\tjunctionTable: through.table\n\t\t});\n\t\tconst targetModel = relation.to.space === void 0 ? contract.domain.namespaces[relation.to.namespace]?.models[relation.to.model] : void 0;\n\t\tconst targetModelSide = targetModel === void 0 ? void 0 : {\n\t\t\tnamespaceId: relation.to.namespace,\n\t\t\ttable: blindCast(targetModel.storage).table\n\t\t};\n\t\tvalidateThroughJoinSide({\n\t\t\tcontract,\n\t\t\tqualifiedName,\n\t\t\tmodelColumns: through.targetColumns,\n\t\t\tmodelColumnsLabel: \"through.targetColumns\",\n\t\t\t...ifDefined(\"model\", targetModelSide),\n\t\t\tjunctionColumns: through.childColumns,\n\t\t\tjunctionColumnsLabel: \"through.childColumns\",\n\t\t\tjunctionNamespaceId: through.namespaceId,\n\t\t\tjunctionTable: through.table\n\t\t});\n\t}\n}\n//#endregion\nexport { CheckConstraintSchema, ColumnDefaultFunctionSchema, ColumnDefaultLiteralSchema, ColumnDefaultSchema, ContractEnumSchema, ForeignKeyReferenceSchema, ForeignKeySchema, ForeignKeySourceSchema, IndexSchema, ReferentialActionSchema, StorageTableSchema, StorageValueSetSchema, checkSqlDefaultBody, createNamespaceEntrySchema, createSqlContractSchema, createSqlStorageSchema, reservedSqlDefaultBody, resolveSqlToOneRelationStorage, validateModel, validateModelStorageReferences, validateSqlContractFully, validateSqlStorageConsistency, validateStorage, validateStorageSemantics };\n\n//# sourceMapping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