@prisma/orm-family-sql 8.0.0-rc.18-dev.29 → 8.0.0-rc.18-dev.31

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 (164) hide show
  1. package/dist/{ast-CBO3PEJF.mjs → ast-BJs2669T.mjs} +47 -12
  2. package/dist/ast-BJs2669T.mjs.map +1 -0
  3. package/dist/{ast-Cq7uhA86.d.mts → ast-DB7g9Mh2.d.mts} +29 -2
  4. package/dist/ast-DB7g9Mh2.d.mts.map +1 -0
  5. package/dist/{attribute-specs-D9QcPJpj.d.mts → attribute-specs-BzBk62Jx.d.mts} +10 -4
  6. package/dist/{attribute-specs-D9QcPJpj.d.mts.map → attribute-specs-BzBk62Jx.d.mts.map} +1 -1
  7. package/dist/{authoring-entity-types-CZ-vdwYS-CSU65LVs.d.mts → authoring-entity-types-CZ-vdwYS-DzxLL9BC.d.mts} +2 -2
  8. package/dist/{authoring-entity-types-CZ-vdwYS-CSU65LVs.d.mts.map → authoring-entity-types-CZ-vdwYS-DzxLL9BC.d.mts.map} +1 -1
  9. package/dist/builder.d.mts +1 -1
  10. package/dist/builder__runtime.d.mts +1 -1
  11. package/dist/builder__runtime.mjs +1 -1
  12. package/dist/builder__types.d.mts +1 -1
  13. package/dist/{config-types-BJxHMPGt.mjs → config-types-BkcCqeAg.mjs} +2 -2
  14. package/dist/{config-types-BJxHMPGt.mjs.map → config-types-BkcCqeAg.mjs.map} +1 -1
  15. package/dist/{contract-builder-CrWbrtE4.mjs → contract-builder-D3XaKpyw.mjs} +96 -11
  16. package/dist/contract-builder-D3XaKpyw.mjs.map +1 -0
  17. package/dist/{contract-builder-D-RSOsnc.d.mts → contract-builder-GH-eCIpl.d.mts} +18 -2
  18. package/dist/contract-builder-GH-eCIpl.d.mts.map +1 -0
  19. package/dist/contract-prisma7__provider.d.mts +1 -3
  20. package/dist/contract-prisma7__provider.d.mts.map +1 -1
  21. package/dist/contract-prisma7__provider.mjs +41 -12
  22. package/dist/contract-prisma7__provider.mjs.map +1 -1
  23. package/dist/contract-psl.d.mts +5 -3
  24. package/dist/contract-psl.d.mts.map +1 -1
  25. package/dist/contract-psl.mjs +1 -1
  26. package/dist/contract-psl__attribute-specs.d.mts +1 -1
  27. package/dist/contract-psl__attribute-specs.mjs +1 -1
  28. package/dist/contract-psl__diagnostics.mjs +1 -1
  29. package/dist/contract-psl__provider.mjs +3 -2
  30. package/dist/contract-psl__provider.mjs.map +1 -1
  31. package/dist/contract-ts.d.mts +1 -1
  32. package/dist/contract-ts.mjs +3 -3
  33. package/dist/contract-ts__config-types.mjs +1 -1
  34. package/dist/contract-ts__contract-builder.d.mts +1 -1
  35. package/dist/contract-ts__contract-builder.mjs +2 -2
  36. package/dist/contract.d.mts +3 -3
  37. package/dist/contract.mjs +6 -6
  38. package/dist/contract__data-type.d.mts +2 -2
  39. package/dist/contract__data-type.mjs +3 -3
  40. package/dist/contract__foreign-key-materialization.d.mts +1 -1
  41. package/dist/contract__foreign-key-materialization.mjs +2 -2
  42. package/dist/contract__validators.mjs +1 -1
  43. package/dist/{control-C56VTBHJ.d.mts → control-Db07JiRl.d.mts} +93 -16
  44. package/dist/control-Db07JiRl.d.mts.map +1 -0
  45. package/dist/{control-CnKhMUQJ.mjs → control-DbHnaxDE.mjs} +17 -12
  46. package/dist/control-DbHnaxDE.mjs.map +1 -0
  47. package/dist/{control-adapter-DhX77V61.mjs → control-adapter-BX5COBWO.mjs} +2 -2
  48. package/dist/{control-adapter-DhX77V61.mjs.map → control-adapter-BX5COBWO.mjs.map} +1 -1
  49. package/dist/{control-adapter-BCopdpsT-BPHa2Frw.d.mts → control-adapter-Bn0uhplA-BnsQY8_q.d.mts} +5 -5
  50. package/dist/{control-adapter-BCopdpsT-BPHa2Frw.d.mts.map → control-adapter-Bn0uhplA-BnsQY8_q.d.mts.map} +1 -1
  51. package/dist/{control-adapter-ChJhp5vV.d.mts → control-adapter-DgxEVzhZ.d.mts} +4 -4
  52. package/dist/{control-adapter-ChJhp5vV.d.mts.map → control-adapter-DgxEVzhZ.d.mts.map} +1 -1
  53. package/dist/{data-type-C84xngfv.d.mts → data-type-DMk-fLAZ.d.mts} +38 -8
  54. package/dist/data-type-DMk-fLAZ.d.mts.map +1 -0
  55. package/dist/data-type-HNhSslwG.mjs +67 -0
  56. package/dist/data-type-HNhSslwG.mjs.map +1 -0
  57. package/dist/{db-BmrN9nRS-BzK96yVh.d.mts → db-BmrN9nRS-BGnRxI7X.d.mts} +2 -2
  58. package/dist/{db-BmrN9nRS-BzK96yVh.d.mts.map → db-BmrN9nRS-BGnRxI7X.d.mts.map} +1 -1
  59. package/dist/{derived-checks-sRZp_gTF-ermwhVGQ.mjs → derived-checks-B1qNxwBL-DFoGexId.mjs} +17 -5
  60. package/dist/derived-checks-B1qNxwBL-DFoGexId.mjs.map +1 -0
  61. package/dist/{diagnostics-C8YevjSU.mjs → diagnostics-xqFRhSin.mjs} +2 -2
  62. package/dist/{diagnostics-C8YevjSU.mjs.map → diagnostics-xqFRhSin.mjs.map} +1 -1
  63. package/dist/{diff-ClZvIVOl.d.mts → diff-BN_3K9lv.d.mts} +5 -5
  64. package/dist/{diff-ClZvIVOl.d.mts.map → diff-BN_3K9lv.d.mts.map} +1 -1
  65. package/dist/family.d.mts +11 -11
  66. package/dist/family.mjs +9 -8
  67. package/dist/family__control-adapter.d.mts +2 -2
  68. package/dist/family__control-adapter.mjs +1 -1
  69. package/dist/family__control.d.mts +3 -3
  70. package/dist/family__control.mjs +3 -3
  71. package/dist/family__diff.d.mts +1 -1
  72. package/dist/family__diff.mjs +1 -1
  73. package/dist/family__ir.mjs +1 -1
  74. package/dist/family__migration.d.mts +1 -1
  75. package/dist/family__pack.d.mts +2 -2
  76. package/dist/family__pack.mjs +8 -3
  77. package/dist/family__pack.mjs.map +1 -1
  78. package/dist/family__psl-build.d.mts +2 -2
  79. package/dist/family__psl-build.mjs +2 -2
  80. package/dist/family__psl-infer.d.mts +1 -1
  81. package/dist/family__psl-infer.mjs +1 -1
  82. package/dist/{foreign-key-materialization-C_FPLzj3.mjs → foreign-key-materialization-BPQqd0qF.mjs} +2 -2
  83. package/dist/{foreign-key-materialization-C_FPLzj3.mjs.map → foreign-key-materialization-BPQqd0qF.mjs.map} +1 -1
  84. package/dist/{foreign-key-materialization-3vQnPT_D.d.mts → foreign-key-materialization-bL-t2oPB.d.mts} +3 -3
  85. package/dist/{foreign-key-materialization-3vQnPT_D.d.mts.map → foreign-key-materialization-bL-t2oPB.d.mts.map} +1 -1
  86. package/dist/generator-functions-BoE7Lc9d-MgcgdnPZ.mjs +483 -0
  87. package/dist/generator-functions-BoE7Lc9d-MgcgdnPZ.mjs.map +1 -0
  88. package/dist/{index-B0hZw3uT.d.mts → index-Bw9Y19Js.d.mts} +3 -3
  89. package/dist/{index-B0hZw3uT.d.mts.map → index-Bw9Y19Js.d.mts.map} +1 -1
  90. package/dist/{index-equivalence-DswCiq5l-C6SAs-Yz.mjs → index-equivalence-DswCiq5l-D5VK0qTy.mjs} +2 -2
  91. package/dist/{index-equivalence-DswCiq5l-C6SAs-Yz.mjs.map → index-equivalence-DswCiq5l-D5VK0qTy.mjs.map} +1 -1
  92. package/dist/{interpreter-kQuqdyeP-B-rzJDWE.mjs → interpreter-Bk0xpelv-4laiO5dH.mjs} +10 -10
  93. package/dist/interpreter-Bk0xpelv-4laiO5dH.mjs.map +1 -0
  94. package/dist/{migration-RrhpTP1o.d.mts → migration-go6YP7-v.d.mts} +2 -2
  95. package/dist/{migration-RrhpTP1o.d.mts.map → migration-go6YP7-v.d.mts.map} +1 -1
  96. package/dist/orm-client.d.mts +3 -3
  97. package/dist/orm-client.mjs +1 -1
  98. package/dist/{pack-DNdZwm5w.d.mts → pack-DXEOdHaM.d.mts} +91 -4
  99. package/dist/pack-DXEOdHaM.d.mts.map +1 -0
  100. package/dist/{psl-build-BT8Ue6gd.mjs → psl-build-BYqCjsqi.mjs} +47 -138
  101. package/dist/psl-build-BYqCjsqi.mjs.map +1 -0
  102. package/dist/psl-build-C41KHJL_.d.mts +108 -0
  103. package/dist/psl-build-C41KHJL_.d.mts.map +1 -0
  104. package/dist/{psl-column-resolution-BCkhNzOK-DyfXnB-9.d.mts → psl-column-resolution-DNdqpUxt-C8BST0uW.d.mts} +3 -3
  105. package/dist/psl-column-resolution-DNdqpUxt-C8BST0uW.d.mts.map +1 -0
  106. package/dist/{psl-field-resolution-C1E-_fQq-VUYD8cnS.mjs → psl-field-resolution-BET6wtHZ-C_hO6YE1.mjs} +111 -47
  107. package/dist/psl-field-resolution-BET6wtHZ-C_hO6YE1.mjs.map +1 -0
  108. package/dist/{psl-infer-I75woGr4.d.mts → psl-infer-CALmBIqX.d.mts} +3 -3
  109. package/dist/{psl-infer-I75woGr4.d.mts.map → psl-infer-CALmBIqX.d.mts.map} +1 -1
  110. package/dist/{psl-infer-Bz34csvN.mjs → psl-infer-CaEnF_x3.mjs} +2 -2
  111. package/dist/{psl-infer-Bz34csvN.mjs.map → psl-infer-CaEnF_x3.mjs.map} +1 -1
  112. package/dist/relational-core.d.mts +2 -2
  113. package/dist/relational-core.mjs +2 -2
  114. package/dist/relational-core__ast.d.mts +2 -2
  115. package/dist/relational-core__ast.mjs +2 -2
  116. package/dist/runtime.d.mts +3 -3
  117. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  118. package/dist/{schema-differ-DmP74bB8-CIQ17HTk.d.mts → schema-differ-DmP74bB8-BfEQ_9cY.d.mts} +3 -3
  119. package/dist/{schema-differ-DmP74bB8-CIQ17HTk.d.mts.map → schema-differ-DmP74bB8-BfEQ_9cY.d.mts.map} +1 -1
  120. package/dist/schema-ir.d.mts +1 -1
  121. package/dist/schema-ir.mjs +1 -1
  122. package/dist/schema-ir__types.d.mts +2 -2
  123. package/dist/schema-ir__types.mjs +1 -1
  124. package/dist/{schema-verify-BwRdzbHb-nDeE75xa.mjs → schema-verify-BwRdzbHb-BzdgK4xv.mjs} +2 -2
  125. package/dist/{schema-verify-BwRdzbHb-nDeE75xa.mjs.map → schema-verify-BwRdzbHb-BzdgK4xv.mjs.map} +1 -1
  126. package/dist/{sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs → sql-contract-serializer-sMY3prTx-D-xfnqyD.mjs} +2 -2
  127. package/dist/{sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs.map → sql-contract-serializer-sMY3prTx-D-xfnqyD.mjs.map} +1 -1
  128. package/dist/{sql-data-type-BSi0X331-OXbBFXDh.mjs → sql-data-type-D5cI3M07-DIcPP8s1.mjs} +26 -9
  129. package/dist/sql-data-type-D5cI3M07-DIcPP8s1.mjs.map +1 -0
  130. package/dist/{transaction-state-DR3nKTmH-DbyhuL-z.d.mts → transaction-state-DR3nKTmH-D_pb9QgR.d.mts} +2 -2
  131. package/dist/{transaction-state-DR3nKTmH-DbyhuL-z.d.mts.map → transaction-state-DR3nKTmH-D_pb9QgR.d.mts.map} +1 -1
  132. package/dist/types-D_nlUp-1.d.mts +1 -0
  133. package/dist/{types-B3AHHPDh-BHh-89fY.d.mts → types-DiD6BqoN-ZF53hwPp.d.mts} +11 -3
  134. package/dist/types-DiD6BqoN-ZF53hwPp.d.mts.map +1 -0
  135. package/dist/{types-DKU4GeqD-CUClXCme.d.mts → types-DlFdMaDJ-BEDwj-Qv.d.mts} +5 -5
  136. package/dist/{types-DKU4GeqD-CUClXCme.d.mts.map → types-DlFdMaDJ-BEDwj-Qv.d.mts.map} +1 -1
  137. package/dist/{types-egs_vme1-DRhYFwIT.mjs → types-DoyiTsjg-DDTmYyNY.mjs} +22 -2
  138. package/dist/types-DoyiTsjg-DDTmYyNY.mjs.map +1 -0
  139. package/dist/{validators-BCRydDG7.mjs → validators-BlONfdFH.mjs} +3 -3
  140. package/dist/{validators-BCRydDG7.mjs.map → validators-BlONfdFH.mjs.map} +1 -1
  141. package/package.json +18 -18
  142. package/dist/ast-CBO3PEJF.mjs.map +0 -1
  143. package/dist/ast-Cq7uhA86.d.mts.map +0 -1
  144. package/dist/authoring-type-constructors-0Iv2zdwS-D4LlP1q2.mjs +0 -266
  145. package/dist/authoring-type-constructors-0Iv2zdwS-D4LlP1q2.mjs.map +0 -1
  146. package/dist/contract-builder-CrWbrtE4.mjs.map +0 -1
  147. package/dist/contract-builder-D-RSOsnc.d.mts.map +0 -1
  148. package/dist/control-C56VTBHJ.d.mts.map +0 -1
  149. package/dist/control-CnKhMUQJ.mjs.map +0 -1
  150. package/dist/data-type-C84xngfv.d.mts.map +0 -1
  151. package/dist/data-type-DKk8Unnz.mjs +0 -20
  152. package/dist/data-type-DKk8Unnz.mjs.map +0 -1
  153. package/dist/derived-checks-sRZp_gTF-ermwhVGQ.mjs.map +0 -1
  154. package/dist/interpreter-kQuqdyeP-B-rzJDWE.mjs.map +0 -1
  155. package/dist/pack-DNdZwm5w.d.mts.map +0 -1
  156. package/dist/psl-build-BT8Ue6gd.mjs.map +0 -1
  157. package/dist/psl-build-DU55bjfu.d.mts +0 -157
  158. package/dist/psl-build-DU55bjfu.d.mts.map +0 -1
  159. package/dist/psl-column-resolution-BCkhNzOK-DyfXnB-9.d.mts.map +0 -1
  160. package/dist/psl-field-resolution-C1E-_fQq-VUYD8cnS.mjs.map +0 -1
  161. package/dist/sql-data-type-BSi0X331-OXbBFXDh.mjs.map +0 -1
  162. package/dist/types-B3AHHPDh-BHh-89fY.d.mts.map +0 -1
  163. package/dist/types-BGERR8XF.d.mts +0 -1
  164. package/dist/types-egs_vme1-DRhYFwIT.mjs.map +0 -1
@@ -5,7 +5,7 @@ import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
5
5
  import { blindCast } from "@prisma/orm-framework/utils/casts";
6
6
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
7
7
  import { type } from "arktype";
8
- //#region ../../../2-sql/1-core/contract/dist/sql-data-type-BSi0X331.mjs
8
+ //#region ../../../2-sql/1-core/contract/dist/sql-data-type-D5cI3M07.mjs
9
9
  const PLACEHOLDER = /\{([A-Za-z][A-Za-z0-9]*)\}/g;
10
10
  const LITERAL_CHARACTERS = /^[a-z0-9_ (),.]*$/;
11
11
  const REGEXP_SPECIAL = /[.*+?^${}()|[\]\\]/g;
@@ -58,8 +58,12 @@ function checkMarks(id, texts) {
58
58
  }
59
59
  }
60
60
  function checkKindClaim(id, spec) {
61
+ if (spec.nameIsCatalogText === true) {
62
+ if (spec.render === void 0) refuseDeclaration(id, "a type whose name is its catalog text declares render.");
63
+ if (spec.texts !== void 0 || spec.claimsKind !== void 0) refuseDeclaration(id, "a type whose name is its catalog text declares no texts and claims no kind.");
64
+ }
61
65
  if (spec.claimsKind === void 0) {
62
- if (spec.render !== void 0) refuseDeclaration(id, "render is allowed only together with claimsKind.");
66
+ if (spec.render !== void 0 && spec.nameIsCatalogText !== true) refuseDeclaration(id, "render is allowed only together with claimsKind or nameIsCatalogText.");
63
67
  if (spec.fromReported !== void 0) refuseDeclaration(id, "fromReported is allowed only together with claimsKind.");
64
68
  return;
65
69
  }
@@ -107,12 +111,17 @@ function sqlDataType(id, spec) {
107
111
  storedAs: spec.storedAs,
108
112
  normalize,
109
113
  render: spec.render,
110
- fromReported: spec.fromReported
114
+ fromReported: spec.fromReported,
115
+ nameIsCatalogText: spec.nameIsCatalogText === true
111
116
  }
112
117
  };
113
118
  checkNormalFormsWritten(type);
114
119
  return type;
115
120
  }
121
+ /** Whether the name of `type` is the text the database catalog prints, as declared by {@link SqlDataTypeSpec.nameIsCatalogText}. */
122
+ function nameIsCatalogText(type) {
123
+ return type.sql.nameIsCatalogText;
124
+ }
116
125
  /** Whether `type` is a data type a SQL column can have. `sql/expression` is the one data type no column has. */
117
126
  function isSqlDataType(type) {
118
127
  return "sql" in type;
@@ -150,8 +159,13 @@ function substitute(type, text, params) {
150
159
  return String(value);
151
160
  });
152
161
  }
153
- /** The name of `type` with no parameters, for places where parameters must not appear. */
162
+ /**
163
+ * The name of `type` with no parameters, for places where parameters must not appear, such as a
164
+ * cast. A type whose name is its catalog text has none: its parameters cannot be separated from its
165
+ * name, so it is refused.
166
+ */
154
167
  function sqlBaseName(type, params) {
168
+ if (type.sql.nameIsCatalogText) throw new InternalError(`Data type ${type.id} names its type by its catalog text, so it has no base name.`);
155
169
  if (type.sql.render !== void 0) return type.sql.render(validateSqlTypeParams(type, params));
156
170
  const fewest = type.sql.texts.filter((text) => text.written === true).reduce((best, text) => best === void 0 || placeholdersOf(text.text).length < placeholdersOf(best.text).length ? text : best, void 0);
157
171
  if (fewest === void 0) throw new InternalError(`Data type ${type.id} has no written text and no render, so it has no base name.`);
@@ -161,11 +175,13 @@ function sqlBaseName(type, params) {
161
175
  return bracket === -1 ? name : name.slice(0, bracket);
162
176
  }
163
177
  /**
164
- * The base name of `type` with `params`, unquoted. It differs from {@link sqlBaseName} only for a
165
- * type that claims a kind: there it is the `typeName` parameter as written (`app.status`), where
166
- * `sqlBaseName` gives the quoted name `render` writes into SQL (`"app"."status"`).
178
+ * The base name of `type` with `params`, unquoted, for display. It differs from {@link sqlBaseName}
179
+ * for a type that claims a kind, where it is the `typeName` parameter as written (`app.status`)
180
+ * while `sqlBaseName` gives the quoted name `render` writes into SQL (`"app"."status"`), and for a
181
+ * type whose name is its catalog text, where it is that whole text.
167
182
  */
168
183
  function unquotedSqlBaseName(type, params) {
184
+ if (type.sql.nameIsCatalogText) return renderSqlTypeName(type, params);
169
185
  if (type.sql.claimsKind === void 0) return sqlBaseName(type, params);
170
186
  const { typeName } = validateSqlTypeParams(type, params);
171
187
  if (typeof typeName !== "string") throw new InternalError(`Data type ${type.id} claims the kind "${type.sql.claimsKind}" but declares no string typeName parameter.`);
@@ -247,6 +263,7 @@ function renderSqlTypeName(type, params) {
247
263
  function renderSqlCatalogText(type, params) {
248
264
  const validated = validateSqlTypeParams(type, params);
249
265
  if (type.sql.claimsKind !== void 0) throw new InternalError(`Data type ${type.id} claims the kind "${type.sql.claimsKind}" and has no catalog text.`);
266
+ if (type.sql.render !== void 0) return type.sql.render(validated);
250
267
  const normalized = type.sql.normalize(validated);
251
268
  return substitute(type, pickText(type, "catalog", presentKeys(normalized)), normalized);
252
269
  }
@@ -365,6 +382,6 @@ function resolvedWith(type$1, params) {
365
382
  };
366
383
  }
367
384
  //#endregion
368
- export { resolveReportedSqlType as a, sqlBaseName as c, sqlStorageType as d, sqlStorageTypeId as f, validateSqlTypeParams as g, unquotedSqlBaseNameOfCodec as h, renderSqlTypeName as i, sqlDataType as l, unquotedSqlBaseName as m, isSqlDataType as n, resolveWrittenSqlTypes as o, sqlStorageTypeOfCodec as p, renderSqlCatalogText as r, sameSqlColumnType as s, findSqlDataTypeCollision as t, sqlDataTypeOfCodec as u };
385
+ export { validateSqlTypeParams as _, renderSqlTypeName as a, sameSqlColumnType as c, sqlDataTypeOfCodec as d, sqlStorageType as f, unquotedSqlBaseNameOfCodec as g, unquotedSqlBaseName as h, renderSqlCatalogText as i, sqlBaseName as l, sqlStorageTypeOfCodec as m, isSqlDataType as n, resolveReportedSqlType as o, sqlStorageTypeId as p, nameIsCatalogText as r, resolveWrittenSqlTypes as s, findSqlDataTypeCollision as t, sqlDataType as u };
369
386
 
370
- //# sourceMappingURL=sql-data-type-BSi0X331-OXbBFXDh.mjs.map
387
+ //# sourceMappingURL=sql-data-type-D5cI3M07-DIcPP8s1.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-data-type-D5cI3M07-DIcPP8s1.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/sql-data-type-D5cI3M07.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { assertDataTypeParams, dataType, dataTypeParams, objectSchemaKeys, schemaKeysAllowing } from \"@internal/framework-components/codec\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { type } from \"arktype\";\n//#region src/sql-data-type.ts\nconst PLACEHOLDER = /\\{([A-Za-z][A-Za-z0-9]*)\\}/g;\nconst LITERAL_CHARACTERS = /^[a-z0-9_ (),.]*$/;\nconst REGEXP_SPECIAL = /[.*+?^${}()|[\\]\\\\]/g;\nfunction paramKeysOf(id, schema) {\n\tif (schema === void 0) return [];\n\tconst keys = objectSchemaKeys(schema);\n\tif (keys === void 0) refuseDeclaration(id, \"its parameter schema must be an arktype object schema.\");\n\treturn keys;\n}\nfunction placeholdersOf(text) {\n\treturn [...text.matchAll(PLACEHOLDER)].map((match) => match[1] ?? \"\");\n}\nfunction placeholderSetOf(text) {\n\treturn [...placeholdersOf(text)].sort().join(\",\");\n}\nfunction patternOf(text, signedKeys = []) {\n\tconst placeholders = text.replace(REGEXP_SPECIAL, \"\\\\$&\").replace(/\\\\\\{([A-Za-z][A-Za-z0-9]*)\\\\\\}/g, (_, name) => signedKeys.includes(name) ? \"(-?\\\\d+)\" : \"(\\\\d+)\");\n\treturn new RegExp(`^${placeholders}$`);\n}\nfunction refuseDeclaration(id, why) {\n\tthrow new InternalError(`Data type ${id}: ${why}`);\n}\nfunction checkText(id, text, paramKeys) {\n\tconst quoted = JSON.stringify(text.text);\n\tconst refuse = (why) => refuseDeclaration(id, `the text ${quoted} ${why}.`);\n\tif (text.text === \"\") refuse(\"is empty\");\n\tif (text.text !== text.text.trim()) refuse(\"starts or ends with a space\");\n\tif (text.text.includes(\" \")) refuse(\"has two spaces in a row\");\n\tconst literal = text.text.replace(PLACEHOLDER, \"\");\n\tif (literal.includes(\"{\") || literal.includes(\"}\")) refuse(\"has a placeholder that is not written {name}\");\n\tif (!LITERAL_CHARACTERS.test(literal)) refuse(\"must be lower case and contain only letters, digits, spaces, brackets, commas, dots, underscores and placeholders\");\n\tfor (const name of placeholdersOf(text.text)) if (!paramKeys.includes(name)) refuse(`names the parameter {${name}}, which the type does not declare`);\n\tif (text.display === void 0) return;\n\tconst display = JSON.stringify(text.display);\n\tif (text.display.toLowerCase() !== text.text.toLowerCase()) refuse(`has the display ${display}, which differs from it beyond letter case`);\n\tif (placeholdersOf(text.display).join(\",\") !== placeholdersOf(text.text).join(\",\")) refuse(`has the display ${display}, which writes a placeholder differently`);\n}\nfunction checkMarks(id, texts) {\n\tconst marked = /* @__PURE__ */ new Map();\n\tfor (const text of texts) {\n\t\tconst key = placeholderSetOf(text.text);\n\t\tconst entry = marked.get(key) ?? {};\n\t\tfor (const mark of [\"written\", \"catalog\"]) {\n\t\t\tif (text[mark] !== true) continue;\n\t\t\tconst other = entry[mark];\n\t\t\tif (other !== void 0) refuseDeclaration(id, `the texts ${JSON.stringify(other)} and ${JSON.stringify(text.text)} have the same placeholders and are both ${mark}.`);\n\t\t\tentry[mark] = text.text;\n\t\t}\n\t\tmarked.set(key, entry);\n\t}\n}\nfunction checkKindClaim(id, spec) {\n\tif (spec.nameIsCatalogText === true) {\n\t\tif (spec.render === void 0) refuseDeclaration(id, \"a type whose name is its catalog text declares render.\");\n\t\tif (spec.texts !== void 0 || spec.claimsKind !== void 0) refuseDeclaration(id, \"a type whose name is its catalog text declares no texts and claims no kind.\");\n\t}\n\tif (spec.claimsKind === void 0) {\n\t\tif (spec.render !== void 0 && spec.nameIsCatalogText !== true) refuseDeclaration(id, \"render is allowed only together with claimsKind or nameIsCatalogText.\");\n\t\tif (spec.fromReported !== void 0) refuseDeclaration(id, \"fromReported is allowed only together with claimsKind.\");\n\t\treturn;\n\t}\n\tif (spec.texts !== void 0) refuseDeclaration(id, \"a type that claims a kind declares no texts.\");\n}\nfunction checkStoredAs(id, spec) {\n\tif (spec.storedAs === void 0) return;\n\tif (spec.texts !== void 0) refuseDeclaration(id, \"a type stored as another declares no texts; its name is the name of the type it is stored as.\");\n\tif (spec.claimsKind !== void 0) refuseDeclaration(id, \"a type stored as another claims no kind.\");\n}\nconst identity = (params) => params;\nfunction isParamsOf(schema, params) {\n\treturn schema === void 0 || !(schema(params) instanceof type.errors);\n}\nfunction checkNormalFormsWritten(type) {\n\tconst written = new Set(type.sql.texts.filter((text) => text.written === true).map((text) => placeholderSetOf(text.text)));\n\tif (written.size === 0) return;\n\tconst probes = [{}, ...type.sql.texts.map((text) => Object.fromEntries(placeholdersOf(text.text).map((name) => [name, 1])))];\n\tfor (const probe of probes) {\n\t\tif (!isParamsOf(type.params, probe)) continue;\n\t\tconst normalKeys = presentKeys(type.sql.normalize(probe));\n\t\tif (!written.has([...normalKeys].sort().join(\",\"))) refuseDeclaration(type.id, `the parameters ${formatKeys(Object.keys(probe))} have the normal form ${formatKeys(normalKeys)}, which no written text takes.`);\n\t}\n}\n/** Declare a SQL data type, refusing a declaration that breaks a rule of the module. */\nfunction sqlDataType(id, spec) {\n\tconst declaredNormalize = spec.normalize ?? identity;\n\tconst normalize = (params) => isParamsOf(spec.params, params) ? declaredNormalize(params) : params;\n\tconst { params: _untypedParams, ...declared } = dataType(id, {\n\t\t...spec,\n\t\tnormalize\n\t});\n\tconst texts = spec.texts ?? [];\n\tconst paramKeys = paramKeysOf(declared.id, spec.params);\n\tfor (const text of texts) checkText(declared.id, text, paramKeys);\n\tcheckMarks(declared.id, texts);\n\tcheckKindClaim(declared.id, spec);\n\tcheckStoredAs(declared.id, spec);\n\tconst type = {\n\t\t...declared,\n\t\t...ifDefined(\"params\", spec.params),\n\t\tsql: {\n\t\t\ttexts,\n\t\t\tclaimsKind: spec.claimsKind,\n\t\t\tstoredAs: spec.storedAs,\n\t\t\tnormalize,\n\t\t\trender: spec.render,\n\t\t\tfromReported: spec.fromReported,\n\t\t\tnameIsCatalogText: spec.nameIsCatalogText === true\n\t\t}\n\t};\n\tcheckNormalFormsWritten(type);\n\treturn type;\n}\n/** Whether the name of `type` is the text the database catalog prints, as declared by {@link SqlDataTypeSpec.nameIsCatalogText}. */\nfunction nameIsCatalogText(type) {\n\treturn type.sql.nameIsCatalogText;\n}\n/** Whether `type` is a data type a SQL column can have. `sql/expression` is the one data type no column has. */\nfunction isSqlDataType(type) {\n\treturn \"sql\" in type;\n}\nfunction presentKeys(params) {\n\treturn Object.keys(params).filter((key) => params[key] !== void 0);\n}\nfunction formatKeys(keys) {\n\treturn `[${[...keys].sort().join(\", \")}]`;\n}\n/** The parameters, when `type` accepts them; otherwise `CONTRACT.TYPE_PARAMS_INVALID` naming each parameter it refuses. */\nfunction validateSqlTypeParams(type, params) {\n\tassertDataTypeParams(type, params);\n\treturn blindCast(params);\n}\nfunction pickText(type, mark, keys) {\n\tconst candidates = type.sql.texts.filter((text) => text[mark] === true);\n\tconst wanted = [...keys].sort().join(\",\");\n\tconst found = candidates.find((text) => placeholderSetOf(text.text) === wanted);\n\tif (found !== void 0) return found;\n\tconst verb = mark === \"written\" ? \"written\" : \"reported\";\n\tconst takes = candidates.length === 0 ? `it is never ${verb}` : `it is ${verb} with ${candidates.map((text) => formatKeys(placeholdersOf(text.text))).join(\", \")}`;\n\tthrow contractError(\"CONTRACT.TYPE_PARAMS_INVALID\", `${type.id} cannot be ${verb} with parameters ${formatKeys(keys)}; ${takes}`, { meta: {\n\t\tdataType: type.id,\n\t\tparameters: [...keys]\n\t} });\n}\nfunction substitute(type, text, params) {\n\treturn (text.display ?? text.text).replace(PLACEHOLDER, (_, name) => {\n\t\tconst value = params[name];\n\t\tif (!Number.isSafeInteger(value)) throw contractError(\"CONTRACT.TYPE_PARAMS_INVALID\", `${type.id}: the parameter ${name} is written into the type name and must be an integer`, { meta: {\n\t\t\tdataType: type.id,\n\t\t\tparameters: [name]\n\t\t} });\n\t\treturn String(value);\n\t});\n}\n/**\n* The name of `type` with no parameters, for places where parameters must not appear, such as a\n* cast. A type whose name is its catalog text has none: its parameters cannot be separated from its\n* name, so it is refused.\n*/\nfunction sqlBaseName(type, params) {\n\tif (type.sql.nameIsCatalogText) throw new InternalError(`Data type ${type.id} names its type by its catalog text, so it has no base name.`);\n\tif (type.sql.render !== void 0) return type.sql.render(validateSqlTypeParams(type, params));\n\tconst fewest = type.sql.texts.filter((text) => text.written === true).reduce((best, text) => best === void 0 || placeholdersOf(text.text).length < placeholdersOf(best.text).length ? text : best, void 0);\n\tif (fewest === void 0) throw new InternalError(`Data type ${type.id} has no written text and no render, so it has no base name.`);\n\tconst name = fewest.display ?? fewest.text;\n\tif (placeholdersOf(fewest.text).length === 0) return name;\n\tconst bracket = name.indexOf(\"(\");\n\treturn bracket === -1 ? name : name.slice(0, bracket);\n}\n/**\n* The base name of `type` with `params`, unquoted, for display. It differs from {@link sqlBaseName}\n* for a type that claims a kind, where it is the `typeName` parameter as written (`app.status`)\n* while `sqlBaseName` gives the quoted name `render` writes into SQL (`\"app\".\"status\"`), and for a\n* type whose name is its catalog text, where it is that whole text.\n*/\nfunction unquotedSqlBaseName(type, params) {\n\tif (type.sql.nameIsCatalogText) return renderSqlTypeName(type, params);\n\tif (type.sql.claimsKind === void 0) return sqlBaseName(type, params);\n\tconst { typeName } = validateSqlTypeParams(type, params);\n\tif (typeof typeName !== \"string\") throw new InternalError(`Data type ${type.id} claims the kind \"${type.sql.claimsKind}\" but declares no string typeName parameter.`);\n\treturn typeName;\n}\nconst ADD_THE_CODEC_PACK = \"Add the pack that provides the codec, and so declares its data type, to the configuration: to `extensions` in prisma.config or in defineContract.\";\n/** The SQL data type the codec `codecId` represents. */\nfunction sqlDataTypeOfCodec(codecId, lookups) {\n\tconst descriptor = lookups.codecLookup.descriptorFor(codecId);\n\tif (descriptor === void 0) throw contractError(\"CONTRACT.CODEC_DESCRIPTOR_MISSING\", `No codec \"${codecId}\" is registered, so its column type cannot be named.`, {\n\t\tfix: ADD_THE_CODEC_PACK,\n\t\tmeta: { codecId }\n\t});\n\tconst type = lookups.dataTypeLookup.get(descriptor.dataType);\n\tif (type === void 0) throw contractError(\"CONTRACT.DATA_TYPE_UNREGISTERED\", `Codec \"${codecId}\" represents data type \"${descriptor.dataType}\", which no component registers.`, {\n\t\tfix: ADD_THE_CODEC_PACK,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\tdataType: descriptor.dataType\n\t\t}\n\t});\n\tif (!isSqlDataType(type)) throw new InternalError(`Data type ${type.id} is not a SQL data type, so it has no type name.`);\n\treturn type;\n}\n/** The type a column of `type` is stored as, whose name DDL writes and the database reports: `type` itself unless it names another. */\nfunction sqlStorageType(type, lookup) {\n\tif (type.sql.storedAs === void 0) return type;\n\tconst storage = lookup.get(type.sql.storedAs);\n\tif (storage === void 0 || !isSqlDataType(storage)) throw contractError(\"CONTRACT.DATA_TYPE_UNREGISTERED\", `Data type \"${type.id}\" is stored as \"${type.sql.storedAs}\", which no component registers as a SQL data type.`, { meta: {\n\t\tdataType: type.sql.storedAs,\n\t\tstoredBy: type.id\n\t} });\n\treturn storage;\n}\n/** The id of the type a column of the data type `dataTypeId` is stored as: {@link sqlStorageType} of it, which refuses a storage type the lookup does not register, or `dataTypeId` itself when the lookup does not know it as a SQL data type. */\nfunction sqlStorageTypeId(dataTypeId, lookup) {\n\tconst type = lookup.get(dataTypeId);\n\treturn type !== void 0 && isSqlDataType(type) ? sqlStorageType(type, lookup).id : dataTypeId;\n}\n/** The type a column is stored as, with its parameters in normal form, or the column's own id and parameters as written when the lookup does not know its data type as a SQL data type. */\nfunction storedColumnType(column, lookup) {\n\tconst type = lookup.get(column.dataType);\n\tif (type === void 0 || !isSqlDataType(type)) return {\n\t\tid: column.dataType,\n\t\tparams: column.typeParams ?? {}\n\t};\n\tconst storage = sqlStorageType(type, lookup);\n\treturn {\n\t\tid: storage.id,\n\t\tparams: storage.sql.normalize(dataTypeParams(storage, column.typeParams ?? {}))\n\t};\n}\n/**\n* Whether two contract columns have the same type: the types their data types are stored as are one type, those types' parameters are equal in normal form, and both or neither are lists. ADR 254.\n*/\nfunction sameSqlColumnType(a, b, lookup) {\n\tconst isList = (column) => column.many !== void 0 && column.many !== false;\n\tconst left = storedColumnType(a, lookup);\n\tconst right = storedColumnType(b, lookup);\n\treturn left.id === right.id && canonicalizeJson(left.params) === canonicalizeJson(right.params) && isList(a) === isList(b);\n}\n/** The type a column of the codec `codecId` is stored as: {@link sqlStorageType} of the data type it represents. */\nfunction sqlStorageTypeOfCodec(codecId, lookups) {\n\treturn sqlStorageType(sqlDataTypeOfCodec(codecId, lookups), lookups.dataTypeLookup);\n}\n/** {@link unquotedSqlBaseName} of the type a column of the codec `codecId` is stored as. */\nfunction unquotedSqlBaseNameOfCodec(codecId, typeParams, lookups) {\n\tconst type = sqlStorageTypeOfCodec(codecId, lookups);\n\treturn unquotedSqlBaseName(type, dataTypeParams(type, typeParams));\n}\n/** The text a migration writes for `type` with the raw `params`. */\nfunction renderSqlTypeName(type, params) {\n\tconst validated = validateSqlTypeParams(type, params);\n\tif (type.sql.render !== void 0) return type.sql.render(validated);\n\tconst normalized = type.sql.normalize(validated);\n\treturn substitute(type, pickText(type, \"written\", presentKeys(params).filter((key) => Object.hasOwn(normalized, key))), params);\n}\n/** The text the database catalog prints for `type` with `params`, in their normal form. */\nfunction renderSqlCatalogText(type, params) {\n\tconst validated = validateSqlTypeParams(type, params);\n\tif (type.sql.claimsKind !== void 0) throw new InternalError(`Data type ${type.id} claims the kind \"${type.sql.claimsKind}\" and has no catalog text.`);\n\tif (type.sql.render !== void 0) return type.sql.render(validated);\n\tconst normalized = type.sql.normalize(validated);\n\treturn substitute(type, pickText(type, \"catalog\", presentKeys(normalized)), normalized);\n}\nfunction prepareReportedText(text) {\n\tlet prepared = \"\";\n\tlet quoted = false;\n\tlet spacePending = false;\n\tfor (const character of text.trim()) {\n\t\tif (!quoted && /\\s/.test(character)) {\n\t\t\tspacePending = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (spacePending && !/[(,]$/.test(prepared) && character !== \")\") prepared += \" \";\n\t\tspacePending = false;\n\t\tif (character === \"\\\"\") quoted = !quoted;\n\t\tprepared += quoted ? character : character.toLowerCase();\n\t}\n\treturn prepared;\n}\nfunction claims(text) {\n\treturn text.catalog === true || text.written !== true;\n}\nfunction claimingTexts(type) {\n\treturn type.sql.texts.filter(claims).map((text) => text.text);\n}\nfunction textsCollide(a, b) {\n\tconst withOnes = (text) => text.replace(PLACEHOLDER, \"1\");\n\treturn patternOf(a).test(withOnes(b)) || patternOf(b).test(withOnes(a));\n}\nfunction collisionBetween(first, second) {\n\tconst kind = first.sql.claimsKind;\n\tif (kind !== void 0 && kind === second.sql.claimsKind) return {\n\t\tby: \"kind\",\n\t\tkind\n\t};\n\tfor (const a of claimingTexts(first)) {\n\t\tconst b = claimingTexts(second).find((text) => textsCollide(a, text));\n\t\tif (b !== void 0) return {\n\t\t\tby: \"text\",\n\t\t\tfirst: a,\n\t\t\tsecond: b\n\t\t};\n\t}\n}\n/**\n* The first two SQL data types in `types` that would both recognise one reported type: a claiming\n* text of each collides, or both claim the same kind. Two texts collide when either one's pattern\n* matches the other with each placeholder written as 1.\n*/\nfunction findSqlDataTypeCollision(types) {\n\tconst sqlTypes = types.filter(isSqlDataType);\n\tfor (const [index, first] of sqlTypes.entries()) for (const second of sqlTypes.slice(index + 1)) {\n\t\tconst claims = collisionBetween(first, second);\n\t\tif (claims !== void 0) return {\n\t\t\tfirst,\n\t\t\tsecond,\n\t\t\tclaims\n\t\t};\n\t}\n}\n/**\n* The data type that claims a reported type, with its parameters in normal form, or undefined when\n* no type in `dataTypes` claims it or its parameters fail the type's schema.\n*/\nfunction resolveReportedSqlType(reported, dataTypes) {\n\tconst sqlTypes = dataTypes.filter(isSqlDataType);\n\tif (reported.kind !== void 0) {\n\t\tconst claimant = sqlTypes.find((type) => type.sql.claimsKind === reported.kind);\n\t\tif (claimant === void 0) return void 0;\n\t\treturn resolvedWith(claimant, claimant.sql.fromReported?.(reported) ?? {});\n\t}\n\tconst text = prepareReportedText(reported.text);\n\tfor (const type of sqlTypes) for (const candidate of type.sql.texts) {\n\t\tif (!claims(candidate)) continue;\n\t\tconst params = paramsMatching(type, candidate, text);\n\t\tif (params !== void 0) return resolvedWith(type, params);\n\t}\n}\nconst signedParamKeysByType = /* @__PURE__ */ new WeakMap();\n/** The parameters of `type` that may be negative, whose placeholders read a leading minus. */\nfunction signedParamKeys(type) {\n\tconst known = signedParamKeysByType.get(type);\n\tif (known !== void 0) return known;\n\tconst keys = schemaKeysAllowing(type.params, -1) ?? [];\n\tsignedParamKeysByType.set(type, keys);\n\treturn keys;\n}\nfunction paramsMatching(type, candidate, text) {\n\tconst match = patternOf(candidate.text, signedParamKeys(type)).exec(text);\n\tif (match === null) return void 0;\n\treturn Object.fromEntries(placeholdersOf(candidate.text).map((name, index) => [name, Number.parseInt(match[index + 1] ?? \"\", 10)]));\n}\n/**\n* Every data type in `dataTypes` that reads `text` as a migration may write it, with its parameters\n* in normal form: any of a type's texts counts, whether written, printed by the catalog or only\n* claimed. Empty when no type reads it or its parameters fail the type's schema. A type that claims\n* a kind has no texts, so it never reads one.\n*/\nfunction resolveWrittenSqlTypes(text, dataTypes) {\n\tconst prepared = prepareReportedText(text);\n\treturn dataTypes.filter(isSqlDataType).flatMap((type) => {\n\t\tfor (const candidate of type.sql.texts) {\n\t\t\tconst params = paramsMatching(type, candidate, prepared);\n\t\t\tif (params === void 0) continue;\n\t\t\tconst resolved = resolvedWith(type, params);\n\t\t\tif (resolved !== void 0) return [resolved];\n\t\t}\n\t\treturn [];\n\t});\n}\nfunction resolvedWith(type$1, params) {\n\tif (type$1.params !== void 0 && type$1.params(params) instanceof type.errors) return void 0;\n\treturn {\n\t\tdataType: type$1,\n\t\ttypeParams: type$1.sql.normalize(params)\n\t};\n}\n//#endregion\nexport { validateSqlTypeParams as _, renderSqlTypeName as a, sameSqlColumnType as c, sqlDataTypeOfCodec as d, sqlStorageType as f, unquotedSqlBaseNameOfCodec as g, unquotedSqlBaseName as h, renderSqlCatalogText as i, sqlBaseName as l, sqlStorageTypeOfCodec as m, isSqlDataType as n, resolveReportedSqlType as o, sqlStorageTypeId as p, nameIsCatalogText as r, resolveWrittenSqlTypes as s, findSqlDataTypeCollision as t, sqlDataType as u };\n\n//# sourceMappingURL=sql-data-type-D5cI3M07.mjs.map"],"mappings":";;;;;;;;AAQA,MAAM,cAAc;AACpB,MAAM,qBAAqB;AAC3B,MAAM,iBAAiB;AACvB,SAAS,YAAY,IAAI,QAAQ;CAChC,IAAI,WAAW,KAAK,GAAG,OAAO,CAAC;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,OAAO,IAAI,UAAU,MAAM;CACxC;AACD"}
@@ -3,7 +3,7 @@ import { l as SqlStatementStats } from "./driver-types-DRsYeq3j-X_D6hNMZ.mjs";
3
3
  import { n as SqlQueryPlan } from "./plan-Cbed2eDu-3c5s1Aq5.mjs";
4
4
  import { a as CodecValue, i as CodecTypesBase, o as Expression, t as AffectedCount } from "./expression-BzrfOiPC-CXjjRKqc.mjs";
5
5
  import "./expression-CIBqCwC1.mjs";
6
- import "./ast-Cq7uhA86.mjs";
6
+ import "./ast-DB7g9Mh2.mjs";
7
7
  import "./plan-BOyVvttx.mjs";
8
8
  import { h as RuntimeScope } from "./types-Cv5t6_Ly-BaGc023t.mjs";
9
9
  import "./types-VUCzaDbp.mjs";
@@ -112,4 +112,4 @@ interface TransactionStartTarget {
112
112
  declare function createTransactionStart(): TransactionStart;
113
113
  //#endregion
114
114
  export { transactionStart as S, createTransactionStart as _, ParamSpec as a, settlementOf as b, PreparedExecution as c, PreparedStatementExecuteTarget as d, PreparedStatementQueryTarget as f, TransactionStartTarget as g, TransactionStart as h, DeclaredNullable as i, PreparedFor as l, TransactionSettlementState as m, Declaration as n, ParamsFromDeclaration as o, SettledTransactionTarget as p, DeclaredCodecId as r, PrepareCallback as s, BindSiteParams as t, PreparedStatement as u, preparedStatementExecute as v, transactionSettlement as x, preparedStatementQuery as y };
115
- //# sourceMappingURL=transaction-state-DR3nKTmH-DbyhuL-z.d.mts.map
115
+ //# sourceMappingURL=transaction-state-DR3nKTmH-D_pb9QgR.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-state-DR3nKTmH-DbyhuL-z.d.mts","names":[],"sources":["../../../../2-sql/5-runtime/dist/transaction-state-DR3nKTmH.d.mts"],"mappings":";;;;;;;;;;;;;KAOK,UAAU,WAAW,iBAAiB,yBAAyB;WACzD,eAAe;WACf,aAAa;WACb;;KAEN,YAAY,WAAW,iBAAiB,kBAAkB,SAAS,eAAe,UAAU;KAC5F,gBAAgB,KAAK,mBAAmB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iD6BqoN-ZF53hwPp.mjs";
@@ -3,7 +3,7 @@ import { IRNodeBase } from "@prisma/orm-framework/components/ir";
3
3
  import { CodecRef, DataType, DataTypeParams, DataTypeValue } from "@prisma/orm-framework/components/codec";
4
4
  import { ColumnDefault } from "@prisma/orm-framework/contract/types";
5
5
  import { DiffSubjectGranularity, DiffableNode, MismatchExplanation, SchemaNodeRef } from "@prisma/orm-framework/components/control";
6
- //#region ../../../2-sql/1-core/schema-ir/dist/types-B3AHHPDh.d.mts
6
+ //#region ../../../2-sql/1-core/schema-ir/dist/types-DiD6BqoN.d.mts
7
7
  //#region src/ir/sql-schema-ir-node.d.ts
8
8
  /**
9
9
  * SQL Schema IR node base. Carries the family-level
@@ -351,6 +351,10 @@ interface SqlColumnIRInput {
351
351
  readonly sqlExpressionLiteralFor?: SqlExpressionLiteralFor;
352
352
  /** The element type as the database reports it. Set by introspection; absent on contract-derived nodes. */
353
353
  readonly reportedType?: ReportedSqlType;
354
+ /**
355
+ * The element type exactly as the database catalog prints it, on a contract-derived column whose data type's name is its catalog text (ADR 273). Such a column's type is compared by this text, not by {@link storedType}: see {@link sqlColumnTypesEqual}.
356
+ */
357
+ readonly catalogText?: string;
354
358
  }
355
359
  /**
356
360
  * Schema IR node for a single column on a table, as observed by
@@ -393,6 +397,8 @@ declare class SqlColumnIR extends SqlSchemaIRNode implements DiffableNode {
393
397
  readonly sqlExpressionLiteralFor?: SqlExpressionLiteralFor;
394
398
  /** See {@link SqlColumnIRInput.reportedType}. Non-enumerable, same reason as {@link codecRef}. */
395
399
  readonly reportedType?: ReportedSqlType;
400
+ /** See {@link SqlColumnIRInput.catalogText}. Non-enumerable, same reason as {@link codecRef}. */
401
+ readonly catalogText?: string;
396
402
  constructor(input: SqlColumnIRInput);
397
403
  get id(): string;
398
404
  /**
@@ -413,9 +419,11 @@ declare class SqlColumnIR extends SqlSchemaIRNode implements DiffableNode {
413
419
  explainMismatch(actual: DiffableNode | undefined): MismatchExplanation | undefined;
414
420
  }
415
421
  /** The parts of a column that make its type. */
416
- type SqlColumnType = Pick<SqlColumnIR, 'storedType' | 'storedTypeParams' | 'many'>;
422
+ type SqlColumnType = Pick<SqlColumnIR, 'storedType' | 'storedTypeParams' | 'many' | 'catalogText' | 'reportedType'>;
417
423
  /**
418
424
  * Whether two columns have the same type: both have a stored type, the two are one data type, their parameters are equal as canonical JSON, and both or neither are lists. A column no data type claims has no stored type and never has the same type as another. ADR 254.
425
+ *
426
+ * When either column carries a {@link SqlColumnIR.catalogText}, the two compare by text instead, exactly, with `[]` for a list: that text against the other column's catalog text or reported text. ADR 273.
419
427
  */
420
428
  declare function sqlColumnTypesEqual(a: SqlColumnType, b: SqlColumnType): boolean;
421
429
  //#endregion
@@ -739,4 +747,4 @@ declare class SqlSchemaIR extends SqlSchemaIRNode implements DiffableNode {
739
747
  }
740
748
  //#endregion
741
749
  export { relationalNodeGranularity as A, SqlTableIR as C, assertNode as D, SqlUniqueIRInput as E, sqlDefaultValuesEqual as M, defineNonEnumerable as O, SqlSchemaIRNode as S, SqlUniqueIR as T, SqlIndexIR as _, SqlAnnotations as a, SqlSchemaIR as b, SqlColumnDefaultIR as c, SqlColumnIRInput as d, SqlColumnType as f, SqlForeignKeyIRInput as g, SqlForeignKeyIR as h, ReportedSqlType as i, sqlColumnTypesEqual as j, relationalNodeEntityKind as k, SqlColumnDefaultIRInput as l, SqlExpressionLiteralFor as m, PrimaryKeyInput as n, SqlCheckConstraintIR as o, SqlDefaultValue as p, RelationalSchemaNodeKind as r, SqlCheckConstraintIRInput as s, PrimaryKey as t, SqlColumnIR as u, SqlIndexIRInput as v, SqlTableIRInput as w, SqlSchemaIRInput as x, SqlReferentialAction as y };
742
- //# sourceMappingURL=types-B3AHHPDh-BHh-89fY.d.mts.map
750
+ //# sourceMappingURL=types-DiD6BqoN-ZF53hwPp.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-DiD6BqoN-ZF53hwPp.d.mts","names":[],"sources":["../../../../2-sql/1-core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AA2B;WAClD;WACA,QAAQ,SAAS,eAAe;WAChC,cAAc;EACvB,YAAY,OAAO;MACf;EACJ,UAAU,OAAO;EACjB,qBAAqB"}
@@ -3,15 +3,15 @@ import { f as StorageTypeInstance, l as SqlStorage } from "./sql-storage-tZhB8nS
3
3
  import { j as SqlControlDriverInstance } from "./types-Dqf87mfA-BOElvimQ.mjs";
4
4
  import "./types-B2Dee96w.mjs";
5
5
  import { r as SqlOperationDescriptors } from "./index-BRFLss5v.mjs";
6
- import { S as SqlSchemaIRNode } from "./types-B3AHHPDh-BHh-89fY.mjs";
7
- import "./types-BGERR8XF.mjs";
8
- import { r as SqlControlAdapter } from "./control-adapter-BCopdpsT-BPHa2Frw.mjs";
6
+ import { S as SqlSchemaIRNode } from "./types-DiD6BqoN-ZF53hwPp.mjs";
7
+ import "./types-D_nlUp-1.mjs";
8
+ import { r as SqlControlAdapter } from "./control-adapter-Bn0uhplA-BnsQY8_q.mjs";
9
9
  import { Contract } from "@prisma/orm-framework/contract/types";
10
10
  import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
11
11
  import { Result } from "@prisma/orm-framework/utils/result";
12
12
  import { ContractSpace, ControlAdapterDescriptor, ControlExtensionDescriptor, MigrationOperationPolicy, MigrationPlan, MigrationPlanOperation, MigrationPlannerConflict, MigrationPlannerFailureResult, MigrationPlannerSuccessResult, MigrationRunnerExecutionChecks, MigrationRunnerFailure, MigrationRunnerPerSpaceSuccessValue, MigrationRunnerResult, OpFactoryCall, OperationContext, PlanOrigin, ResolvedMigrationStatement, SchemaDiffIssue, SchemaOwnership } from "@prisma/orm-framework/components/control";
13
13
  import { AggregateMigrationEdgeRef } from "@prisma/orm-toolchain/migration-tools/aggregate";
14
- //#region ../../../2-sql/9-family/dist/types-DKU4GeqD.d.mts
14
+ //#region ../../../2-sql/9-family/dist/types-DlFdMaDJ.d.mts
15
15
  //#region src/core/migrations/types.d.ts
16
16
  type AnyRecord = Readonly<Record<string, unknown>>;
17
17
  interface StorageTypePlanResult<TTargetDetails> {
@@ -408,4 +408,4 @@ interface CreateSqlMigrationPlanOptions<TTargetDetails> {
408
408
  }
409
409
  //#endregion
410
410
  export { StorageTypePlanResult as A, SqlPlanTargetDetails as C, SqlPlannerFailureResult as D, SqlPlannerConflictLocation as E, SqlPlannerResult as O, SqlMigrationRunnerSuccessValue as S, SqlPlannerConflictKind as T, SqlMigrationRunnerErrorCode as _, FieldEventContext as a, SqlMigrationRunnerFailure as b, SqlControlExtensionDescriptor as c, SqlMigrationPlanOperation as d, SqlMigrationPlanOperationStep as f, SqlMigrationRunner as g, SqlMigrationPlannerPlanOptions as h, FieldEvent as i, SqlPlannerSuccessResult as k, SqlMigrationPlan as l, SqlMigrationPlanner as m, CodecControlHooks as n, ResolveIdentityValueInput as o, SqlMigrationPlanOperationTarget as p, CreateSqlMigrationPlanOptions as r, SqlControlAdapterDescriptor as s, AnyRecord as t, SqlMigrationPlanContractInfo as u, SqlMigrationRunnerExecuteCallbacks as v, SqlPlannerConflict as w, SqlMigrationRunnerResult as x, SqlMigrationRunnerExecuteOptions as y };
411
- //# sourceMappingURL=types-DKU4GeqD-CUClXCme.d.mts.map
411
+ //# sourceMappingURL=types-DlFdMaDJ-BEDwj-Qv.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-DKU4GeqD-CUClXCme.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/types-DKU4GeqD.d.mts"],"mappings":";;;;;;;;;;;;;;;KAUK,YAAY,SAAS;UAChB,sBAAsB;WACrB,qBAAqB,0BAA0B;;;;;;;;;UAShD;;WAEC;WACA;WACA,aAAa;;;;;;;;;;;;;;;;KAgBnB;;;;;;;;;;;;;UAaK;WACC;WACA;WACA;WACA,aAAa;WACb,WAAW;WACX,aAAa;WACb,WAAW;;UAEZ,kBAAkB;;;;;;;;;EAS1B,sBAAsB;aACX;aACA,cAAc;aACd,UAAU,SAAS;aACnB,QAAQ;aACR;aACA,QAAQ;QACb,sBAAsB;EAC5B,cAA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C,UAAU;;;;;WAKV,kBAAkB;;;;;;;WAOlB,qBAAqB,cAAc;;;;;WAKnC,yBAAyB;;KAE/B;UACK,kCAAkC;WACjC,MAAM;WACN,OAAO;;UAER,uCAAuC;KAC5C,2BAA2B,OAAO,gCAAgC;UAC7D,mBAAmB;;;;;;;;;;;;;;EAc3B,QAAQ;aACG,QAAQ;aACR,iBAAiB,cAAc,iCAAiC;MACvE,QAAQ;;;;;;;;;;;EAWZ,oBAAoB,SAAS,iCAAiC,kBAAkB,QAAQ;;UAEhF,8BAA8B;WAC7B;;;;WAIA;WACA,SAAS;WACT,aAAa;WACb,qBAAqB,0BAA0B;;;;;;WAM/C;WACA,OAAO"}
@@ -7,7 +7,7 @@ import { blindCast } from "@prisma/orm-framework/utils/casts";
7
7
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
8
8
  import { canonicalStringify } from "@prisma/orm-framework/utils/canonical-stringify";
9
9
  import { isArrayEqual } from "@prisma/orm-framework/utils/array-equal";
10
- //#region ../../../2-sql/1-core/schema-ir/dist/types-egs_vme1.mjs
10
+ //#region ../../../2-sql/1-core/schema-ir/dist/types-DoyiTsjg.mjs
11
11
  /**
12
12
  * The `nodeKind` discriminant for each relational schema-diff leaf node.
13
13
  * Each node carries a unique value; the differ pairs siblings by `id`, and
@@ -392,6 +392,7 @@ var SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {
392
392
  defineNonEnumerable(this, "defaultExpressionValue", input.defaultExpressionValue);
393
393
  defineNonEnumerable(this, "sqlExpressionLiteralFor", input.sqlExpressionLiteralFor);
394
394
  defineNonEnumerable(this, "reportedType", input.reportedType);
395
+ defineNonEnumerable(this, "catalogText", input.catalogText);
395
396
  freezeNode(this);
396
397
  }
397
398
  get id() {
@@ -441,6 +442,8 @@ var SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {
441
442
  if (actual === void 0) return void 0;
442
443
  const node = blindCast(actual);
443
444
  assertNode(node, "SqlColumnIR", SqlColumnIR.is);
445
+ const texts = catalogTexts(this, node);
446
+ if (texts !== void 0 && texts.expected !== texts.actual) return differs(`The column type is "${texts.expected}", but the database reports "${texts.actual}". A type named by its catalog text is compared with the text the database reports, exactly.`);
444
447
  if (node.storedType === void 0 && node.reportedType !== void 0) return differs(node.typeText === "" ? "The database column has no declared type." : `The database column is ${shownTypeOf(node)}, which no data type in the configured stack declares.`);
445
448
  if (!sqlColumnTypesEqual(this, node)) return differs(`The contract column is ${shownTypeOf(this)} and the database column is ${shownTypeOf(node)}.`);
446
449
  if (this.nullable !== node.nullable) return differs(`The contract column is ${nullability(this)} and the database column is ${nullability(node)}.`);
@@ -448,10 +451,27 @@ var SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {
448
451
  };
449
452
  /**
450
453
  * Whether two columns have the same type: both have a stored type, the two are one data type, their parameters are equal as canonical JSON, and both or neither are lists. A column no data type claims has no stored type and never has the same type as another. ADR 254.
454
+ *
455
+ * When either column carries a {@link SqlColumnIR.catalogText}, the two compare by text instead, exactly, with `[]` for a list: that text against the other column's catalog text or reported text. ADR 273.
451
456
  */
452
457
  function sqlColumnTypesEqual(a, b) {
458
+ const texts = catalogTexts(a, b);
459
+ if (texts !== void 0) return texts.expected === texts.actual;
453
460
  return a.storedType !== void 0 && b.storedType !== void 0 && a.storedType.id === b.storedType.id && canonicalizeJson(a.storedTypeParams ?? {}) === canonicalizeJson(b.storedTypeParams ?? {}) && Boolean(a.many) === Boolean(b.many);
454
461
  }
462
+ /** The text a column's type compares by, with `[]` for a list, when it has one: its catalog text, or the text the database reports. */
463
+ function comparedText(column) {
464
+ const text = column.catalogText ?? column.reportedType?.text;
465
+ return text === void 0 ? void 0 : `${text}${column.many === true ? "[]" : ""}`;
466
+ }
467
+ /** The two texts a pair of columns compares by, when either carries a catalog text. A side with no text to compare gives the empty text, which no catalog text equals. */
468
+ function catalogTexts(expected, actual) {
469
+ if (expected.catalogText === void 0 && actual.catalogText === void 0) return void 0;
470
+ return {
471
+ expected: comparedText(expected) ?? "",
472
+ actual: comparedText(actual) ?? ""
473
+ };
474
+ }
455
475
  /** The column's type as the contract writes it, or as introspection gives it, with `[]` for a list, in double quotes unless the text has double quotes of its own, as `"char"` does. */
456
476
  function shownTypeOf(column) {
457
477
  const text = `${column.typeText}${column.many === true ? "[]" : ""}`;
@@ -798,4 +818,4 @@ var SqlSchemaIR = class extends SqlSchemaIRNode {
798
818
  //#endregion
799
819
  export { sqlDefaultValuesEqual as _, SqlColumnIR as a, SqlSchemaIR as c, SqlUniqueIR as d, assertNode as f, sqlColumnTypesEqual as g, relationalNodeGranularity as h, SqlColumnDefaultIR as i, SqlSchemaIRNode as l, relationalNodeEntityKind as m, RelationalSchemaNodeKind as n, SqlForeignKeyIR as o, defineNonEnumerable as p, SqlCheckConstraintIR as r, SqlIndexIR as s, PrimaryKey as t, SqlTableIR as u };
800
820
 
801
- //# sourceMappingURL=types-egs_vme1-DRhYFwIT.mjs.map
821
+ //# sourceMappingURL=types-DoyiTsjg-DDTmYyNY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-DoyiTsjg-DDTmYyNY.mjs","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/types-DoyiTsjg.mjs"],"sourcesContent":["import { f as normalizeIndexOptionValue, l as nameOf } from \"./naming-bM5qm5PY.mjs\";\nimport { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { dataTypeValuesEqual } from \"@internal/framework-components/codec\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isArrayEqual } from \"@internal/utils/array-equal\";\n//#region src/ir/schema-node-kinds.ts\n/**\n* The `nodeKind` discriminant for each relational schema-diff leaf node.\n* Each node carries a unique value; the differ pairs siblings by `id`, and\n* these kinds distinguish the node types that appear as `PostgresTableSchemaNode`\n* children (columns, primary key, foreign keys, uniques, indexes, checks) from\n* each other and from the RLS policy/role kinds a target defines separately.\n*/\nconst RelationalSchemaNodeKind = {\n\tschema: \"sql-schema\",\n\ttable: \"sql-table\",\n\tcolumn: \"sql-column\",\n\tcolumnDefault: \"sql-column-default\",\n\tprimaryKey: \"sql-primary-key\",\n\tforeignKey: \"sql-foreign-key\",\n\tunique: \"sql-unique\",\n\tindex: \"sql-index\",\n\tcheck: \"sql-check-constraint\"\n};\n/**\n* The one real map from a relational `nodeKind` to the framework-neutral\n* {@link DiffSubjectGranularity} its diff issues carry — the SQL family's\n* post-diff filters (issue category, strict-mode gating) and the framework\n* aggregate's unclaimed-elements sweep key on the granularity, never on the\n* `nodeKind` spelling and never on anything stamped on the node. Resolution\n* is by `nodeKind` equality against this map, not a suffix string match.\n* Target-specific node kinds (Postgres namespace/table/policy/role) are\n* outside this family layer's vocabulary and map their own kinds directly.\n*/\nconst RELATIONAL_NODE_GRANULARITY = {\n\t[RelationalSchemaNodeKind.schema]: \"structural\",\n\t[RelationalSchemaNodeKind.table]: \"entity\",\n\t[RelationalSchemaNodeKind.column]: \"field\",\n\t[RelationalSchemaNodeKind.columnDefault]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.primaryKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.foreignKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.unique]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.index]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.check]: \"auxiliary\"\n};\nfunction isRelationalSchemaNodeKind(nodeKind) {\n\treturn Object.hasOwn(RELATIONAL_NODE_GRANULARITY, nodeKind);\n}\n/**\n* Looks up the subject granularity for a relational `nodeKind`. Throws for a\n* `nodeKind` outside this map (a target-specific kind, e.g. Postgres's\n* namespace/table/policy/role) — those map their own kinds directly rather\n* than through this family-level map.\n*/\nfunction relationalNodeGranularity(nodeKind) {\n\tif (!isRelationalSchemaNodeKind(nodeKind)) throw new InternalError(`relationalNodeGranularity: unrecognized relational node kind \"${nodeKind}\"`);\n\treturn RELATIONAL_NODE_GRANULARITY[nodeKind];\n}\n/**\n* The one real map from a relational `nodeKind` to its storage `entityKind`\n* — the same vocabulary the contract storage's `entries` dictionary keys use\n* (`elementCoordinates` walks it). Only the whole-table kind has an entity of\n* its own; every other relational node (a column, an index, …) is nested\n* under one and maps to nothing here.\n*/\nconst RELATIONAL_NODE_ENTITY_KIND = { [RelationalSchemaNodeKind.table]: \"table\" };\n/**\n* Looks up the storage `entityKind` for a relational `nodeKind` — sibling of\n* {@link relationalNodeGranularity}, resolved by `nodeKind` equality against\n* {@link RELATIONAL_NODE_ENTITY_KIND}. `undefined` for a target-specific kind\n* (targets map their own kinds directly) or a relational kind with no entity\n* of its own.\n*/\nfunction relationalNodeEntityKind(nodeKind) {\n\treturn isRelationalSchemaNodeKind(nodeKind) ? RELATIONAL_NODE_ENTITY_KIND[nodeKind] : void 0;\n}\n//#endregion\n//#region src/ir/sql-schema-ir-node.ts\n/**\n* SQL Schema IR node base. Carries the family-level\n* `kind = 'sql-schema-ir'` discriminator and inherits the framework's\n* `freezeNode` affordance.\n*\n* SQL Schema IR represents the actual database state as discovered by\n* introspection (the parallel to SQL Contract IR, which represents the\n* desired state).\n*\n* The discriminator is installed as a non-enumerable own property,\n* matching the SqlNode pattern. This keeps `JSON.stringify(node)`\n* canonical (no `kind` field), keeps `toEqual({...})` test assertions\n* against pre-lift flat shapes passing, and keeps `node.kind` readable\n* for dispatch.\n*\n* Both `kind` and `nodeKind` are required: every concrete leaf is a node\n* the generic differ can pair and compare, so every leaf must declare which\n* node it is. `nodeKind` has no default here — every direct subclass sets its\n* own literal value (the relational leaves via `RelationalSchemaNodeKind`,\n* target concretions via their own vocabulary, e.g. `PostgresSchemaNodeKind`).\n*/\nvar SqlSchemaIRNode = class extends IRNodeBase {\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql-schema-ir\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: false\n\t\t});\n\t}\n};\n/**\n* Asserts `node` matches `predicate`, narrowing its type to `T`. The one\n* shared implementation every node class's `static assert` and `isEqualTo`\n* reach for, instead of each hand-writing its own throw: the message names\n* the class the caller expected.\n*/\nfunction assertNode(node, className, predicate) {\n\tif (node === void 0 || !predicate(node)) throw new InternalError(`Expected a ${className} but got nodeKind=${node?.nodeKind ?? \"undefined\"}`);\n}\n/**\n* Defines a non-enumerable own property, the same treatment `kind` gets\n* above: a derivation-time render-support field stays out of\n* `JSON.stringify`, `toEqual({...})` structural assertions, and spreads,\n* while remaining directly readable (`node.field`) for the one consumer\n* that resolves it at plan time. A no-op when `value` is `undefined` — the\n* property is simply absent, matching every other optional field on these\n* nodes.\n*/\nfunction defineNonEnumerable(target, key, value) {\n\tif (value === void 0) return;\n\tObject.defineProperty(target, key, {\n\t\tvalue,\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tconfigurable: false\n\t});\n}\n//#endregion\n//#region src/ir/primary-key.ts\n/**\n* Primary-key Schema IR node. Mirrors the Contract IR `PrimaryKey`\n* shape (same `columns` + optional `name`) so verification can compare\n* intent and actual structurally. Defined here independently to avoid\n* a sql-schema-ir -> sql-contract dependency.\n*\n* Implements `DiffableNode` so a primary key is directly a table's diff-tree\n* child. `id` is a fixed sentinel — a table has at most one primary key, so\n* there is never a sibling to disambiguate against. `isEqualTo` compares the\n* column tuple; the PK's own `name` is a database-assigned label with no\n* semantic weight, so it is not compared (mirrors the policy node's\n* name-insensitivity to non-identifying detail).\n*/\nvar PrimaryKey = class PrimaryKey extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.primaryKey;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"primary-key\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof PrimaryKey ? value : new PrimaryKey(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.primaryKey;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"PrimaryKey\", PrimaryKey.is);\n\t\treturn this.columns.length === node.columns.length && this.columns.every((c, i) => c === node.columns[i]);\n\t}\n};\n//#endregion\n//#region src/ir/sql-check-constraint-ir.ts\n/**\n* Schema IR node for a table-level check constraint, carried as an opaque\n* predicate. The expression is never parsed — a database reprints predicates\n* in its own normalized form, so any structured reading of it would drift.\n*\n* Implements `DiffableNode` so a check is directly a table's diff-tree child;\n* `id` is `check:<name>`. `isEqualTo` is mode-selected by the receiver's\n* `prefix` (the differ always calls `expected.isEqualTo(actual)`): a\n* wire-named receiver compares ids only — the wire name's hash already\n* commits to the predicate — while an exact-named receiver byte-compares the\n* expression, which is reliable precisely when both sides came from the same\n* reprint.\n*/\nvar SqlCheckConstraintIR = class SqlCheckConstraintIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.check;\n\tname;\n\texpression;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = nameOf(input.naming);\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.expression = input.expression;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `check:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlCheckConstraintIR ? value : new SqlCheckConstraintIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.check;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlCheckConstraintIR\", SqlCheckConstraintIR.is);\n\t\tif (this.prefix !== void 0) return this.id === node.id;\n\t\treturn this.expression === node.expression;\n\t}\n};\n//#endregion\n//#region src/ir/sql-default-value.ts\nfunction isList(value) {\n\treturn Array.isArray(value);\n}\n/** Whether two defaults are one value: the same type, parameters and value, element by element for a list. */\nfunction sqlDefaultValuesEqual(a, b) {\n\tif (!isList(a) || !isList(b)) return !isList(a) && !isList(b) && dataTypeValuesEqual(a, b);\n\treturn a.length === b.length && a.every((element, index) => {\n\t\tconst other = b[index];\n\t\tif (element === null || other === null || other === void 0) return element === other;\n\t\treturn dataTypeValuesEqual(element, other);\n\t});\n}\n//#endregion\n//#region src/ir/sql-column-default-ir.ts\n/**\n* Schema-diff node for a column's default value. The default is the one\n* column attribute with an extra/missing/drift lifecycle of its own, so it\n* is a child node of the column rather than a compared attribute: an\n* undeclared live default surfaces as `not-expected`, a declared default the\n* database lacks as `not-found`, and a divergent value as `not-equal` — the\n* three reasons cover the legacy `extra_default` / `default_missing` /\n* `default_mismatch` vocabulary with no attribute inspection.\n*\n* `id` is a fixed sentinel — a column has at most one default. Built\n* transiently by `SqlColumnIR.children()` from the column's own fields;\n* never constructed by derivation or introspection directly.\n*/\nvar SqlColumnDefaultIR = class SqlColumnDefaultIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.columnDefault;\n\tconstructor(input) {\n\t\tsuper();\n\t\tif (input.resolved !== void 0) this.resolved = input.resolved;\n\t\tif (input.raw !== void 0) this.raw = input.raw;\n\t\tdefineNonEnumerable(this, \"authored\", input.authored);\n\t\tdefineNonEnumerable(this, \"value\", input.value);\n\t\tdefineNonEnumerable(this, \"unreadable\", input.unreadable);\n\t\tdefineNonEnumerable(this, \"expressionValue\", input.expressionValue);\n\t\tdefineNonEnumerable(this, \"many\", input.many);\n\t\tdefineNonEnumerable(this, \"codecRef\", input.codecRef);\n\t\tdefineNonEnumerable(this, \"sqlExpressionLiteralFor\", input.sqlExpressionLiteralFor);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"default\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.columnDefault;\n\t}\n\t/**\n\t* Compares with `this` as the expected side. Two literals compare as values of the column's type\n\t* when both sides hold one, and as canonical JSON otherwise; a `Date` the column's codec could not\n\t* read into a value equals nothing. Two expressions compare as text, with\n\t* case and whitespace ignored outside quotes. An expected expression that writes a literal, read by\n\t* the column's codec during introspection, matches a reported literal when the two values are\n\t* equal; when the codec could not read one of them, it compares with the reported text. A resolved\n\t* side against a raw-only side is a mismatch; two raw-only nodes compare their text.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnDefaultIR\", SqlColumnDefaultIR.is);\n\t\tconst expected = this.resolved;\n\t\tconst actual = node.resolved;\n\t\tif (expected?.kind === \"function\" && actual === void 0) return node.raw !== void 0 && sameExpression(expected.expression, node.raw);\n\t\tif (expected === void 0 || actual === void 0) return expected === actual && this.raw === node.raw;\n\t\tif (expected.kind === \"function\") {\n\t\t\tif (actual.kind === \"function\") return sameExpression(expected.expression, actual.expression);\n\t\t\tif (node.value !== void 0 && node.expressionValue !== void 0) return sqlDefaultValuesEqual(node.expressionValue, node.value);\n\t\t\treturn node.raw !== void 0 && sameExpression(expected.expression, node.raw);\n\t\t}\n\t\tif (actual.kind !== \"literal\") return false;\n\t\tif (this.value !== void 0 && node.value !== void 0) return sqlDefaultValuesEqual(this.value, node.value);\n\t\tif (expected.value instanceof Date || actual.value instanceof Date) return false;\n\t\treturn canonicalStringify(expected.value) === canonicalStringify(actual.value);\n\t}\n\t/**\n\t* For two default expressions, the text the database reads back, since it may store an expression\n\t* in a form of its own. Otherwise why the column's codec could not read the database's default, or\n\t* the value each side holds.\n\t*/\n\texplainMismatch(actual) {\n\t\tif (!(actual instanceof SqlColumnDefaultIR)) return void 0;\n\t\tif (actual.unreadable !== void 0) return {\n\t\t\ttext: actual.unreadable,\n\t\t\tcause: \"differs\"\n\t\t};\n\t\treturn this.storedExpressionForm(actual) ?? {\n\t\t\ttext: `The contract holds ${describeDefault(this)}, and the database holds ${describeDefault(actual)}.`,\n\t\t\tcause: \"differs\"\n\t\t};\n\t}\n\tstoredExpressionForm(actual) {\n\t\tif (this.resolved?.kind !== \"function\" || actual.resolved?.kind !== \"function\") return void 0;\n\t\tconst literalFor = this.sqlExpressionLiteralFor;\n\t\tconst shown = (text) => literalFor?.(text) ?? JSON.stringify(text);\n\t\tconst stored = actual.raw ?? actual.resolved.expression;\n\t\tconst written = literalFor === void 0 ? stored : [stored, actual.resolved.expression].find((text) => literalFor(text) !== void 0);\n\t\tconst advice = written === void 0 ? \"No `sql` literal writes that text unchanged, so change the default's SQL in the contract until the database stores it as written.\" : `If they do, write the default as ${shown(written)}.`;\n\t\treturn {\n\t\t\ttext: `The database reads this default back as ${shown(written ?? stored)}; the contract declares ${shown(this.resolved.expression)}. The database may store a default expression in its own form, so the two can mean the same. ${advice}`,\n\t\t\tcause: \"possibly-equivalent\"\n\t\t};\n\t}\n};\n/** A default as a person reads it: a literal as JSON, the value its type read when there is one, an expression as its text, and the text the database reports beside a value read from it. */\nfunction describeDefault(node) {\n\tconst resolved = node.resolved;\n\tif (resolved === void 0) return node.raw ?? \"no default\";\n\tif (resolved.kind === \"function\") return resolved.expression;\n\tconst shown = JSON.stringify(node.value === void 0 ? resolved.value : jsonOfDefaultValue(node.value));\n\treturn node.raw === void 0 || node.raw === shown ? shown : `${shown} (${node.raw})`;\n}\nfunction isDefaultList(value) {\n\treturn Array.isArray(value);\n}\nfunction jsonOfDefaultValue(value) {\n\treturn isDefaultList(value) ? value.map((element) => element === null ? null : element.value) : value.value;\n}\nfunction sameExpression(a, b) {\n\treturn comparableExpression(a) === comparableExpression(b);\n}\n/** The expression with case and whitespace dropped outside quotes; a quoted literal or identifier keeps both, since they change what it means. */\nfunction comparableExpression(expression) {\n\tlet result = \"\";\n\tlet quote;\n\tfor (const char of expression) if (quote !== void 0) {\n\t\tresult += char;\n\t\tif (char === quote) quote = void 0;\n\t} else if (char === \"'\" || char === \"\\\"\") {\n\t\tquote = char;\n\t\tresult += char;\n\t} else if (!/\\s/.test(char)) result += char.toLowerCase();\n\treturn result;\n}\n//#endregion\n//#region src/ir/sql-column-ir.ts\n/**\n* Schema IR node for a single column on a table, as observed by\n* introspection. Unlike the Contract IR `StorageColumn`, this carries\n* the column's `name` (Schema IR columns are returned as arrays from\n* introspection queries; the parent table re-keys them into a record\n* for downstream consumers).\n*\n* Implements `DiffableNode` so a column is directly a table's diff-tree\n* child: `id` is the column name (unique among a table's columns); `isEqualTo`\n* compares this column's own attributes only, never its default, which is a\n* child node: the type by {@link sqlColumnTypesEqual}, and nullability.\n*/\nvar SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.column;\n\tname;\n\t/** See {@link SqlColumnIRInput.typeText}. */\n\ttypeText;\n\tnullable;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.typeText = input.typeText;\n\t\tthis.nullable = input.nullable;\n\t\tif (input.default !== void 0) this.default = input.default;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.many !== void 0) this.many = input.many;\n\t\tif (input.resolvedDefault !== void 0) this.resolvedDefault = input.resolvedDefault;\n\t\tdefineNonEnumerable(this, \"authoredDefault\", input.authoredDefault);\n\t\tdefineNonEnumerable(this, \"codecRef\", input.codecRef);\n\t\tdefineNonEnumerable(this, \"storedType\", input.storedType);\n\t\tdefineNonEnumerable(this, \"storedTypeParams\", input.storedTypeParams);\n\t\tdefineNonEnumerable(this, \"defaultValue\", input.defaultValue);\n\t\tdefineNonEnumerable(this, \"defaultUnreadable\", input.defaultUnreadable);\n\t\tdefineNonEnumerable(this, \"defaultExpressionValue\", input.defaultExpressionValue);\n\t\tdefineNonEnumerable(this, \"sqlExpressionLiteralFor\", input.sqlExpressionLiteralFor);\n\t\tdefineNonEnumerable(this, \"reportedType\", input.reportedType);\n\t\tdefineNonEnumerable(this, \"catalogText\", input.catalogText);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `column:${this.name}`;\n\t}\n\t/**\n\t* The column's default, when declared/present, is the column's one child\n\t* node — it has an extra/missing/drift lifecycle of its own, so the differ\n\t* recurses to it rather than `isEqualTo` comparing it. Built transiently\n\t* from this column's own fields.\n\t*/\n\tchildren() {\n\t\tif (this.resolvedDefault === void 0 && this.default === void 0) return [];\n\t\treturn [new SqlColumnDefaultIR({\n\t\t\t...ifDefined(\"resolved\", this.resolvedDefault),\n\t\t\t...ifDefined(\"raw\", this.default),\n\t\t\t...ifDefined(\"authored\", this.authoredDefault),\n\t\t\t...ifDefined(\"value\", this.defaultValue),\n\t\t\t...ifDefined(\"unreadable\", this.defaultUnreadable),\n\t\t\t...ifDefined(\"expressionValue\", this.defaultExpressionValue),\n\t\t\t...ifDefined(\"many\", this.many ?? this.codecRef?.many),\n\t\t\t...ifDefined(\"codecRef\", this.codecRef),\n\t\t\t...ifDefined(\"sqlExpressionLiteralFor\", this.sqlExpressionLiteralFor)\n\t\t})];\n\t}\n\t/** This column under another name, with every other field as it is. */\n\twithName(name) {\n\t\tconst fields = Object.fromEntries(Object.getOwnPropertyNames(this).map((key) => [key, Reflect.get(this, key)]));\n\t\treturn new SqlColumnIR({\n\t\t\t...blindCast(fields),\n\t\t\tname\n\t\t});\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.column;\n\t}\n\t/**\n\t* Compares the column's own attributes only — the default lives on the child node: the type, by {@link sqlColumnTypesEqual}, and nullability.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnIR\", SqlColumnIR.is);\n\t\treturn sqlColumnTypesEqual(this, node) && this.nullable === node.nullable;\n\t}\n\t/** Why `actual` is not this column: the two types as written and reported, or the nullability of each. The two sides always hold different values. */\n\texplainMismatch(actual) {\n\t\tif (actual === void 0) return void 0;\n\t\tconst node = blindCast(actual);\n\t\tassertNode(node, \"SqlColumnIR\", SqlColumnIR.is);\n\t\tconst texts = catalogTexts(this, node);\n\t\tif (texts !== void 0 && texts.expected !== texts.actual) return differs(`The column type is \"${texts.expected}\", but the database reports \"${texts.actual}\". A type named by its catalog text is compared with the text the database reports, exactly.`);\n\t\tif (node.storedType === void 0 && node.reportedType !== void 0) return differs(node.typeText === \"\" ? \"The database column has no declared type.\" : `The database column is ${shownTypeOf(node)}, which no data type in the configured stack declares.`);\n\t\tif (!sqlColumnTypesEqual(this, node)) return differs(`The contract column is ${shownTypeOf(this)} and the database column is ${shownTypeOf(node)}.`);\n\t\tif (this.nullable !== node.nullable) return differs(`The contract column is ${nullability(this)} and the database column is ${nullability(node)}.`);\n\t}\n};\n/**\n* Whether two columns have the same type: both have a stored type, the two are one data type, their parameters are equal as canonical JSON, and both or neither are lists. A column no data type claims has no stored type and never has the same type as another. ADR 254.\n*\n* When either column carries a {@link SqlColumnIR.catalogText}, the two compare by text instead, exactly, with `[]` for a list: that text against the other column's catalog text or reported text. ADR 273.\n*/\nfunction sqlColumnTypesEqual(a, b) {\n\tconst texts = catalogTexts(a, b);\n\tif (texts !== void 0) return texts.expected === texts.actual;\n\treturn a.storedType !== void 0 && b.storedType !== void 0 && a.storedType.id === b.storedType.id && canonicalizeJson(a.storedTypeParams ?? {}) === canonicalizeJson(b.storedTypeParams ?? {}) && Boolean(a.many) === Boolean(b.many);\n}\n/** The text a column's type compares by, with `[]` for a list, when it has one: its catalog text, or the text the database reports. */\nfunction comparedText(column) {\n\tconst text = column.catalogText ?? column.reportedType?.text;\n\treturn text === void 0 ? void 0 : `${text}${column.many === true ? \"[]\" : \"\"}`;\n}\n/** The two texts a pair of columns compares by, when either carries a catalog text. A side with no text to compare gives the empty text, which no catalog text equals. */\nfunction catalogTexts(expected, actual) {\n\tif (expected.catalogText === void 0 && actual.catalogText === void 0) return void 0;\n\treturn {\n\t\texpected: comparedText(expected) ?? \"\",\n\t\tactual: comparedText(actual) ?? \"\"\n\t};\n}\n/** The column's type as the contract writes it, or as introspection gives it, with `[]` for a list, in double quotes unless the text has double quotes of its own, as `\"char\"` does. */\nfunction shownTypeOf(column) {\n\tconst text = `${column.typeText}${column.many === true ? \"[]\" : \"\"}`;\n\treturn text.includes(\"\\\"\") ? text : `\"${text}\"`;\n}\nfunction differs(text) {\n\treturn {\n\t\ttext,\n\t\tcause: \"differs\"\n\t};\n}\nfunction nullability(column) {\n\treturn column.nullable ? \"nullable\" : \"not nullable\";\n}\n//#endregion\n//#region src/ir/sql-foreign-key-ir.ts\n/**\n* Schema IR node for a foreign-key constraint as observed by\n* introspection. The `referencedTable` / `referencedColumns` field\n* names match the introspection vocabulary (`pg_constraint.confkey`,\n* etc.) and intentionally differ from the Contract IR's nested\n* `references: { table, columns }` shape so that the verifier's\n* structural comparison stays explicit about which side it's reading.\n*\n* Implements `DiffableNode` so a foreign key is directly a table's diff-tree\n* child. Foreign keys are frequently unnamed (introspection may not carry a\n* constraint name, and the contract side never invents one), so `id` is\n* derived from the referencing/referenced coordinates rather than `name` —\n* the same tuple that makes two FK constraints the same constraint. This\n* also serves as the comparison key: two FKs with the same coordinates are\n* paired by the differ, and `isEqualTo` then compares the remaining\n* attribute — the referential actions.\n*/\nvar SqlForeignKeyIR = class SqlForeignKeyIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.foreignKey;\n\tcolumns;\n\treferencedTable;\n\treferencedColumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tthis.referencedTable = input.referencedTable;\n\t\tthis.referencedColumns = input.referencedColumns;\n\t\tif (input.referencedSchema !== void 0) this.referencedSchema = input.referencedSchema;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.onDelete !== void 0) this.onDelete = input.onDelete;\n\t\tif (input.onUpdate !== void 0) this.onUpdate = input.onUpdate;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tconst resolvedReferencedNamespace = input.resolvedReferencedNamespace ?? input.referencedSchema;\n\t\tif (resolvedReferencedNamespace !== void 0) this.resolvedReferencedNamespace = resolvedReferencedNamespace;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\tconst referencedNamespace = this.resolvedReferencedNamespace ?? \"\";\n\t\treturn `foreign-key:${this.columns.join(\",\")}->${referencedNamespace}.${this.referencedTable}(${this.referencedColumns.join(\",\")})`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.foreignKey;\n\t}\n\t/**\n\t* Referential-action comparison with `this` as the expected side, matching\n\t* the relational walk's `getReferentialActionMismatches`: `noAction` is the\n\t* database default and equivalent to an undeclared action, and drift is\n\t* flagged only when the expected side declares a (normalized) action.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlForeignKeyIR\", SqlForeignKeyIR.is);\n\t\treturn referentialActionMatches(this.onDelete, node.onDelete) && referentialActionMatches(this.onUpdate, node.onUpdate);\n\t}\n};\nfunction referentialActionMatches(expected, actual) {\n\tconst normalizedExpected = expected === \"noAction\" ? void 0 : expected;\n\tif (normalizedExpected === void 0) return true;\n\treturn normalizedExpected === (actual === \"noAction\" ? void 0 : actual);\n}\n//#endregion\n//#region src/ir/sql-index-ir.ts\n/**\n* Schema IR node for a secondary index as observed by introspection.\n* Unlike the Contract IR `Index`, the Schema IR carries an explicit\n* `unique` field — introspection sees the underlying index regardless\n* of whether the user expressed it as `@@index` or `@@unique`, and the\n* verifier needs to distinguish them when comparing to the Contract.\n*\n* Implements `DiffableNode` so an index is directly a table's diff-tree\n* child. Indexes are name-identified: every index — contract-derived or\n* introspected — carries its full physical name, and `id` is that name.\n* Names are catalog-unique per schema, so two indexes legitimately sharing\n* one column tuple (a unique index beside a redundant plain index) are two\n* distinct siblings, and expression indexes need no column tuple at all.\n*\n* `isEqualTo` is selected by the receiver (the differ always calls\n* `expected.isEqualTo(actual)`) and delegates to {@link contentEquals} —\n* the single node-owned content relation: both modes compare `unique`\n* strict, `type` and option values through the named normalization seams,\n* and `columns` ordered-strict when both sides carry them; an exact-named\n* receiver (`prefix === undefined`) additionally byte-compares\n* `expression`/`where` (both sides are reprints in the supported flow —\n* normalizing would only mask real drift); a wire-named receiver never\n* compares bodies (the wire-name hash already commits to them).\n*\n* `expression`, `where`, and `unique` are genuine SQL-family attributes —\n* functional and partial indexes are standard SQL that any SQL target may\n* introspect, so the family node must represent them; a target declining\n* to author them is a capability decision, not target-specificity.\n*/\nvar SqlIndexIR = class SqlIndexIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.index;\n\tname;\n\tunique;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (input.columns === void 0 === (input.expression === void 0)) throw new InternalError(`SqlIndexIR \"${name}\": exactly one of columns or expression must be set.`);\n\t\tthis.name = name;\n\t\tthis.unique = input.unique;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tif (input.columns !== void 0) this.columns = input.columns;\n\t\tif (input.expression !== void 0) this.expression = input.expression;\n\t\tif (input.where !== void 0) this.where = input.where;\n\t\tconst normalizedType = normalizeIndexType(input.type);\n\t\tif (normalizedType !== void 0) this.type = normalizedType;\n\t\tif (input.options !== void 0) this.options = input.options;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tdefineNonEnumerable(this, \"partial\", input.partial);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `index:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlIndexIR ? value : new SqlIndexIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.index;\n\t}\n\t/**\n\t* Mode-selected structural equality — see the class doc. Delegates to the\n\t* single node-owned relation: `columns` compare ordered-strict when both\n\t* sides carry them; an exact receiver (`prefix === undefined`)\n\t* byte-compares `expression ?? ''` and `where ?? ''`; a wire-named receiver\n\t* never compares bodies (the wire-name hash already commits to them).\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlIndexIR\", SqlIndexIR.is);\n\t\treturn this.contentEquals(node, {\n\t\t\tcolumnPresence: \"when-both-defined\",\n\t\t\tbodies: this.prefix !== void 0 ? \"ignored\" : \"verbatim\"\n\t\t});\n\t}\n\t/**\n\t* The single index content-equality relation — every comparer (the differ\n\t* via {@link isEqualTo}, the planner's rename content-pairing) calls this\n\t* with its mode-appropriate strictness rather than growing a parallel\n\t* relation:\n\t*\n\t* - `columnPresence: 'when-both-defined'` (the differ's rule) compares\n\t* the tuples ordered-strict only when both sides carry them — a paired\n\t* node's identity already agreed, so a column node meeting an\n\t* expression node skips the tuple.\n\t* - `columnPresence: 'matching'` (the rename-pairing rule) additionally\n\t* requires presence to agree: a column index never pairs an expression\n\t* index.\n\t* - `bodies: 'verbatim'` byte-compares `expression ?? ''` / `where ?? ''`\n\t* (absent ≡ empty, no normalization — both sides are reprints in the\n\t* supported flow); `bodies: 'ignored'` skips them (wire identity —\n\t* the wire-name hash commits to the content).\n\t*\n\t* `unique` compares strictly; `type` and option VALUES compare through\n\t* the named normalization seams below.\n\t*/\n\tcontentEquals(other, strictness) {\n\t\tconst columnsEqual = strictness.columnPresence === \"matching\" ? this.columns === void 0 === (other.columns === void 0) && (this.columns === void 0 || isArrayEqual(this.columns, other.columns ?? [])) : this.columns === void 0 || other.columns === void 0 || isArrayEqual(this.columns, other.columns);\n\t\tif (!(this.unique === other.unique && normalizeIndexType(this.type) === normalizeIndexType(other.type) && indexOptionsEqual(this.options, other.options) && columnsEqual)) return false;\n\t\tif (strictness.bodies === \"ignored\") return true;\n\t\treturn (this.expression ?? \"\") === (other.expression ?? \"\") && (this.where ?? \"\") === (other.where ?? \"\");\n\t}\n};\n/**\n* The btree-default normalization seam: the default access method (`btree`\n* in every supported SQL target) normalizes to absent. Applied at\n* construction — every derivation path (contract tree, introspection, flat\n* family tree) builds through the class, so both compare sides are\n* symmetric by definition — and again inside\n* {@link SqlIndexIR.contentEquals} so the relation holds for any input.\n* The contract JSON and the wire-name content hash keep the authored\n* spelling: `@@index([a], type: \"btree\")` and `@@index([a])` are distinct\n* wire names — but content-equal after normalization, so a spelling change\n* between them converges as a rename via the planner's content\n* pairing (the hashes differ, so hash pairing never pairs them).\n*/\nfunction normalizeIndexType(type) {\n\treturn type === \"btree\" ? void 0 : type;\n}\n/**\n* Option-bag equality: same key set, values compared through\n* {@link normalizeIndexOptionValue} — Postgres introspection returns\n* reloptions values as catalog-reprint strings (`'70'`, `'on'`) while\n* contract option leaves are typed (number, boolean, string).\n*/\nfunction indexOptionsEqual(a, b) {\n\tconst aKeys = a ? Object.keys(a).sort() : [];\n\tconst bKeys = b ? Object.keys(b).sort() : [];\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (let i = 0; i < aKeys.length; i += 1) if (aKeys[i] !== bKeys[i]) return false;\n\tif (aKeys.length === 0) return true;\n\tfor (const key of aKeys) if (normalizeIndexOptionValue(a?.[key]) !== normalizeIndexOptionValue(b?.[key])) return false;\n\treturn true;\n}\n//#endregion\n//#region src/ir/sql-unique-ir.ts\n/**\n* Schema IR node for a table-level unique constraint as observed by\n* introspection.\n*\n* Implements `DiffableNode` so a unique constraint is directly a table's\n* diff-tree child. Unique constraints are frequently unnamed, so `id` is\n* derived from the column tuple rather than `name` — the column tuple is\n* also what makes two unique constraints the same constraint, so it doubles\n* as the pairing key. There are no further attributes to compare once\n* columns are equal (the differ pairs on `id`), so `isEqualTo` is identity.\n*/\nvar SqlUniqueIR = class SqlUniqueIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.unique;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = [...input.columns];\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `unique:${this.columns.join(\",\")}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.unique;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlUniqueIR\", SqlUniqueIR.is);\n\t\treturn this.id === node.id;\n\t}\n};\n//#endregion\n//#region src/ir/sql-table-ir.ts\n/**\n* Schema IR node for a single table as observed by introspection.\n*\n* Unlike the Contract IR `StorageTable`, this carries the table's\n* `name` — introspection queries return tables as arrays and the\n* verifier keys them into `SqlSchemaIR.tables` afterwards, so the name\n* stays on the table object for downstream call sites that walk\n* `Object.values(schema.tables)`.\n*\n* The constructor normalises nested IR-class fields so downstream\n* walks see a uniform AST regardless of whether the input was a\n* plain-data literal (from introspection) or already-constructed\n* class instances.\n*\n* Implements `DiffableNode` so a flat (single-schema) tree is directly\n* diffable: `id` is the table name; `isEqualTo` is identity (the table's\n* structural drift is entirely expressed by its children); `children()`\n* yields every column, the primary key (when present), every foreign key,\n* unique, index, and check constraint — the same composition and order as\n* the Postgres table node, minus policies.\n*/\nvar SqlTableIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.table;\n\tname;\n\tcolumns;\n\tforeignKeys;\n\tuniques;\n\tindexes;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.columns = Object.freeze(Object.fromEntries(Object.entries(input.columns).map(([key, col]) => [key, col instanceof SqlColumnIR ? col : new SqlColumnIR(col)])));\n\t\tthis.foreignKeys = Object.freeze(input.foreignKeys.map((fk) => fk instanceof SqlForeignKeyIR ? fk : new SqlForeignKeyIR(fk)));\n\t\tthis.uniques = Object.freeze(input.uniques.map((u) => u instanceof SqlUniqueIR ? u : new SqlUniqueIR(u)));\n\t\tthis.indexes = Object.freeze(input.indexes.map(SqlIndexIR.from));\n\t\tif (input.primaryKey !== void 0) this.primaryKey = PrimaryKey.from(input.primaryKey);\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.checks !== void 0 && input.checks.length > 0) this.checks = Object.freeze(input.checks.map(SqlCheckConstraintIR.from));\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn this.name;\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn [\n\t\t\t...Object.values(this.columns),\n\t\t\t...this.primaryKey ? [this.primaryKey] : [],\n\t\t\t...this.foreignKeys,\n\t\t\t...this.uniques,\n\t\t\t...this.indexes,\n\t\t\t...this.checks ?? []\n\t\t];\n\t}\n};\n//#endregion\n//#region src/ir/sql-schema-ir.ts\n/**\n* Root Schema IR node representing the complete database schema as\n* observed by introspection. Target-agnostic; used by both verifiers\n* (compare against intended Contract storage) and migration planners\n* (derive operations needed to reconcile).\n*\n* The constructor normalises nested `SqlTableIR` instances so\n* downstream walks see a uniform AST regardless of whether the input\n* was a plain-data literal or already-constructed class instances.\n*\n* Implements `DiffableNode` as the root of a flat (single-schema) diff\n* tree: `id` is the fixed sentinel `'database'` (roots have no siblings),\n* `isEqualTo` is identity (a container has no own attributes), and\n* `children()` yields the table nodes.\n*/\nvar SqlSchemaIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.schema;\n\ttables;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.tables = Object.freeze(Object.fromEntries(Object.entries(input.tables).map(([key, t]) => [key, t instanceof SqlTableIR ? t : new SqlTableIR(t)])));\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"database\";\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn Object.values(this.tables);\n\t}\n};\n//#endregion\nexport { relationalNodeGranularity as _, SqlForeignKeyIR as a, SqlColumnDefaultIR as c, PrimaryKey as d, SqlSchemaIRNode as f, relationalNodeEntityKind as g, RelationalSchemaNodeKind as h, SqlIndexIR as i, sqlDefaultValuesEqual as l, defineNonEnumerable as m, SqlTableIR as n, SqlColumnIR as o, assertNode as p, SqlUniqueIR as r, sqlColumnTypesEqual as s, SqlSchemaIR as t, SqlCheckConstraintIR as u };\n\n//# sourceMappingURL=types-DoyiTsjg.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAM,2BAA2B;CAChC,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,eAAe;CACf,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,OAAO;CACP,OAAO;AACR;;;;;;;;;;;AAWA,MAAM,8BAA8B;EAClC,yBAAyB,SAAS;EAClC,yBAAyB,QAAQ;EACjC,yBAAyB,SAAS;EAClC,yBAAyB,gBAAgB;EACzC,yBAAyB,aAAa;EACtC,yBAAyB,aAAa;EACtC,yBAAyB,SAAS;EAClC,yBAAyB,QAAQ;EACjC,yBAAyB,QAAQ;AACnC;AACA,SAAS,2BAA2B,UAAU;CAC7C,OAAO,OAAO,OAAO,6BAA6B,QAAQ;AAC3D;;;;;;;AAOA,SAAS,0BAA0B,UAAU;CAC5C,IAAI,CAAC,2BAA2B,QAAQ,GAAG,MAAM,IAAI,cAAc,iEAAiE,SAAS,EAAE;CAC/I,OAAO,4BAA4B;AACpC;;;;;;;;AAQA,MAAM,8BAA8B,GAAG,yBAAyB,QAAQ,QAAQ;;;;;;;;AAQhF,SAAS,yBAAyB,UAAU;CAC3C,OAAO,2BAA2B,QAAQ,IAAI,4BAA4B,YAAY,KAAK;AAC5F;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAI,kBAAkB,cAAc,WAAW;CAC9C,cAAc;EAC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AAC;EACtJ,IAAI,MAAM,gBAAgB,KAAK,GAAG,KAAK,cAAc,MAAM;EAC3D,WAAW,IAAI;CAChB;CACA,IAAI,KAAK;EACR,OAAO;CACR;CACA,UAAU,OAAO;EAChB,OAAO,KAAK,OAAO,MAAM;CAC1B;CACA,WAAW;EACV,OAAO,OAAO,OAAO,KAAK,MAAM;CACjC;AACD"}
@@ -1,8 +1,8 @@
1
1
  import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
2
2
  import { a as computeIndexContentHash, i as computeCheckContentHash } from "./naming-bM5qm5PY-DdginUhA.mjs";
3
- import { s as sameSqlColumnType } from "./sql-data-type-BSi0X331-OXbBFXDh.mjs";
3
+ import { c as sameSqlColumnType } from "./sql-data-type-D5cI3M07-DIcPP8s1.mjs";
4
4
  import { f as composeSqlEntityKinds } from "./entity-kinds-CQ_jwgYv-DoOBWwvX.mjs";
5
- import { a as sameColumns$1, s as startsWithColumns } from "./index-equivalence-DswCiq5l-C6SAs-Yz.mjs";
5
+ import { a as sameColumns$1, s as startsWithColumns } from "./index-equivalence-DswCiq5l-D5VK0qTy.mjs";
6
6
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
7
7
  import { ContractValidationError } from "@prisma/orm-framework/contract/contract-validation-error";
8
8
  import { isPlainRecord } from "@prisma/orm-framework/components/ir";
@@ -769,4 +769,4 @@ function validateRelationThroughConsistency(contract, dataTypes) {
769
769
  //#endregion
770
770
  export { createSqlStorageSchema as a, validateExecutionDefaultsTargetMappedColumns as c, validateRelationJoinFields as d, validateSqlContractFully as f, valueObjectStorageTypeMissingMessage as g, validateStorageSemantics as h, createSqlContractSchema as i, validateModel as l, validateStorage as m, checkSqlDefaultText as n, reservedSqlDefaultText as o, validateSqlStorageConsistency as p, createNamespaceEntrySchema as r, resolveSqlToOneRelationStorage as s, ContractEnumSchema as t, validateModelStorageReferences as u };
771
771
 
772
- //# sourceMappingURL=validators-BCRydDG7.mjs.map
772
+ //# sourceMappingURL=validators-BlONfdFH.mjs.map