@prisma/orm-family-sql 8.0.0-rc.18-dev.30 → 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 (139) 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/builder.d.mts +1 -1
  6. package/dist/builder__runtime.d.mts +1 -1
  7. package/dist/builder__runtime.mjs +1 -1
  8. package/dist/builder__types.d.mts +1 -1
  9. package/dist/{config-types-vu5fTaRa.mjs → config-types-BkcCqeAg.mjs} +2 -2
  10. package/dist/{config-types-vu5fTaRa.mjs.map → config-types-BkcCqeAg.mjs.map} +1 -1
  11. package/dist/{contract-builder-DmX4XnJa.mjs → contract-builder-D3XaKpyw.mjs} +3 -3
  12. package/dist/{contract-builder-DmX4XnJa.mjs.map → contract-builder-D3XaKpyw.mjs.map} +1 -1
  13. package/dist/contract-prisma7__provider.mjs +6 -6
  14. package/dist/contract-psl.mjs +1 -1
  15. package/dist/contract-psl__attribute-specs.mjs +1 -1
  16. package/dist/contract-psl__diagnostics.mjs +1 -1
  17. package/dist/contract-psl__provider.mjs +2 -2
  18. package/dist/contract-ts.mjs +3 -3
  19. package/dist/contract-ts__config-types.mjs +1 -1
  20. package/dist/contract-ts__contract-builder.mjs +2 -2
  21. package/dist/contract.d.mts +3 -3
  22. package/dist/contract.mjs +6 -6
  23. package/dist/contract__data-type.d.mts +2 -2
  24. package/dist/contract__data-type.mjs +3 -3
  25. package/dist/contract__foreign-key-materialization.d.mts +1 -1
  26. package/dist/contract__foreign-key-materialization.mjs +2 -2
  27. package/dist/contract__validators.mjs +1 -1
  28. package/dist/{control-B8tb6SEt.d.mts → control-Db07JiRl.d.mts} +24 -7
  29. package/dist/control-Db07JiRl.d.mts.map +1 -0
  30. package/dist/{control-DNE-Chse.mjs → control-DbHnaxDE.mjs} +10 -9
  31. package/dist/control-DbHnaxDE.mjs.map +1 -0
  32. package/dist/{control-adapter-DhX77V61.mjs → control-adapter-BX5COBWO.mjs} +2 -2
  33. package/dist/{control-adapter-DhX77V61.mjs.map → control-adapter-BX5COBWO.mjs.map} +1 -1
  34. package/dist/{control-adapter-Bn0uhplA-rhq_JtYp.d.mts → control-adapter-Bn0uhplA-BnsQY8_q.d.mts} +4 -4
  35. package/dist/{control-adapter-Bn0uhplA-rhq_JtYp.d.mts.map → control-adapter-Bn0uhplA-BnsQY8_q.d.mts.map} +1 -1
  36. package/dist/{control-adapter-RwLtGiwa.d.mts → control-adapter-DgxEVzhZ.d.mts} +4 -4
  37. package/dist/{control-adapter-RwLtGiwa.d.mts.map → control-adapter-DgxEVzhZ.d.mts.map} +1 -1
  38. package/dist/{data-type-C84xngfv.d.mts → data-type-DMk-fLAZ.d.mts} +38 -8
  39. package/dist/data-type-DMk-fLAZ.d.mts.map +1 -0
  40. package/dist/data-type-HNhSslwG.mjs +67 -0
  41. package/dist/data-type-HNhSslwG.mjs.map +1 -0
  42. package/dist/{db-BmrN9nRS-BzK96yVh.d.mts → db-BmrN9nRS-BGnRxI7X.d.mts} +2 -2
  43. package/dist/{db-BmrN9nRS-BzK96yVh.d.mts.map → db-BmrN9nRS-BGnRxI7X.d.mts.map} +1 -1
  44. package/dist/{derived-checks-CdPHpJSv-B7Bgj3Ao.mjs → derived-checks-B1qNxwBL-DFoGexId.mjs} +17 -5
  45. package/dist/derived-checks-B1qNxwBL-DFoGexId.mjs.map +1 -0
  46. package/dist/{diagnostics-C8YevjSU.mjs → diagnostics-xqFRhSin.mjs} +2 -2
  47. package/dist/{diagnostics-C8YevjSU.mjs.map → diagnostics-xqFRhSin.mjs.map} +1 -1
  48. package/dist/{diff-B9Z47nHf.d.mts → diff-BN_3K9lv.d.mts} +5 -5
  49. package/dist/{diff-B9Z47nHf.d.mts.map → diff-BN_3K9lv.d.mts.map} +1 -1
  50. package/dist/family.d.mts +10 -10
  51. package/dist/family.mjs +8 -8
  52. package/dist/family__control-adapter.d.mts +2 -2
  53. package/dist/family__control-adapter.mjs +1 -1
  54. package/dist/family__control.d.mts +3 -3
  55. package/dist/family__control.mjs +3 -3
  56. package/dist/family__diff.d.mts +1 -1
  57. package/dist/family__diff.mjs +1 -1
  58. package/dist/family__ir.mjs +1 -1
  59. package/dist/family__migration.d.mts +1 -1
  60. package/dist/family__pack.d.mts +1 -1
  61. package/dist/family__pack.mjs +2 -2
  62. package/dist/family__pack.mjs.map +1 -1
  63. package/dist/family__psl-build.d.mts +1 -1
  64. package/dist/family__psl-build.mjs +1 -1
  65. package/dist/family__psl-infer.d.mts +1 -1
  66. package/dist/family__psl-infer.mjs +1 -1
  67. package/dist/{foreign-key-materialization-C_FPLzj3.mjs → foreign-key-materialization-BPQqd0qF.mjs} +2 -2
  68. package/dist/{foreign-key-materialization-C_FPLzj3.mjs.map → foreign-key-materialization-BPQqd0qF.mjs.map} +1 -1
  69. package/dist/{foreign-key-materialization-3vQnPT_D.d.mts → foreign-key-materialization-bL-t2oPB.d.mts} +3 -3
  70. package/dist/{foreign-key-materialization-3vQnPT_D.d.mts.map → foreign-key-materialization-bL-t2oPB.d.mts.map} +1 -1
  71. package/dist/{generator-functions-B4gRRYZB-BTtC2KQz.mjs → generator-functions-BoE7Lc9d-MgcgdnPZ.mjs} +37 -20
  72. package/dist/generator-functions-BoE7Lc9d-MgcgdnPZ.mjs.map +1 -0
  73. package/dist/{index-B0hZw3uT.d.mts → index-Bw9Y19Js.d.mts} +3 -3
  74. package/dist/{index-B0hZw3uT.d.mts.map → index-Bw9Y19Js.d.mts.map} +1 -1
  75. package/dist/{index-equivalence-DswCiq5l-C6SAs-Yz.mjs → index-equivalence-DswCiq5l-D5VK0qTy.mjs} +2 -2
  76. package/dist/{index-equivalence-DswCiq5l-C6SAs-Yz.mjs.map → index-equivalence-DswCiq5l-D5VK0qTy.mjs.map} +1 -1
  77. package/dist/{interpreter-Bk0xpelv-BifV9Yib.mjs → interpreter-Bk0xpelv-4laiO5dH.mjs} +4 -4
  78. package/dist/{interpreter-Bk0xpelv-BifV9Yib.mjs.map → interpreter-Bk0xpelv-4laiO5dH.mjs.map} +1 -1
  79. package/dist/{migration-CSv3UpiC.d.mts → migration-go6YP7-v.d.mts} +2 -2
  80. package/dist/{migration-CSv3UpiC.d.mts.map → migration-go6YP7-v.d.mts.map} +1 -1
  81. package/dist/orm-client.d.mts +3 -3
  82. package/dist/orm-client.mjs +1 -1
  83. package/dist/{pack-COEyiyfL.d.mts → pack-DXEOdHaM.d.mts} +18 -1
  84. package/dist/pack-DXEOdHaM.d.mts.map +1 -0
  85. package/dist/{psl-build-BkxAXTwj.mjs → psl-build-BYqCjsqi.mjs} +4 -4
  86. package/dist/psl-build-BYqCjsqi.mjs.map +1 -0
  87. package/dist/{psl-build-O7_tXQ1E.d.mts → psl-build-C41KHJL_.d.mts} +4 -4
  88. package/dist/{psl-build-O7_tXQ1E.d.mts.map → psl-build-C41KHJL_.d.mts.map} +1 -1
  89. package/dist/{psl-field-resolution-BET6wtHZ-CX2xL99Q.mjs → psl-field-resolution-BET6wtHZ-C_hO6YE1.mjs} +3 -3
  90. package/dist/{psl-field-resolution-BET6wtHZ-CX2xL99Q.mjs.map → psl-field-resolution-BET6wtHZ-C_hO6YE1.mjs.map} +1 -1
  91. package/dist/{psl-infer-I75woGr4.d.mts → psl-infer-CALmBIqX.d.mts} +3 -3
  92. package/dist/{psl-infer-I75woGr4.d.mts.map → psl-infer-CALmBIqX.d.mts.map} +1 -1
  93. package/dist/{psl-infer-Bz34csvN.mjs → psl-infer-CaEnF_x3.mjs} +2 -2
  94. package/dist/{psl-infer-Bz34csvN.mjs.map → psl-infer-CaEnF_x3.mjs.map} +1 -1
  95. package/dist/relational-core.d.mts +2 -2
  96. package/dist/relational-core.mjs +2 -2
  97. package/dist/relational-core__ast.d.mts +2 -2
  98. package/dist/relational-core__ast.mjs +2 -2
  99. package/dist/runtime.d.mts +3 -3
  100. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  101. package/dist/{schema-differ-DmP74bB8-CIQ17HTk.d.mts → schema-differ-DmP74bB8-BfEQ_9cY.d.mts} +3 -3
  102. package/dist/{schema-differ-DmP74bB8-CIQ17HTk.d.mts.map → schema-differ-DmP74bB8-BfEQ_9cY.d.mts.map} +1 -1
  103. package/dist/schema-ir.d.mts +1 -1
  104. package/dist/schema-ir.mjs +1 -1
  105. package/dist/schema-ir__types.d.mts +2 -2
  106. package/dist/schema-ir__types.mjs +1 -1
  107. package/dist/{schema-verify-BwRdzbHb-nDeE75xa.mjs → schema-verify-BwRdzbHb-BzdgK4xv.mjs} +2 -2
  108. package/dist/{schema-verify-BwRdzbHb-nDeE75xa.mjs.map → schema-verify-BwRdzbHb-BzdgK4xv.mjs.map} +1 -1
  109. package/dist/{sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs → sql-contract-serializer-sMY3prTx-D-xfnqyD.mjs} +2 -2
  110. package/dist/{sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs.map → sql-contract-serializer-sMY3prTx-D-xfnqyD.mjs.map} +1 -1
  111. package/dist/{sql-data-type-BSi0X331-OXbBFXDh.mjs → sql-data-type-D5cI3M07-DIcPP8s1.mjs} +26 -9
  112. package/dist/sql-data-type-D5cI3M07-DIcPP8s1.mjs.map +1 -0
  113. package/dist/{transaction-state-DR3nKTmH-DbyhuL-z.d.mts → transaction-state-DR3nKTmH-D_pb9QgR.d.mts} +2 -2
  114. package/dist/{transaction-state-DR3nKTmH-DbyhuL-z.d.mts.map → transaction-state-DR3nKTmH-D_pb9QgR.d.mts.map} +1 -1
  115. package/dist/types-D_nlUp-1.d.mts +1 -0
  116. package/dist/{types-B3AHHPDh-BHh-89fY.d.mts → types-DiD6BqoN-ZF53hwPp.d.mts} +11 -3
  117. package/dist/types-DiD6BqoN-ZF53hwPp.d.mts.map +1 -0
  118. package/dist/{types-DlFdMaDJ-DekbNgDh.d.mts → types-DlFdMaDJ-BEDwj-Qv.d.mts} +4 -4
  119. package/dist/{types-DlFdMaDJ-DekbNgDh.d.mts.map → types-DlFdMaDJ-BEDwj-Qv.d.mts.map} +1 -1
  120. package/dist/{types-egs_vme1-DRhYFwIT.mjs → types-DoyiTsjg-DDTmYyNY.mjs} +22 -2
  121. package/dist/types-DoyiTsjg-DDTmYyNY.mjs.map +1 -0
  122. package/dist/{validators-BCRydDG7.mjs → validators-BlONfdFH.mjs} +3 -3
  123. package/dist/{validators-BCRydDG7.mjs.map → validators-BlONfdFH.mjs.map} +1 -1
  124. package/package.json +18 -18
  125. package/dist/ast-CBO3PEJF.mjs.map +0 -1
  126. package/dist/ast-Cq7uhA86.d.mts.map +0 -1
  127. package/dist/control-B8tb6SEt.d.mts.map +0 -1
  128. package/dist/control-DNE-Chse.mjs.map +0 -1
  129. package/dist/data-type-C84xngfv.d.mts.map +0 -1
  130. package/dist/data-type-DKk8Unnz.mjs +0 -20
  131. package/dist/data-type-DKk8Unnz.mjs.map +0 -1
  132. package/dist/derived-checks-CdPHpJSv-B7Bgj3Ao.mjs.map +0 -1
  133. package/dist/generator-functions-B4gRRYZB-BTtC2KQz.mjs.map +0 -1
  134. package/dist/pack-COEyiyfL.d.mts.map +0 -1
  135. package/dist/psl-build-BkxAXTwj.mjs.map +0 -1
  136. package/dist/sql-data-type-BSi0X331-OXbBFXDh.mjs.map +0 -1
  137. package/dist/types-B3AHHPDh-BHh-89fY.d.mts.map +0 -1
  138. package/dist/types-BGERR8XF.d.mts +0 -1
  139. package/dist/types-egs_vme1-DRhYFwIT.mjs.map +0 -1
@@ -165,6 +165,7 @@ const SQL_VARCHAR_CODEC_ID = "sql/varchar@1";
165
165
  const SQL_INT_CODEC_ID = "sql/int@1";
166
166
  const SQL_FLOAT_CODEC_ID = "sql/float@1";
167
167
  const SQL_TEXT_CODEC_ID = "sql/text@1";
168
+ const SQL_RAW_CODEC_ID = "sql/raw@1";
168
169
  const sqlCharEncode = (value) => value;
169
170
  /** A `character` value as the database returns it, without the spaces that pad it to its length. Only spaces pad it, so a trailing tab or newline is part of the value. */
170
171
  const sqlCharDecode = (wire) => withoutTrailing(wire, " ");
@@ -176,16 +177,6 @@ const sqlFloatEncode = (value) => value;
176
177
  const sqlFloatDecode = (wire) => wire;
177
178
  const sqlTextEncode = (value) => value;
178
179
  const sqlTextDecode = (wire) => wire;
179
- /**
180
- * The six SQL base codecs (TML-2357).
181
- *
182
- * Each codec ships as three artifacts:
183
- *
184
- * 1. A `SqlXCodec` class extending {@link CodecImpl} that wraps the module-level wire conversions exported from `sql-codec-helpers.ts` (the single source of truth for runtime behaviour). 2. A `SqlXDescriptor` class extending {@link CodecDescriptorTemplateImpl} declaring the codec id, traits, target types, and params schema; the data type is left to the target that adapts the template, which builds the codec with that type. 3. A per-codec column helper (`sqlXColumn`)
185
- * that calls `descriptor.factory(...)` directly and packages the result into a {@link ColumnSpec} via the framework {@link column} packager. The helper is tied to its descriptor with `satisfies ColumnHelperFor`.
186
- *
187
- * After TML-2357 this file is the canonical source of SQL base codec metadata and runtime behaviour — the legacy `mkCodec` / `defineCodec` carriers retired with the deletion sweep.
188
- */
189
180
  /** A family codec has no data type of its own, so only a target that adapts it, naming its data type, builds its codec. A column helper below names the codec for a contract; the target's adapted descriptor builds it. */
190
181
  function unadapted(codecId) {
191
182
  throw new InternalError(`${codecId} is a SQL family template. A target adapts it with its own data type and builds its codecs; the template builds none.`);
@@ -331,7 +322,51 @@ var SqlVarcharDescriptor = class extends CodecDescriptorTemplateImpl {
331
322
  };
332
323
  const sqlVarcharDescriptor = new SqlVarcharDescriptor();
333
324
  const sqlVarcharColumn = (params = {}) => column(sqlVarcharDescriptor.factory(params), sqlVarcharDescriptor.codecId, params);
325
+ function isJsonValue(value) {
326
+ if (value === null) return true;
327
+ switch (typeof value) {
328
+ case "string":
329
+ case "boolean": return true;
330
+ case "number": return Number.isFinite(value);
331
+ case "object":
332
+ if (Array.isArray(value)) return value.every(isJsonValue);
333
+ return Object.getPrototypeOf(value) === Object.prototype && Object.values(value).every(isJsonValue);
334
+ default: return false;
335
+ }
336
+ }
337
+ /**
338
+ * The codec of a raw column, whose type no other data type claims. Values pass through unchanged and
339
+ * are typed `unknown`, since nothing is known about them beyond what the database returns. A raw
340
+ * column has no literal values, but that is its data type's rule: the data type's reader refuses
341
+ * every value, so `toDataTypeValue` refuses every literal. ADR 273.
342
+ */
343
+ var SqlRawCodec = class extends CodecImpl {
344
+ async toWire(value, _ctx) {
345
+ return value;
346
+ }
347
+ async fromWire(wire, _ctx) {
348
+ return wire;
349
+ }
350
+ fromDataTypeValue(value) {
351
+ return value.value;
352
+ }
353
+ toDataTypeValue(input) {
354
+ if (isJsonValue(input)) return this.dataTypeValueOf(input);
355
+ throw structuredError("RUNTIME.ENCODE_FAILED", `${this.id} writes only JSON values as JSON`, { meta: { codecId: this.id } });
356
+ }
357
+ };
358
+ var SqlRawDescriptor = class extends CodecDescriptorTemplateImpl {
359
+ codecId = SQL_RAW_CODEC_ID;
360
+ traits = [];
361
+ enumRefusal = "A raw column has a type Prisma does not interpret, so no member can be written as one of its values. No enum can use the raw codec; use a text enum instead.";
362
+ paramsSchema = void 0;
363
+ factory(_params) {
364
+ return () => unadapted(this.codecId);
365
+ }
366
+ };
367
+ const sqlRawDescriptor = new SqlRawDescriptor();
368
+ const sqlRawColumn = (sql) => column(sqlRawDescriptor.factory({ sql }), sqlRawDescriptor.codecId, { sql });
334
369
  //#endregion
335
- export { sqlFloatColumn as A, sqlTextDescriptor as B, lockStrengthCapabilities as C, sqlCharDecode as D, sqlCharColumn as E, sqlIntDecode as F, sqlVarcharEncode as G, sqlVarcharColumn as H, sqlIntDescriptor as I, sqlIntEncode as L, sqlFloatDescriptor as M, sqlFloatEncode as N, sqlCharDescriptor as O, sqlIntColumn as P, sqlTextColumn as R, lockOptionCapabilities as S, missingCapability as T, sqlVarcharDecode as U, sqlTextEncode as V, sqlVarcharDescriptor as W, SqlVarcharCodec as _, SQL_FLOAT_CODEC_ID as a, encodeLiteralDefault as b, SQL_VARCHAR_CODEC_ID as c, SqlFloatCodec as d, SqlFloatDescriptor as f, SqlTextDescriptor as g, SqlTextCodec as h, SQL_CHAR_CODEC_ID as i, sqlFloatDecode as j, sqlCharEncode as k, SqlCharCodec as l, SqlIntDescriptor as m, JsonDocumentProjection as n, SQL_INT_CODEC_ID as o, SqlIntCodec as p, NativeJsonValueProjection as r, SQL_TEXT_CODEC_ID as s, CodecJsonValueProjection as t, SqlCharDescriptor as u, SqlVarcharDescriptor as v, lockWaitPolicyOf as w, lockIncompatible as x, encodeListLiteralDefault as y, sqlTextDecode as z };
370
+ export { sqlCharDecode as A, sqlIntEncode as B, encodeLiteralDefault as C, lockWaitPolicyOf as D, lockStrengthCapabilities as E, sqlFloatDescriptor as F, sqlTextDescriptor as G, sqlRawDescriptor as H, sqlFloatEncode as I, sqlVarcharDecode as J, sqlTextEncode as K, sqlIntColumn as L, sqlCharEncode as M, sqlFloatColumn as N, missingCapability as O, sqlFloatDecode as P, sqlIntDecode as R, encodeListLiteralDefault as S, lockOptionCapabilities as T, sqlTextColumn as U, sqlRawColumn as V, sqlTextDecode as W, sqlVarcharEncode as X, sqlVarcharDescriptor as Y, SqlRawDescriptor as _, SQL_FLOAT_CODEC_ID as a, SqlVarcharCodec as b, SQL_TEXT_CODEC_ID as c, SqlCharDescriptor as d, SqlFloatCodec as f, SqlRawCodec as g, SqlIntDescriptor as h, SQL_CHAR_CODEC_ID as i, sqlCharDescriptor as j, sqlCharColumn as k, SQL_VARCHAR_CODEC_ID as l, SqlIntCodec as m, JsonDocumentProjection as n, SQL_INT_CODEC_ID as o, SqlFloatDescriptor as p, sqlVarcharColumn as q, NativeJsonValueProjection as r, SQL_RAW_CODEC_ID as s, CodecJsonValueProjection as t, SqlCharCodec as u, SqlTextCodec as v, lockIncompatible as w, SqlVarcharDescriptor as x, SqlTextDescriptor as y, sqlIntDescriptor as z };
336
371
 
337
- //# sourceMappingURL=ast-CBO3PEJF.mjs.map
372
+ //# sourceMappingURL=ast-BJs2669T.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-BJs2669T.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/ast.mjs"],"sourcesContent":["import { A as ParamRef, B as aggregateFnNames, C as LiteralExpr, D as OperationExpr, E as NullCheckExpr, F as SelectAst, G as isQueryAst, H as isAggregateFn, I as SubqueryExpr, J as whereExprKinds, K as isWhereExpr, L as TableSource, M as ProjectionItem, N as RawExpr, O as OrExpr, P as RawQueryAst, R as UpdateAst, S as ListExpression, T as NotExpr, U as isOrderByDirection, V as checkLimitOffset, W as isOrderByNulls, Y as frozenCodecRef, _ as InsertAst, a as CastExpr, b as JsonArrayAggExpr, c as DeleteAst, d as DoUpdateSetConflictAction, f as EqColJoinOn, g as IdentifierRef, h as FunctionSource, i as CaseExpr, j as PreparedParamRef, k as OrderByItem, l as DerivedTableSource, m as FunctionCallExpr, n as AndExpr, o as ColumnRef, p as ExistsExpr, q as queryAstKinds, r as BinaryExpr, s as DefaultValueExpr, t as AggregateExpr, u as DoNothingConflictAction, v as InsertOnConflict, w as LockingClause, x as JsonObjectExpr, y as JoinAst, z as WindowFuncExpr } from \"../types-NTQsD2MS.mjs\";\nimport { a as DdlColumn, c as ForeignKeyConstraint, d as PrimaryKeyConstraint, f as UniqueConstraint, i as CheckExpressionConstraint, l as FunctionColumnDefault, n as opaqueSql, o as DdlColumnDefault, p as isDdlNode, r as renderOpaqueSql, s as DdlNode, t as OpaqueSql, u as LiteralColumnDefault } from \"../opaque-sql-Dset3kln.mjs\";\nimport { n as compact, r as isAggregateProjection, t as collectOrderedParamRefs } from \"../util-BBgcP3gI.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { CodecDescriptorTemplateImpl, CodecImpl, SAFE_INTEGER_RANGE, codecForRef, column, floatToJson, readContractValue, readJsonFloat, readJsonInteger } from \"@internal/framework-components/codec\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { withoutTrailing } from \"@internal/utils/text\";\n//#region src/ast/ddl-default.ts\n/**\n* Reads a column's literal default as a value of the column's data type, converts it with the column's codec, built with its type parameters, and writes it with `toWire` for the DDL renderer to inline. `undefined` when no codec descriptor has the column's codec id, so the renderer inlines the value as written.\n*\n* A `Date` is the one authored value JSON has no notation for, so the codec reads it into a value of the column's type with `toDataTypeValue`, and the Date it reads back from that value is encoded: the type and the codec check it as they check any other default. A `null` the type or codec refuses is SQL NULL, because SQL NULL has no stored form of its own; a type that stores `null` (a JSON type) makes it the JSON value null. Any other value either refuses is a `CONTRACT.DEFAULT_INVALID` naming the column.\n*/\nasync function encodeLiteralDefault(codecLookup, codecRef, value, where) {\n\tconst codec = codecForRef(codecLookup, codecRef);\n\tif (codec === void 0) return void 0;\n\tconst refused = (cause) => refusedDefault(where, codecRef.codecId, value, void 0, cause);\n\tif (value instanceof Date) return encodeDate(codec, value, refused);\n\treturn encodeWithCodec(codec, codecRef, value, refused);\n}\nasync function encodeDate(codec, value, refused) {\n\tlet decoded;\n\ttry {\n\t\tdecoded = codec.fromDataTypeValue(codec.toDataTypeValue(value));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\tthrow refused(error);\n\t}\n\treturn {\n\t\tkind: \"wire\",\n\t\twire: await codec.toWire(decoded, {})\n\t};\n}\n/**\n* Reads and encodes each element of a list column's literal default with the column's codec, as {@link encodeLiteralDefault} does a single value, so a `null` element the codec refuses is SQL NULL. `undefined` when no codec descriptor has the column's codec id. An element the codec refuses is a `CONTRACT.DEFAULT_INVALID` naming the column and the element's 1-based position.\n*/\nasync function encodeListLiteralDefault(codecLookup, codecRef, elements, where) {\n\tconst codec = codecForRef(codecLookup, codecRef);\n\tif (codec === void 0) return void 0;\n\treturn Promise.all(elements.map((element, index) => encodeWithCodec(codec, codecRef, element, (cause) => refusedDefault(where, codecRef.codecId, element, index + 1, cause))));\n}\nasync function encodeWithCodec(codec, codecRef, value, refused) {\n\tlet decoded;\n\ttry {\n\t\tdecoded = readContractValue(codec, value, codecRef.typeParams);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\tif (value === null) return { kind: \"sql-null\" };\n\t\tthrow refused(error);\n\t}\n\treturn {\n\t\tkind: \"wire\",\n\t\twire: await codec.toWire(decoded, {})\n\t};\n}\nfunction refusedDefault(where, codecId, value, elementPosition, cause) {\n\tconst reason = cause instanceof Error ? cause.message : String(cause);\n\tconst subject = elementPosition === void 0 ? \"default\" : `default (element ${elementPosition})`;\n\treturn structuredError(\"CONTRACT.DEFAULT_INVALID\", `Column \"${where.table}\".\"${where.column}\" has a ${subject} its codec ${codecId} refuses: ${reason}`, {\n\t\twhy: \"A contract.json that an earlier version emitted, or a migration.ts it planned, can hold a default that this version's codec refuses, and so can either file after a hand edit.\",\n\t\tfix: \"If contract.json holds the default, emit the contract again with this version, and correct the default in the contract source if emit refuses it. If a migration.ts sets it, correct it in that file.\",\n\t\tcause,\n\t\tmeta: {\n\t\t\ttable: where.table,\n\t\t\tcolumn: where.column,\n\t\t\tcodecId,\n\t\t\tvalue,\n\t\t\t...ifDefined(\"elementPosition\", elementPosition),\n\t\t\treason: \"codec-refused-default\"\n\t\t}\n\t});\n}\n//#endregion\n//#region src/ast/json-value-projection.ts\nvar JsonValueProjection = class {\n\tvalue;\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n\tfold(folder) {\n\t\treturn this.value.fold(folder);\n\t}\n\tcollectColumnRefs() {\n\t\treturn this.value.collectColumnRefs();\n\t}\n\tcollectParamRefs() {\n\t\treturn this.value.collectParamRefs();\n\t}\n\tfreeze() {\n\t\tObject.freeze(this);\n\t}\n};\nvar CodecJsonValueProjection = class CodecJsonValueProjection extends JsonValueProjection {\n\tkind = \"codec\";\n\tcodec;\n\tconstructor(value, codec) {\n\t\tsuper(value);\n\t\tthis.codec = frozenCodecRef(codec);\n\t\tthis.freeze();\n\t}\n\taccept(visitor) {\n\t\treturn visitor.codec(this);\n\t}\n\trewrite(rewriter) {\n\t\treturn new CodecJsonValueProjection(this.value.rewrite(rewriter), this.codec);\n\t}\n};\nvar NativeJsonValueProjection = class NativeJsonValueProjection extends JsonValueProjection {\n\tkind = \"native\";\n\tconstructor(value) {\n\t\tsuper(value);\n\t\tthis.freeze();\n\t}\n\taccept(visitor) {\n\t\treturn visitor.native(this);\n\t}\n\trewrite(rewriter) {\n\t\treturn new NativeJsonValueProjection(this.value.rewrite(rewriter));\n\t}\n};\nvar JsonDocumentProjection = class JsonDocumentProjection extends JsonValueProjection {\n\tkind = \"document\";\n\tconstructor(value) {\n\t\tsuper(value);\n\t\tthis.freeze();\n\t}\n\taccept(visitor) {\n\t\treturn visitor.document(this);\n\t}\n\trewrite(rewriter) {\n\t\treturn new JsonDocumentProjection(this.value.rewrite(rewriter));\n\t}\n};\n//#endregion\n//#region src/ast/locking.ts\n/** The `ORM.LOCK_INCOMPATIBLE` error for a lock refused because of `conflict`. */\nfunction lockIncompatible(conflict, message) {\n\treturn structuredError(\"ORM.LOCK_INCOMPATIBLE\", message, { meta: { conflict } });\n}\n/** The capability each lock strength needs. */\nconst lockStrengthCapabilities = {\n\tforUpdate: { sql: { forUpdate: true } },\n\tforNoKeyUpdate: { postgres: { forNoKeyUpdate: true } },\n\tforShare: { sql: { forShare: true } },\n\tforKeyShare: { postgres: { forKeyShare: true } }\n};\n/** The capability each locking option needs; the wait-policy keys equal the `LockWaitPolicy` values. */\nconst lockOptionCapabilities = {\n\tof: { sql: { lockOf: true } },\n\tnowait: { sql: { lockNowait: true } },\n\tskipLocked: { sql: { lockSkipLocked: true } }\n};\n/** The first flag in `requirement` that `capabilities` does not report as `true`, as `group.flag`. */\nfunction missingCapability(capabilities, requirement) {\n\tfor (const [group, flags] of Object.entries(requirement)) for (const flag of Object.keys(flags)) if (capabilities[group]?.[flag] !== true) return `${group}.${flag}`;\n}\n/** Turns `{ nowait, skipLocked }` into a wait policy, refusing both together with `ORM.ARGUMENT_INVALID`. */\nfunction lockWaitPolicyOf(methodName, options) {\n\tif (options?.nowait && options.skipLocked) throw structuredError(\"ORM.ARGUMENT_INVALID\", `${methodName}() takes nowait or skipLocked, not both`, { meta: { method: methodName } });\n\tif (options?.nowait) return \"nowait\";\n\tif (options?.skipLocked) return \"skipLocked\";\n}\n//#endregion\n//#region src/ast/sql-codec-helpers.ts\n/**\n* Shared encode/decode constants and codec id literals for the five SQL base codecs (`sql/char@1`, `sql/varchar@1`, `sql/int@1`, `sql/float@1`, `sql/text@1`).\n*\n* The codec implementations live in `sql-codecs.ts` (TML-2357). This module retains only the conversion helpers the codec methods compose with — keeping a single source of truth for non-trivial conversions while the codec methods provide the framework-required `Promise<…>` boundary.\n*/\nconst SQL_CHAR_CODEC_ID = \"sql/char@1\";\nconst SQL_VARCHAR_CODEC_ID = \"sql/varchar@1\";\nconst SQL_INT_CODEC_ID = \"sql/int@1\";\nconst SQL_FLOAT_CODEC_ID = \"sql/float@1\";\nconst SQL_TEXT_CODEC_ID = \"sql/text@1\";\nconst SQL_RAW_CODEC_ID = \"sql/raw@1\";\nconst sqlCharEncode = (value) => value;\n/** A `character` value as the database returns it, without the spaces that pad it to its length. Only spaces pad it, so a trailing tab or newline is part of the value. */\nconst sqlCharDecode = (wire) => withoutTrailing(wire, \" \");\nconst sqlVarcharEncode = (value) => value;\nconst sqlVarcharDecode = (wire) => wire;\nconst sqlIntEncode = (value) => value;\nconst sqlIntDecode = (wire) => wire;\nconst sqlFloatEncode = (value) => value;\nconst sqlFloatDecode = (wire) => wire;\nconst sqlTextEncode = (value) => value;\nconst sqlTextDecode = (wire) => wire;\n//#endregion\n//#region src/ast/sql-codecs.ts\n/** A family codec has no data type of its own, so only a target that adapts it, naming its data type, builds its codec. A column helper below names the codec for a contract; the target's adapted descriptor builds it. */\nfunction unadapted(codecId) {\n\tthrow new InternalError(`${codecId} is a SQL family template. A target adapts it with its own data type and builds its codecs; the template builds none.`);\n}\nvar SqlTextCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn sqlTextEncode(value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn sqlTextDecode(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input);\n\t}\n};\nvar SqlTextDescriptor = class extends CodecDescriptorTemplateImpl {\n\tcodecId = SQL_TEXT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => unadapted(this.codecId);\n\t}\n};\nconst sqlTextDescriptor = new SqlTextDescriptor();\nconst sqlTextColumn = () => column(sqlTextDescriptor.factory(), sqlTextDescriptor.codecId, void 0);\nvar SqlIntCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn sqlIntEncode(value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn sqlIntDecode(wire);\n\t}\n\t/** A `number` holds an integer exactly only within the safe integer range. */\n\tfromDataTypeValue(value) {\n\t\treturn readJsonInteger(this.id, value.value, SAFE_INTEGER_RANGE);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input);\n\t}\n};\nvar SqlIntDescriptor = class extends CodecDescriptorTemplateImpl {\n\tcodecId = SQL_INT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => unadapted(this.codecId);\n\t}\n};\nconst sqlIntDescriptor = new SqlIntDescriptor();\nconst sqlIntColumn = () => column(sqlIntDescriptor.factory(), sqlIntDescriptor.codecId, void 0);\nvar SqlFloatCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn sqlFloatEncode(value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn sqlFloatDecode(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn readJsonFloat(this.id, value.value);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(floatToJson(input));\n\t}\n};\nvar SqlFloatDescriptor = class extends CodecDescriptorTemplateImpl {\n\tcodecId = SQL_FLOAT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => unadapted(this.codecId);\n\t}\n};\nconst sqlFloatDescriptor = new SqlFloatDescriptor();\nconst sqlFloatColumn = () => column(sqlFloatDescriptor.factory(), sqlFloatDescriptor.codecId, void 0);\nvar SqlCharCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn sqlCharEncode(value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn sqlCharDecode(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input);\n\t}\n};\nvar SqlCharDescriptor = class extends CodecDescriptorTemplateImpl {\n\tcodecId = SQL_CHAR_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\tparamsSchema = void 0;\n\tfactory(_params) {\n\t\treturn () => unadapted(this.codecId);\n\t}\n};\nconst sqlCharDescriptor = new SqlCharDescriptor();\nconst sqlCharColumn = (params = {}) => column(sqlCharDescriptor.factory(params), sqlCharDescriptor.codecId, params);\nvar SqlVarcharCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn sqlVarcharEncode(value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn sqlVarcharDecode(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input);\n\t}\n};\nvar SqlVarcharDescriptor = class extends CodecDescriptorTemplateImpl {\n\tcodecId = SQL_VARCHAR_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\tparamsSchema = void 0;\n\tfactory(_params) {\n\t\treturn () => unadapted(this.codecId);\n\t}\n};\nconst sqlVarcharDescriptor = new SqlVarcharDescriptor();\nconst sqlVarcharColumn = (params = {}) => column(sqlVarcharDescriptor.factory(params), sqlVarcharDescriptor.codecId, params);\nfunction isJsonValue(value) {\n\tif (value === null) return true;\n\tswitch (typeof value) {\n\t\tcase \"string\":\n\t\tcase \"boolean\": return true;\n\t\tcase \"number\": return Number.isFinite(value);\n\t\tcase \"object\":\n\t\t\tif (Array.isArray(value)) return value.every(isJsonValue);\n\t\t\treturn Object.getPrototypeOf(value) === Object.prototype && Object.values(value).every(isJsonValue);\n\t\tdefault: return false;\n\t}\n}\n/**\n* The codec of a raw column, whose type no other data type claims. Values pass through unchanged and\n* are typed `unknown`, since nothing is known about them beyond what the database returns. A raw\n* column has no literal values, but that is its data type's rule: the data type's reader refuses\n* every value, so `toDataTypeValue` refuses every literal. ADR 273.\n*/\nvar SqlRawCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn value;\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn wire;\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\tif (isJsonValue(input)) return this.dataTypeValueOf(input);\n\t\tthrow structuredError(\"RUNTIME.ENCODE_FAILED\", `${this.id} writes only JSON values as JSON`, { meta: { codecId: this.id } });\n\t}\n};\nvar SqlRawDescriptor = class extends CodecDescriptorTemplateImpl {\n\tcodecId = SQL_RAW_CODEC_ID;\n\ttraits = [];\n\tenumRefusal = \"A raw column has a type Prisma does not interpret, so no member can be written as one of its values. No enum can use the raw codec; use a text enum instead.\";\n\tparamsSchema = void 0;\n\tfactory(_params) {\n\t\treturn () => unadapted(this.codecId);\n\t}\n};\nconst sqlRawDescriptor = new SqlRawDescriptor();\nconst sqlRawColumn = (sql) => column(sqlRawDescriptor.factory({ sql }), sqlRawDescriptor.codecId, { sql });\n//#endregion\nexport { AggregateExpr, AndExpr, BinaryExpr, CaseExpr, CastExpr, CheckExpressionConstraint, CodecJsonValueProjection, ColumnRef, DdlColumn, DdlColumnDefault, DdlNode, DefaultValueExpr, DeleteAst, DerivedTableSource, DoNothingConflictAction, DoUpdateSetConflictAction, EqColJoinOn, ExistsExpr, ForeignKeyConstraint, FunctionCallExpr, FunctionColumnDefault, FunctionSource, IdentifierRef, InsertAst, InsertOnConflict, JoinAst, JsonArrayAggExpr, JsonDocumentProjection, JsonObjectExpr, ListExpression, LiteralColumnDefault, LiteralExpr, LockingClause, NativeJsonValueProjection, NotExpr, NullCheckExpr, OpaqueSql, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedParamRef, PrimaryKeyConstraint, ProjectionItem, RawExpr, RawQueryAst, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_RAW_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID, SelectAst, SqlCharCodec, SqlCharDescriptor, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlRawCodec, SqlRawDescriptor, SqlTextCodec, SqlTextDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableSource, UniqueConstraint, UpdateAst, WindowFuncExpr, aggregateFnNames, checkLimitOffset, collectOrderedParamRefs, compact, encodeListLiteralDefault, encodeLiteralDefault, frozenCodecRef, isAggregateFn, isAggregateProjection, isDdlNode, isOrderByDirection, isOrderByNulls, isQueryAst, isWhereExpr, lockIncompatible, lockOptionCapabilities, lockStrengthCapabilities, lockWaitPolicyOf, missingCapability, opaqueSql, queryAstKinds, renderOpaqueSql, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlFloatColumn, sqlFloatDecode, sqlFloatDescriptor, sqlFloatEncode, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlRawColumn, sqlRawDescriptor, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, whereExprKinds };\n\n//# sourceMappingURL=ast.mjs.map"],"mappings":";;;;;;;;;;;;AAcA,eAAe,qBAAqB,aAAa,UAAU,OAAO,OAAO;CACxE,MAAM,QAAQ,YAAY,aAAa,QAAQ;CAC/C,IAAI,UAAU,KAAK,GAAG,OAAO,KAAK;CAClC,MAAM,WAAW,UAAU,eAAe,OAAO,SAAS,SAAS,OAAO,KAAK,GAAG,KAAK;CACvF,IAAI,iBAAiB,MAAM,OAAO,WAAW,OAAO,OAAO,OAAO;CAClE,OAAO,gBAAgB,OAAO,UAAU,OAAO,OAAO;AACvD;AACA,eAAe,WAAW,OAAO,OAAO,SAAS;CAChD,IAAI;CACJ,IAAI;EACH,UAAU,MAAM,kBAAkB,MAAM,gBAAgB,KAAK,CAAC;CAC/D,SAAS,OAAO;EACf,IAAI,gBAAgB,KAAK,GAAG,MAAM;EAClC,MAAM,QAAQ,KAAK;CACpB;CACA,OAAO;EACN,MAAM;EACN,MAAM,MAAM,MAAM,OAAO,SAAS,CAAC,CAAC;CACrC;AACD;;;;AAIA,eAAe,yBAAyB,aAAa,UAAU,UAAU,OAAO;CAC/E,MAAM,QAAQ,YAAY,aAAa,QAAQ;CAC/C,IAAI,UAAU,KAAK,GAAG,OAAO,KAAK;CAClC,OAAO,QAAQ,IAAI,SAAS,KAAK,SAAS,UAAU,gBAAgB,OAAO,UAAU,UAAU,UAAU,eAAe,OAAO,SAAS,SAAS,SAAS,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC;AAC9K;AACA,eAAe,gBAAgB,OAAO,UAAU,OAAO,SAAS;CAC/D,IAAI;CACJ,IAAI;EACH,UAAU,kBAAkB,OAAO,OAAO,SAAS,U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AM,OAAO,aAAa,OAAO,OAAO,KAAK,CAAC,CAAC,MAAM,WAAW;EACnG,SAAS,OAAO;CACjB;AACD;;;;;;;AAOA,IAAI,cAAc,cAAc,UAAU;CACzC,MAAM,OAAO,OAAO,MAAM;EACzB,OAAO;CACR;CACA,MAAM,SAAS,MAAM,MAAM;EAC1B,OAAO;CACR;CACA,kBAAkB,OAAO;EACxB,OAAO,MAAM;CACd;CACA,gBAAgB,OAAO;EACtB,IAAI,YAAY,KAAK,GAAG,OAAO,KAAK,gBAAgB,KAAK;EACzD,MAAM,gBAAgB,yBAAyB,GAAG,KAAK,GAAG,mCAAmC,EAAE,MAAM,EAAE,SAAS,KAAK,GAAG,EAAE,CAAC;CAC5H;AACD;AACA,IAAI,mBAAmB,cAAc,4BAA4B;CAChE,UAAU;CACV,SAAS,CAAC;CACV,cAAc;CACd,eAAe,KAAK;CACpB,QAAQ,SAAS;EAChB,aAAa,UAAU,KAAK,OAAO;CACpC;AACD;AACA,MAAM,mBAAmB,IAAI,iBAAiB;AAC9C,MAAM,gBAAgB,QAAQ,OAAO,iBAAiB,QAAQ,EAAE,IAAI,CAAC,GAAG,iBAAiB,SAAS,EAAE,IAAI,CAAC"}
@@ -157,6 +157,7 @@ declare const SQL_VARCHAR_CODEC_ID: "sql/varchar@1";
157
157
  declare const SQL_INT_CODEC_ID: "sql/int@1";
158
158
  declare const SQL_FLOAT_CODEC_ID: "sql/float@1";
159
159
  declare const SQL_TEXT_CODEC_ID: "sql/text@1";
160
+ declare const SQL_RAW_CODEC_ID: "sql/raw@1";
160
161
  declare const sqlCharEncode: (value: string) => string;
161
162
  /** A `character` value as the database returns it, without the spaces that pad it to its length. Only spaces pad it, so a trailing tab or newline is part of the value. */
162
163
  declare const sqlCharDecode: (wire: string) => string;
@@ -244,6 +245,32 @@ declare class SqlVarcharDescriptor extends CodecDescriptorTemplateImpl<LengthPar
244
245
  }
245
246
  declare const sqlVarcharDescriptor: SqlVarcharDescriptor;
246
247
  declare const sqlVarcharColumn: (params?: LengthParams) => import("@prisma/orm-framework/components/codec").ColumnSpec<SqlVarcharCodec, LengthParams>;
248
+ type RawParams = {
249
+ readonly sql: string;
250
+ };
251
+ /**
252
+ * The codec of a raw column, whose type no other data type claims. Values pass through unchanged and
253
+ * are typed `unknown`, since nothing is known about them beyond what the database returns. A raw
254
+ * column has no literal values, but that is its data type's rule: the data type's reader refuses
255
+ * every value, so `toDataTypeValue` refuses every literal. ADR 273.
256
+ */
257
+ declare class SqlRawCodec extends CodecImpl<typeof SQL_RAW_CODEC_ID, readonly [], unknown, unknown> {
258
+ toWire(value: unknown, _ctx: CodecCallContext): Promise<unknown>;
259
+ fromWire(wire: unknown, _ctx: CodecCallContext): Promise<unknown>;
260
+ fromDataTypeValue(value: DataTypeValue): unknown;
261
+ toDataTypeValue(input: unknown): DataTypeValue;
262
+ }
263
+ declare class SqlRawDescriptor extends CodecDescriptorTemplateImpl<RawParams> {
264
+ readonly codecId: "sql/raw@1";
265
+ readonly traits: readonly [];
266
+ readonly enumRefusal = "A raw column has a type Prisma does not interpret, so no member can be written as one of its values. No enum can use the raw codec; use a text enum instead.";
267
+ readonly paramsSchema: undefined;
268
+ factory(_params: RawParams): (ctx: CodecInstanceContext) => SqlRawCodec;
269
+ }
270
+ declare const sqlRawDescriptor: SqlRawDescriptor;
271
+ declare const sqlRawColumn: (sql: string) => import("@prisma/orm-framework/components/codec").ColumnSpec<SqlRawCodec, {
272
+ sql: string;
273
+ }>;
247
274
  //#endregion
248
275
  //#region src/ast/util.d.ts
249
276
  declare function compact<T extends Record<string, unknown>>(o: T): T;
@@ -261,5 +288,5 @@ declare function collectOrderedParamRefs(ast: AnyQueryAst): ReadonlyArray<AnyPar
261
288
  /** Whether a projection item's top-level expression is an aggregate, `json_agg` or window function. Nested expressions are not inspected. */
262
289
  declare function isAggregateProjection(item: ProjectionItem): boolean;
263
290
  //#endregion
264
- export { sqlTextDecode as $, collectOrderedParamRefs as A, sqlCharColumn as B, SqlFloatDescriptor as C, SqlTextDescriptor as D, SqlTextCodec as E, lockIncompatible as F, sqlFloatDecode as G, sqlCharDescriptor as H, lockOptionCapabilities as I, sqlIntColumn as J, sqlFloatDescriptor as K, lockStrengthCapabilities as L, encodeListLiteralDefault as M, encodeLiteralDefault as N, SqlVarcharCodec as O, isAggregateProjection as P, sqlTextColumn as Q, lockWaitPolicyOf as R, SqlFloatCodec as S, SqlIntDescriptor as T, sqlCharEncode as U, sqlCharDecode as V, sqlFloatColumn as W, sqlIntDescriptor as X, sqlIntDecode as Y, sqlIntEncode as Z, SQL_INT_CODEC_ID as _, EncodedLiteralDefault as a, sqlVarcharEncode as at, SqlCharCodec as b, LockOptionCapabilities as c, LockWaitRequest as d, sqlTextDescriptor as et, Lowerer as f, SQL_FLOAT_CODEC_ID as g, SQL_CHAR_CODEC_ID as h, CapabilityRequirement as i, sqlVarcharDescriptor as it, compact as j, SqlVarcharDescriptor as k, LockStrengthCapabilities as l, MarkerReadResult as m, AdapterProfile as n, sqlVarcharColumn as nt, LiteralDefaultColumn as o, LowererContext as p, sqlFloatEncode as q, AdapterTarget as r, sqlVarcharDecode as rt, LockConflict as s, Adapter as t, sqlTextEncode as tt, LockWaitOptions as u, SQL_TEXT_CODEC_ID as v, SqlIntCodec as w, SqlCharDescriptor as x, SQL_VARCHAR_CODEC_ID as y, missingCapability as z };
265
- //# sourceMappingURL=ast-Cq7uhA86.d.mts.map
291
+ export { sqlIntDescriptor as $, SqlTextDescriptor as A, lockStrengthCapabilities as B, SqlFloatCodec as C, SqlRawCodec as D, SqlIntDescriptor as E, encodeListLiteralDefault as F, sqlCharDescriptor as G, missingCapability as H, encodeLiteralDefault as I, sqlFloatDecode as J, sqlCharEncode as K, isAggregateProjection as L, SqlVarcharDescriptor as M, collectOrderedParamRefs as N, SqlRawDescriptor as O, compact as P, sqlIntDecode as Q, lockIncompatible as R, SqlCharDescriptor as S, SqlIntCodec as T, sqlCharColumn as U, lockWaitPolicyOf as V, sqlCharDecode as W, sqlFloatEncode as X, sqlFloatDescriptor as Y, sqlIntColumn as Z, SQL_INT_CODEC_ID as _, EncodedLiteralDefault as a, sqlTextDescriptor as at, SQL_VARCHAR_CODEC_ID as b, LockOptionCapabilities as c, sqlVarcharDecode as ct, LockWaitRequest as d, sqlIntEncode as et, Lowerer as f, SQL_FLOAT_CODEC_ID as g, SQL_CHAR_CODEC_ID as h, CapabilityRequirement as i, sqlTextDecode as it, SqlVarcharCodec as j, SqlTextCodec as k, LockStrengthCapabilities as l, sqlVarcharDescriptor as lt, MarkerReadResult as m, AdapterProfile as n, sqlRawDescriptor as nt, LiteralDefaultColumn as o, sqlTextEncode as ot, LowererContext as p, sqlFloatColumn as q, AdapterTarget as r, sqlTextColumn as rt, LockConflict as s, sqlVarcharColumn as st, Adapter as t, sqlRawColumn as tt, LockWaitOptions as u, sqlVarcharEncode as ut, SQL_RAW_CODEC_ID as v, SqlFloatDescriptor as w, SqlCharCodec as x, SQL_TEXT_CODEC_ID as y, lockOptionCapabilities as z };
292
+ //# sourceMappingURL=ast-DB7g9Mh2.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-DB7g9Mh2.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/ast.d.mts"],"mappings":";;;;;;;;KAOK;;;;;;;KAOA;WACM;WACA,QAAQ;;WAER;;WAEA;;UAED,eAAe,gBAAgB,gBAAgB;WAC9C;WACA,QAAQ;WACR,cAAc;;;;EAIvB,WAAW,WAAW,eAAe,QAAQ;;UAErC,eAAe;WACd,UAAU;WACV;;KAEN,QAAQ,eAAe,qBAAqB,QAAQ,qBAAqB,KAAK,KAAK,SAAS,eAAe,eAAe;;;;UAIrH,QAAQ,eAAe,qBAAqB,QAAQ;WACnD,SAAS;EAClB,MAAM,KAAK,KAAK,SAAS,eAAe,aAAa;;;;;KAKlD;WACM;;WAEA;WACA;;;UAGD;WACC;WACA;;;;;;;iBAOM,qBAAqB,aAAa,KAAK,8CAA8C,UAAU,YAAU,OAAO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Subquery, r as Functions } from "./functions-LyIMc_v9.mjs";
3
- import { C as WhereFilter, S as UpdateQuery, d as QueryContext, g as SelectQuery, h as Scope, i as DeleteQuery, l as InsertQuery, m as ResolveRow, o as GatedMethod, r as Db, s as GroupedQuery, t as AggregateFunctions, y as TableProxy } from "./db-BmrN9nRS-BzK96yVh.mjs";
3
+ import { C as WhereFilter, S as UpdateQuery, d as QueryContext, g as SelectQuery, h as Scope, i as DeleteQuery, l as InsertQuery, m as ResolveRow, o as GatedMethod, r as Db, s as GroupedQuery, t as AggregateFunctions, y as TableProxy } from "./db-BmrN9nRS-BGnRxI7X.mjs";
4
4
  export type { AggregateFunctions, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, InsertQuery, QueryContext, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableProxy, UpdateQuery, WhereFilter };
@@ -5,7 +5,7 @@ import { l as RawCodecInferer } from "./expression-BzrfOiPC-CXjjRKqc.mjs";
5
5
  import { t as ExpressionImpl } from "./expression-sOY1120I-DMTeGMQP.mjs";
6
6
  import "./expression-CIBqCwC1.mjs";
7
7
  import { s as createFunctions } from "./functions-LyIMc_v9.mjs";
8
- import { a as FieldProxy, b as TableProxyContract, d as QueryContext, f as RawLane, h as Scope, r as Db, t as AggregateFunctions } from "./db-BmrN9nRS-BzK96yVh.mjs";
8
+ import { a as FieldProxy, b as TableProxyContract, d as QueryContext, f as RawLane, h as Scope, r as Db, t as AggregateFunctions } from "./db-BmrN9nRS-BGnRxI7X.mjs";
9
9
  import { a as SqlAggregateDescriptorRegistry, n as ExecutionContext } from "./query-lane-context-BLOPW1rQ-4vNq0fxJ.mjs";
10
10
  import "./query-lane-context-BPJrXopg.mjs";
11
11
  import { Contract } from "@prisma/orm-framework/contract/types";
@@ -1,6 +1,6 @@
1
1
  import { A as ParamRef, F as SelectAst, G as isOrderByNulls, L as TableSource, M as ProjectionItem, R as UpdateAst, U as isAggregateFn, W as isOrderByDirection, _ as InsertAst, c as DeleteAst, g as IdentifierRef, k as OrderByItem, l as DerivedTableSource, n as AndExpr, o as ColumnRef, t as AggregateExpr, w as LockingClause, y as JoinAst } from "./types-NTQsD2MS-DAP2yVDn.mjs";
2
2
  import { r as isAggregateProjection, t as collectOrderedParamRefs } from "./util-BBgcP3gI-XJBkxo1K.mjs";
3
- import { C as lockStrengthCapabilities, S as lockOptionCapabilities, w as lockWaitPolicyOf, x as lockIncompatible } from "./ast-CBO3PEJF.mjs";
3
+ import { D as lockWaitPolicyOf, E as lockStrengthCapabilities, T as lockOptionCapabilities, w as lockIncompatible } from "./ast-BJs2669T.mjs";
4
4
  import { i as createRawSql, s as toExpr, t as ExpressionImpl } from "./expression-impl-B-XNINxr-vYwKVFeP.mjs";
5
5
  import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-4kw8FPpo.mjs";
6
6
  import { t as createFunctions } from "./functions-0YWByawj.mjs";
@@ -2,5 +2,5 @@ import { o as Expression, x as ScopeField } from "./expression-BzrfOiPC-CXjjRKqc
2
2
  import { a as Subquery, r as Functions, t as BooleanCodecType } from "./functions-LyIMc_v9.mjs";
3
3
  import { t as IndexReference } from "./index-reference-DJaQLZA3-DS-GPKXs.mjs";
4
4
  import "./index-reference-CsxaNof9.mjs";
5
- import { C as WhereFilter, S as UpdateQuery, _ as TableInAnyNamespace, b as TableProxyContract, c as IndexReferences, d as QueryContext, f as RawLane, g as SelectQuery, h as Scope, i as DeleteQuery, l as InsertQuery, m as ResolveRow, n as ContractRawTag, o as GatedMethod, p as RawTagFor, r as Db, s as GroupedQuery, t as AggregateFunctions, u as Namespace, v as TableNamesAcrossNamespaces, x as UnboundTables, y as TableProxy } from "./db-BmrN9nRS-BzK96yVh.mjs";
5
+ import { C as WhereFilter, S as UpdateQuery, _ as TableInAnyNamespace, b as TableProxyContract, c as IndexReferences, d as QueryContext, f as RawLane, g as SelectQuery, h as Scope, i as DeleteQuery, l as InsertQuery, m as ResolveRow, n as ContractRawTag, o as GatedMethod, p as RawTagFor, r as Db, s as GroupedQuery, t as AggregateFunctions, u as Namespace, v as TableNamesAcrossNamespaces, x as UnboundTables, y as TableProxy } from "./db-BmrN9nRS-BGnRxI7X.mjs";
6
6
  export type { AggregateFunctions, BooleanCodecType, ContractRawTag, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, IndexReference, IndexReferences, InsertQuery, Namespace, QueryContext, RawLane, RawTagFor, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableInAnyNamespace, TableNamesAcrossNamespaces, TableProxy, TableProxyContract, UnboundTables, UpdateQuery, WhereFilter };
@@ -1,4 +1,4 @@
1
- import { n as buildSqlContractFromDefinition, r as contractError, t as applySqlSpecifierControlPolicy } from "./derived-checks-CdPHpJSv-B7Bgj3Ao.mjs";
1
+ import { n as buildSqlContractFromDefinition, r as contractError, t as applySqlSpecifierControlPolicy } from "./derived-checks-B1qNxwBL-DFoGexId.mjs";
2
2
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
3
3
  import { createDataTypeLookup, emptyCodecLookup } from "@prisma/orm-framework/components/codec";
4
4
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
@@ -65,4 +65,4 @@ function typescriptContractFromPath(contractPath, output, options) {
65
65
  //#endregion
66
66
  export { typescriptContract as n, typescriptContractFromPath as r, emptyContract as t };
67
67
 
68
- //# sourceMappingURL=config-types-vu5fTaRa.mjs.map
68
+ //# sourceMappingURL=config-types-BkcCqeAg.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-types-vu5fTaRa.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/config-types.mjs"],"sourcesContent":["import { n as buildSqlContractFromDefinition, o as contractError, t as applySqlSpecifierControlPolicy } from \"./derived-checks-CdPHpJSv.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { createDataTypeLookup, emptyCodecLookup } from \"@internal/framework-components/codec\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { pathToFileURL } from \"node:url\";\nimport { ok } from \"@internal/utils/result\";\nimport { extname } from \"pathe\";\n//#region src/config-types.ts\n/**\n* Derives the emit output path from the TS contract input so artefacts land\n* colocated with the source (e.g. `prisma/contract.ts` →\n* `prisma/contract.json`). Mirrors the same default-derivation logic in\n* `@internal/sql-contract-psl/provider`.\n*/\nfunction defaultOutputFromContractPath(contractPath) {\n\tconst ext = extname(contractPath);\n\tif (ext.length === 0) return `${contractPath}.json`;\n\treturn `${contractPath.slice(0, -ext.length)}.json`;\n}\nfunction emptyContract(options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tload: async () => {\n\t\t\t\treturn ok(applySqlSpecifierControlPolicy(buildSqlContractFromDefinition({\n\t\t\t\t\twarnings: void 0,\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\tcreateNamespace: options.createNamespace,\n\t\t\t\t\tmodels: []\n\t\t\t\t}, {\n\t\t\t\t\t...emptyCodecLookup,\n\t\t\t\t\tdescriptorFor: () => void 0\n\t\t\t\t}, createDataTypeLookup([])), options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\t...ifDefined(\"output\", options.output)\n\t};\n}\nfunction typescriptContract(contract, output, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tload: async () => ok(options === void 0 ? contract : applySqlSpecifierControlPolicy(contract, options.defaultControlPolicy, options.createNamespace))\n\t\t},\n\t\t...ifDefined(\"output\", output)\n\t};\n}\nfunction typescriptContractFromPath(contractPath, output, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tinputs: [contractPath],\n\t\t\tload: async (context) => {\n\t\t\t\tconst [absolutePath] = context.resolvedInputs;\n\t\t\t\tif (absolutePath === void 0) throw new InternalError(\"typescriptContractFromPath: context.resolvedInputs is empty. The CLI config loader should populate it from source.inputs.\");\n\t\t\t\tconst mod = await import(pathToFileURL(absolutePath).href);\n\t\t\t\tconst contract = mod.default ?? mod.contract;\n\t\t\t\tif (contract === void 0) throw contractError(\"CONTRACT.MODULE_EXPORT_MISSING\", `typescriptContractFromPath: module at \"${absolutePath}\" has no \"default\" or \"contract\" export.`, { meta: { path: absolutePath } });\n\t\t\t\treturn ok(options === void 0 ? contract : applySqlSpecifierControlPolicy(contract, options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: output ?? defaultOutputFromContractPath(contractPath)\n\t};\n}\n//#endregion\nexport { emptyContract, typescriptContract, typescriptContractFromPath };\n\n//# sourceMappingURL=config-types.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,8BAA8B,cAAc;CACpD,MAAM,MAAM,QAAQ,YAAY;CAChC,IAAI,IAAI,WAAW,GAAG,OAAO,GAAG,aAAa;CAC7C,OAAO,GAAG,aAAa,MAAM,GAAG,CAAC,IAAI,MAAM,EAAE;AAC9C;AACA,SAAS,cAAc,SAAS;CAC/B,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,MAAM,YAAY;IACjB,OAAO,GAAG,+BAA+B,+BAA+B;KACvE,UAAU,KAAK;KACf,QAAQ,QAAQ;KAChB,iBAAiB,QAAQ;KACzB,QAAQ,CAAC;IACV,GAAG;KACF,GAAG;KACH,qBAAqB,KAAK;IAC3B,GAAG,qBAAqB,CAAC,CAAC,CAAC,GAAG,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GACrF;EACD;EACA,GAAG,UAAU,UAAU,QAAQ,MAAM;CACtC;AACD;AACA,SAAS,mBAAmB,UAAU,QAAQ,SAAS;CACtD,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,MAAM,YAAY,GAAG,YAAY,KAAK,IAAI,WAAW,+BAA+B,UAAU,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;EACrJ;EACA,GAAG,UAAU,UAAU,MAAM;CAC9B;AACD;AACA,SAAS,2BAA2B,cAAc,QAAQ,SAAS;CAClE,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,QAAQ,CAAC,YAAY;GACrB,MAAM,OAAO,YAAY;IACxB,MAAM,CAAC,gBAAgB,QAAQ;IAC/B,IAAI,iBAAiB,KAAK,GAAG,MAAM,IAAI,cAAc,2HAA2H;IAChL,MAAM,MAAM,MAAM,OAAO,cAAc,YAAY,CAAC,CAAC;IACrD,MAAM,WAAW,IAAI,WAAW,IAAI;IACpC,IAAI,aAAa,KAAK,GAAG,MAAM,cAAc,kCAAkC,0CAA0C,aAAa,2CAA2C,EAAE,MAAM,EAAE,MAAM,aAAa,EAAE,CAAC;IACjN,OAAO,GAAG,YAAY,KAAK,IAAI,WAAW,+BAA+B,UAAU,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GAC1I;EACD;EACA,QAAQ,UAAU,8BAA8B,YAAY;CAC7D;AACD"}
1
+ {"version":3,"file":"config-types-BkcCqeAg.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/config-types.mjs"],"sourcesContent":["import { n as buildSqlContractFromDefinition, o as contractError, t as applySqlSpecifierControlPolicy } from \"./derived-checks-B1qNxwBL.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { createDataTypeLookup, emptyCodecLookup } from \"@internal/framework-components/codec\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { pathToFileURL } from \"node:url\";\nimport { ok } from \"@internal/utils/result\";\nimport { extname } from \"pathe\";\n//#region src/config-types.ts\n/**\n* Derives the emit output path from the TS contract input so artefacts land\n* colocated with the source (e.g. `prisma/contract.ts` →\n* `prisma/contract.json`). Mirrors the same default-derivation logic in\n* `@internal/sql-contract-psl/provider`.\n*/\nfunction defaultOutputFromContractPath(contractPath) {\n\tconst ext = extname(contractPath);\n\tif (ext.length === 0) return `${contractPath}.json`;\n\treturn `${contractPath.slice(0, -ext.length)}.json`;\n}\nfunction emptyContract(options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tload: async () => {\n\t\t\t\treturn ok(applySqlSpecifierControlPolicy(buildSqlContractFromDefinition({\n\t\t\t\t\twarnings: void 0,\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\tcreateNamespace: options.createNamespace,\n\t\t\t\t\tmodels: []\n\t\t\t\t}, {\n\t\t\t\t\t...emptyCodecLookup,\n\t\t\t\t\tdescriptorFor: () => void 0\n\t\t\t\t}, createDataTypeLookup([])), options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\t...ifDefined(\"output\", options.output)\n\t};\n}\nfunction typescriptContract(contract, output, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tload: async () => ok(options === void 0 ? contract : applySqlSpecifierControlPolicy(contract, options.defaultControlPolicy, options.createNamespace))\n\t\t},\n\t\t...ifDefined(\"output\", output)\n\t};\n}\nfunction typescriptContractFromPath(contractPath, output, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tinputs: [contractPath],\n\t\t\tload: async (context) => {\n\t\t\t\tconst [absolutePath] = context.resolvedInputs;\n\t\t\t\tif (absolutePath === void 0) throw new InternalError(\"typescriptContractFromPath: context.resolvedInputs is empty. The CLI config loader should populate it from source.inputs.\");\n\t\t\t\tconst mod = await import(pathToFileURL(absolutePath).href);\n\t\t\t\tconst contract = mod.default ?? mod.contract;\n\t\t\t\tif (contract === void 0) throw contractError(\"CONTRACT.MODULE_EXPORT_MISSING\", `typescriptContractFromPath: module at \"${absolutePath}\" has no \"default\" or \"contract\" export.`, { meta: { path: absolutePath } });\n\t\t\t\treturn ok(options === void 0 ? contract : applySqlSpecifierControlPolicy(contract, options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: output ?? defaultOutputFromContractPath(contractPath)\n\t};\n}\n//#endregion\nexport { emptyContract, typescriptContract, typescriptContractFromPath };\n\n//# sourceMappingURL=config-types.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,8BAA8B,cAAc;CACpD,MAAM,MAAM,QAAQ,YAAY;CAChC,IAAI,IAAI,WAAW,GAAG,OAAO,GAAG,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"}
@@ -1,8 +1,8 @@
1
1
  import { t as providesEntityHandleLowering } from "./entity-handle-lowering-hook-B3atrRKX.mjs";
2
2
  import { a as isSqlExpression, c as requireSqlExpression, r as SqlExpression, s as readSqlExpression } from "./sql-expression-BJCuy-WI.mjs";
3
3
  import { t as CODEC_INSTANCE_KIND } from "./types-M_FeBD9w.mjs";
4
- import { n as checkSqlDefaultText, o as reservedSqlDefaultText } from "./validators-BCRydDG7.mjs";
5
- import { n as buildSqlContractFromDefinition, o as toOneNullabilityContradictionMessage, r as contractError } from "./derived-checks-CdPHpJSv-B7Bgj3Ao.mjs";
4
+ import { n as checkSqlDefaultText, o as reservedSqlDefaultText } from "./validators-BlONfdFH.mjs";
5
+ import { n as buildSqlContractFromDefinition, o as toOneNullabilityContradictionMessage, r as contractError } from "./derived-checks-B1qNxwBL-DFoGexId.mjs";
6
6
  import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
7
7
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
8
8
  import { assertNoCrossRegistryCollisions, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, isAuthoringTypeConstructorDescriptor, validateAuthoringHelperArguments, validateAuthoringTypeParams } from "@prisma/orm-framework/components/authoring";
@@ -1794,4 +1794,4 @@ function autoincrement() {
1794
1794
  //#endregion
1795
1795
  export { check as a, enumType as c, member as d, model as f, buildContractDefinition as i, extensionModel as l, rel as m, bindEnumType as n, createComposedAuthoringHelpers as o, now as p, buildBoundContract as r, defineContract as s, autoincrement as t, field as u };
1796
1796
 
1797
- //# sourceMappingURL=contract-builder-DmX4XnJa.mjs.map
1797
+ //# sourceMappingURL=contract-builder-D3XaKpyw.mjs.map