@prisma/orm-family-sql 8.0.0-rc.13-dev.11 → 8.0.0-rc.13-dev.12

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 (127) hide show
  1. package/dist/{ast-Bhj549wG.mjs → ast-CJd4157-.mjs} +262 -2
  2. package/dist/ast-CJd4157-.mjs.map +1 -0
  3. package/dist/{ast-B9jF6tRJ.d.mts → ast-DQU1yUQ5.d.mts} +30 -2
  4. package/dist/ast-DQU1yUQ5.d.mts.map +1 -0
  5. package/dist/{authored-check-naming-9UFx77db.mjs → authored-check-naming-CJRDf9-V.mjs} +3 -3
  6. package/dist/{authored-check-naming-9UFx77db.mjs.map → authored-check-naming-CJRDf9-V.mjs.map} +1 -1
  7. package/dist/{authoring-type-constructors-DQZEX4Sb-DORF5BnN.mjs → authoring-type-constructors-DQZEX4Sb-DXWRbv5g.mjs} +2 -2
  8. package/dist/{authoring-type-constructors-DQZEX4Sb-DORF5BnN.mjs.map → authoring-type-constructors-DQZEX4Sb-DXWRbv5g.mjs.map} +1 -1
  9. package/dist/builder.d.mts +1 -1
  10. package/dist/builder__runtime.d.mts +2 -2
  11. package/dist/builder__runtime.mjs +1 -1
  12. package/dist/builder__types.d.mts +1 -1
  13. package/dist/{codec-descriptor-registry-ECZ4ohtG.mjs → codec-descriptor-registry-Cj-tqpFL.mjs} +2 -2
  14. package/dist/{codec-descriptor-registry-ECZ4ohtG.mjs.map → codec-descriptor-registry-Cj-tqpFL.mjs.map} +1 -1
  15. package/dist/{config-types-DlxXpXqA.mjs → config-types-Di1Q5l7a.mjs} +2 -2
  16. package/dist/{config-types-DlxXpXqA.mjs.map → config-types-Di1Q5l7a.mjs.map} +1 -1
  17. package/dist/{contract-builder-BKfGg37_.mjs → contract-builder-CqKOW_SG.mjs} +4 -4
  18. package/dist/{contract-builder-BKfGg37_.mjs.map → contract-builder-CqKOW_SG.mjs.map} +1 -1
  19. package/dist/contract-prisma7__provider.mjs +3 -3
  20. package/dist/contract-psl.mjs +1 -1
  21. package/dist/contract-psl__provider.mjs +2 -2
  22. package/dist/contract-ts.mjs +3 -3
  23. package/dist/contract-ts__config-types.mjs +1 -1
  24. package/dist/contract-ts__contract-builder.mjs +2 -2
  25. package/dist/contract.mjs +9 -9
  26. package/dist/contract__authored-check-naming.mjs +1 -1
  27. package/dist/contract__entity-kinds.mjs +1 -1
  28. package/dist/contract__factories.mjs +1 -1
  29. package/dist/contract__foreign-key-materialization.mjs +1 -1
  30. package/dist/contract__index-naming.mjs +1 -1
  31. package/dist/contract__types.mjs +3 -3
  32. package/dist/contract__validators.mjs +2 -2
  33. package/dist/{control-8NqI46OK.mjs → control-D2BWxH9A.mjs} +34 -17
  34. package/dist/control-D2BWxH9A.mjs.map +1 -0
  35. package/dist/{control-adapter-C99J7aEF-Bu-VCRbv.d.mts → control-adapter-C99J7aEF-B571Jffd.d.mts} +4 -4
  36. package/dist/{control-adapter-C99J7aEF-Bu-VCRbv.d.mts.map → control-adapter-C99J7aEF-B571Jffd.d.mts.map} +1 -1
  37. package/dist/control-adapter-jmL_K-jB.d.mts +1 -0
  38. package/dist/{control-VctoviCf.d.mts → control-kbS8DWF0.d.mts} +26 -9
  39. package/dist/{control-VctoviCf.d.mts.map → control-kbS8DWF0.d.mts.map} +1 -1
  40. package/dist/{db-DLjWu9-f-6BG2QArC.d.mts → db-DLjWu9-f-CVAu8jgd.d.mts} +2 -2
  41. package/dist/{db-DLjWu9-f-6BG2QArC.d.mts.map → db-DLjWu9-f-CVAu8jgd.d.mts.map} +1 -1
  42. package/dist/{derived-checks-Bsrdb2Wk-D4UfM06W.mjs → derived-checks-Bsrdb2Wk-rF0rGsWO.mjs} +10 -10
  43. package/dist/{derived-checks-Bsrdb2Wk-D4UfM06W.mjs.map → derived-checks-Bsrdb2Wk-rF0rGsWO.mjs.map} +1 -1
  44. package/dist/{diff-B2b34L_E.d.mts → diff-BxwNI8yE.d.mts} +6 -6
  45. package/dist/{diff-B2b34L_E.d.mts.map → diff-BxwNI8yE.d.mts.map} +1 -1
  46. package/dist/{entity-kinds-D7vwoN_T-CCBwFJy0.mjs → entity-kinds-D7vwoN_T-NmeI6TpT.mjs} +3 -3
  47. package/dist/{entity-kinds-D7vwoN_T-CCBwFJy0.mjs.map → entity-kinds-D7vwoN_T-NmeI6TpT.mjs.map} +1 -1
  48. package/dist/{factories-SVor5xIT.mjs → factories-aJoZYxkD.mjs} +3 -3
  49. package/dist/{factories-SVor5xIT.mjs.map → factories-aJoZYxkD.mjs.map} +1 -1
  50. package/dist/family.d.mts +9 -9
  51. package/dist/family.mjs +7 -7
  52. package/dist/family__control-adapter.d.mts +2 -2
  53. package/dist/family__control.d.mts +4 -4
  54. package/dist/family__control.mjs +4 -4
  55. package/dist/family__diff.d.mts +2 -2
  56. package/dist/family__diff.mjs +1 -1
  57. package/dist/family__ir.mjs +1 -1
  58. package/dist/family__migration.d.mts +1 -1
  59. package/dist/family__pack.mjs +1 -1
  60. package/dist/family__psl-build.mjs +1 -1
  61. package/dist/family__psl-infer.d.mts +1 -1
  62. package/dist/family__psl-infer.mjs +1 -1
  63. package/dist/{foreign-key-materialization-B3HQzQIA.mjs → foreign-key-materialization-DiOhEeAz.mjs} +3 -3
  64. package/dist/{foreign-key-materialization-B3HQzQIA.mjs.map → foreign-key-materialization-DiOhEeAz.mjs.map} +1 -1
  65. package/dist/{index-naming-Cj1Anq-T-w1JL7-EM.mjs → index-naming-Cj1Anq-T-C9TevpPR.mjs} +2 -2
  66. package/dist/{index-naming-Cj1Anq-T-w1JL7-EM.mjs.map → index-naming-Cj1Anq-T-C9TevpPR.mjs.map} +1 -1
  67. package/dist/{index-B-CraAhf.d.mts → index-yNeNt2GO.d.mts} +3 -3
  68. package/dist/{index-B-CraAhf.d.mts.map → index-yNeNt2GO.d.mts.map} +1 -1
  69. package/dist/{interpreter-gs7fSAIb-DuqyTGAB.mjs → interpreter-gs7fSAIb-BamHnI2q.mjs} +3 -3
  70. package/dist/{interpreter-gs7fSAIb-DuqyTGAB.mjs.map → interpreter-gs7fSAIb-BamHnI2q.mjs.map} +1 -1
  71. package/dist/{migration-9GrLWqGg.d.mts → migration-BJCmLNwu.d.mts} +2 -2
  72. package/dist/{migration-9GrLWqGg.d.mts.map → migration-BJCmLNwu.d.mts.map} +1 -1
  73. package/dist/{naming-DKr4TJd7-Cszhq9RV.mjs → naming-Cc_t1q6s-CouBOmqZ.mjs} +2 -2
  74. package/dist/{naming-DKr4TJd7-Cszhq9RV.mjs.map → naming-Cc_t1q6s-CouBOmqZ.mjs.map} +1 -1
  75. package/dist/orm-client.d.mts +3 -3
  76. package/dist/orm-client.mjs +2 -2
  77. package/dist/{prepared-statement-BHSj2pDk-CRzjNpcv.d.mts → prepared-statement-BHSj2pDk-BL0wOCnq.d.mts} +2 -2
  78. package/dist/{prepared-statement-BHSj2pDk-CRzjNpcv.d.mts.map → prepared-statement-BHSj2pDk-BL0wOCnq.d.mts.map} +1 -1
  79. package/dist/{psl-build-Cp32ahjI.mjs → psl-build-SOpIFu24.mjs} +7 -4
  80. package/dist/psl-build-SOpIFu24.mjs.map +1 -0
  81. package/dist/{psl-infer-DwMyO-IV.mjs → psl-infer-8kKfa-Ts.mjs} +2 -2
  82. package/dist/{psl-infer-DwMyO-IV.mjs.map → psl-infer-8kKfa-Ts.mjs.map} +1 -1
  83. package/dist/{psl-infer-BzjA7U3b.d.mts → psl-infer-C8hg8mIS.d.mts} +3 -3
  84. package/dist/{psl-infer-BzjA7U3b.d.mts.map → psl-infer-C8hg8mIS.d.mts.map} +1 -1
  85. package/dist/relational-core.d.mts +2 -2
  86. package/dist/relational-core.mjs +2 -2
  87. package/dist/relational-core__ast.d.mts +2 -2
  88. package/dist/relational-core__ast.mjs +2 -2
  89. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  90. package/dist/runtime.d.mts +3 -3
  91. package/dist/runtime.mjs +1 -1
  92. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  93. package/dist/{schema-differ-DpG_gnur-B_rj2WAH.d.mts → schema-differ-DpG_gnur-3ciAcy28.d.mts} +3 -3
  94. package/dist/{schema-differ-DpG_gnur-B_rj2WAH.d.mts.map → schema-differ-DpG_gnur-3ciAcy28.d.mts.map} +1 -1
  95. package/dist/schema-ir.d.mts +2 -2
  96. package/dist/schema-ir.mjs +2 -2
  97. package/dist/schema-ir__naming.mjs +1 -1
  98. package/dist/schema-ir__types.d.mts +3 -3
  99. package/dist/schema-ir__types.mjs +2 -2
  100. package/dist/{schema-verify-DI0aJQ9d-D5SmSZg3.mjs → schema-verify-DI0aJQ9d-Bgbmen10.mjs} +2 -2
  101. package/dist/{schema-verify-DI0aJQ9d-D5SmSZg3.mjs.map → schema-verify-DI0aJQ9d-Bgbmen10.mjs.map} +1 -1
  102. package/dist/{serialized-index-nBTwanKy-_ddEK4tk.mjs → serialized-index-nBTwanKy-B0C03Q_R.mjs} +3 -3
  103. package/dist/{serialized-index-nBTwanKy-_ddEK4tk.mjs.map → serialized-index-nBTwanKy-B0C03Q_R.mjs.map} +1 -1
  104. package/dist/{sql-contract-serializer-C90xg7_q-A3_F0w7f.mjs → sql-contract-serializer-C90xg7_q-DERDzTD5.mjs} +4 -4
  105. package/dist/{sql-contract-serializer-C90xg7_q-A3_F0w7f.mjs.map → sql-contract-serializer-C90xg7_q-DERDzTD5.mjs.map} +1 -1
  106. package/dist/{storage-table-ZzbR-xzQ-BRoTQE_2.mjs → storage-table-ZzbR-xzQ-C8gXT45E.mjs} +2 -2
  107. package/dist/{storage-table-ZzbR-xzQ-BRoTQE_2.mjs.map → storage-table-ZzbR-xzQ-C8gXT45E.mjs.map} +1 -1
  108. package/dist/types-BBT7jidC.d.mts +1 -0
  109. package/dist/{types-BFPRCYGW-DWAEoFj7.d.mts → types-BFPRCYGW-BLH0sK1Y.d.mts} +4 -4
  110. package/dist/{types-BFPRCYGW-DWAEoFj7.d.mts.map → types-BFPRCYGW-BLH0sK1Y.d.mts.map} +1 -1
  111. package/dist/{types-D0B65hip.mjs → types-D8Se4rnB.mjs} +2 -2
  112. package/dist/{types-D0B65hip.mjs.map → types-D8Se4rnB.mjs.map} +1 -1
  113. package/dist/{types-CHOgKgHg-BxgkL3GS.d.mts → types-DinsvYdY-Dv_n3Tac.d.mts} +43 -6
  114. package/dist/types-DinsvYdY-Dv_n3Tac.d.mts.map +1 -0
  115. package/dist/{types-DvrIPGUN-wxavfzyJ.mjs → types-yyhkYQNT-Dmoq-giA.mjs} +82 -45
  116. package/dist/types-yyhkYQNT-Dmoq-giA.mjs.map +1 -0
  117. package/dist/{validators-DecqO0rE.mjs → validators-BlqrBU7I.mjs} +3 -3
  118. package/dist/{validators-DecqO0rE.mjs.map → validators-BlqrBU7I.mjs.map} +1 -1
  119. package/package.json +18 -18
  120. package/dist/ast-B9jF6tRJ.d.mts.map +0 -1
  121. package/dist/ast-Bhj549wG.mjs.map +0 -1
  122. package/dist/control-8NqI46OK.mjs.map +0 -1
  123. package/dist/control-adapter-D4_Oipv6.d.mts +0 -1
  124. package/dist/psl-build-Cp32ahjI.mjs.map +0 -1
  125. package/dist/types-BijNazlM.d.mts +0 -1
  126. package/dist/types-CHOgKgHg-BxgkL3GS.d.mts.map +0 -1
  127. package/dist/types-DvrIPGUN-wxavfzyJ.mjs.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { B as frozenCodecRef } from "./types-BPi4d3WI-D8PIEqBU.mjs";
2
2
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
3
+ import { InternalError } from "@prisma/orm-framework/utils/internal-error";
3
4
  import { type } from "arktype";
4
5
  import { CodecDescriptorTemplateImpl, CodecImpl, column } from "@prisma/orm-framework/components/codec";
5
6
  //#region ../../../2-sql/4-lanes/relational-core/dist/exports/ast.mjs
@@ -124,6 +125,265 @@ function nonFiniteNumberIn(value, path) {
124
125
  if (found !== void 0) return found;
125
126
  }
126
127
  }
128
+ /**
129
+ * The reader the SQL targets build the canonical form of each date and time type with; ADR 254
130
+ * states the forms and the text it reads.
131
+ */
132
+ const SHAPES = {
133
+ date: {
134
+ description: "a date",
135
+ plural: "dates",
136
+ example: "2024-01-01",
137
+ date: true,
138
+ time: false,
139
+ offset: false
140
+ },
141
+ time: {
142
+ description: "a time of day",
143
+ plural: "times of day",
144
+ example: "12:34:56",
145
+ date: false,
146
+ time: true,
147
+ offset: false
148
+ },
149
+ timeWithOffset: {
150
+ description: "a time of day with a UTC offset",
151
+ plural: "times of day with a UTC offset",
152
+ example: "12:34:56+02:00",
153
+ date: false,
154
+ time: true,
155
+ offset: true
156
+ },
157
+ dateTime: {
158
+ description: "a date and time",
159
+ plural: "dates and times",
160
+ example: "2024-01-01T12:34:56",
161
+ date: true,
162
+ time: true,
163
+ offset: false
164
+ },
165
+ instant: {
166
+ description: "a date and time with a UTC offset",
167
+ plural: "instants",
168
+ example: "2024-01-01T12:34:56Z",
169
+ date: true,
170
+ time: true,
171
+ offset: true
172
+ }
173
+ };
174
+ const DATE_PREFIX = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})/;
175
+ const TIME_PREFIX = /^(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?/;
176
+ const OFFSET = /^([+-])(\d{2})(?::(\d{2})(?::(\d{2}))?)?$/;
177
+ const MAX_FRACTION_DIGITS = 6;
178
+ const FRACTION_UNITS = {
179
+ 3: "milliseconds",
180
+ 6: "microseconds"
181
+ };
182
+ const SECONDS_PER_DAY = 86400;
183
+ const MIDNIGHT = {
184
+ hour: 0,
185
+ minute: 0,
186
+ second: 0,
187
+ fraction: ""
188
+ };
189
+ function refused(message) {
190
+ throw structuredError("CONTRACT.CAST_REFUSED", message, {
191
+ why: "A date or time type stores one canonical form for each value (ADR 254).",
192
+ fix: "Write text the type holds, as the message shows."
193
+ });
194
+ }
195
+ function isLeapYear(year) {
196
+ return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
197
+ }
198
+ function daysInMonth(year, month) {
199
+ if (month === 2) return isLeapYear(year) ? 29 : 28;
200
+ return [
201
+ 4,
202
+ 6,
203
+ 9,
204
+ 11
205
+ ].includes(month) ? 30 : 31;
206
+ }
207
+ /** Days from 1970-01-01 to a date of the proleptic Gregorian calendar, with year 0 as 1 BC. */
208
+ function daysFromCivil({ year, month, day }) {
209
+ const shifted = month <= 2 ? year - 1 : year;
210
+ const era = Math.floor(shifted / 400);
211
+ const yearOfEra = shifted - era * 400;
212
+ const dayOfYear = Math.floor((153 * (month + (month > 2 ? -3 : 9)) + 2) / 5) + day - 1;
213
+ const dayOfEra = yearOfEra * 365 + Math.floor(yearOfEra / 4) - Math.floor(yearOfEra / 100) + dayOfYear;
214
+ return era * 146097 + dayOfEra - 719468;
215
+ }
216
+ function civilFromDays(days) {
217
+ const shifted = days + 719468;
218
+ const era = Math.floor(shifted / 146097);
219
+ const dayOfEra = shifted - era * 146097;
220
+ const yearOfEra = Math.floor((dayOfEra - Math.floor(dayOfEra / 1460) + Math.floor(dayOfEra / 36524) - Math.floor(dayOfEra / 146096)) / 365);
221
+ const dayOfYear = dayOfEra - (365 * yearOfEra + Math.floor(yearOfEra / 4) - Math.floor(yearOfEra / 100));
222
+ const monthIndex = Math.floor((5 * dayOfYear + 2) / 153);
223
+ const day = dayOfYear - Math.floor((153 * monthIndex + 2) / 5) + 1;
224
+ const month = monthIndex < 10 ? monthIndex + 3 : monthIndex - 9;
225
+ return {
226
+ year: yearOfEra + era * 400 + (month <= 2 ? 1 : 0),
227
+ month,
228
+ day
229
+ };
230
+ }
231
+ function pad(value, width = 2) {
232
+ return String(value).padStart(width, "0");
233
+ }
234
+ function yearText(year) {
235
+ if (year >= 0 && year <= 9999) return pad(year, 4);
236
+ return `${year < 0 ? "-" : "+"}${pad(Math.abs(year), 6)}`;
237
+ }
238
+ function dateText(date) {
239
+ return `${yearText(date.year)}-${pad(date.month)}-${pad(date.day)}`;
240
+ }
241
+ function timeText(time) {
242
+ const fraction = time.fraction.replace(/0+$/, "");
243
+ return `${pad(time.hour)}:${pad(time.minute)}:${pad(time.second)}${fraction === "" ? "" : `.${fraction}`}`;
244
+ }
245
+ function offsetText(seconds) {
246
+ if (seconds === 0) return "Z";
247
+ const magnitude = Math.abs(seconds);
248
+ const rest = magnitude % 60;
249
+ return `${seconds < 0 ? "-" : "+"}${pad(Math.floor(magnitude / 3600))}:${pad(Math.floor(magnitude / 60) % 60)}${rest === 0 ? "" : `:${pad(rest)}`}`;
250
+ }
251
+ /**
252
+ * The fields of an ISO 8601 date, time, or date and time, or `undefined` when the text is not one.
253
+ * Ranges are checked by the caller, which words the refusal.
254
+ */
255
+ function readWritten(text) {
256
+ let rest = text;
257
+ let date;
258
+ let timeFollows = true;
259
+ const dateMatch = DATE_PREFIX.exec(rest);
260
+ if (dateMatch !== null) {
261
+ const [whole, yearDigits = "", month = "", day = ""] = dateMatch;
262
+ if (yearDigits === "-000000") return void 0;
263
+ date = {
264
+ year: Number(yearDigits),
265
+ month: Number(month),
266
+ day: Number(day)
267
+ };
268
+ rest = rest.slice(whole.length);
269
+ timeFollows = /^[Tt ]/.test(rest);
270
+ if (timeFollows) rest = rest.slice(1);
271
+ }
272
+ let time;
273
+ let fractionDigits = 0;
274
+ if (timeFollows) {
275
+ const timeMatch = TIME_PREFIX.exec(rest);
276
+ if (timeMatch === null) return void 0;
277
+ const [whole, hour = "", minute = "", second = "00", fraction = ""] = timeMatch;
278
+ time = {
279
+ hour: Number(hour),
280
+ minute: Number(minute),
281
+ second: Number(second),
282
+ fraction
283
+ };
284
+ fractionDigits = fraction.length;
285
+ rest = rest.slice(whole.length);
286
+ }
287
+ let offsetSeconds;
288
+ if (rest === "Z" || rest === "z") offsetSeconds = 0;
289
+ else if (rest !== "") {
290
+ const offset = OFFSET.exec(rest);
291
+ if (offset === null) return void 0;
292
+ const [, sign, hours = "", minutes = "00", seconds = "00"] = offset;
293
+ if (Number(minutes) > 59 || Number(seconds) > 59) return void 0;
294
+ const magnitude = Number(hours) * 3600 + Number(minutes) * 60 + Number(seconds);
295
+ offsetSeconds = sign === "-" ? -magnitude : magnitude;
296
+ }
297
+ return {
298
+ date,
299
+ time,
300
+ offsetSeconds,
301
+ fractionDigits
302
+ };
303
+ }
304
+ function withFraction(example, digits) {
305
+ return example.replace(/(\d{2}:\d{2}:\d{2})/, `$1.${"123456".slice(0, digits)}`);
306
+ }
307
+ /** The value with an instant moved to UTC. */
308
+ function normalized(written, shape) {
309
+ const clock = written.time ?? MIDNIGHT;
310
+ const offsetSeconds = written.offsetSeconds ?? 0;
311
+ if (written.date === void 0 || shape !== "instant") return {
312
+ date: written.date,
313
+ time: clock,
314
+ offsetSeconds
315
+ };
316
+ const utc = daysFromCivil(written.date) * SECONDS_PER_DAY + clock.hour * 3600 + clock.minute * 60 + clock.second - offsetSeconds;
317
+ const days = Math.floor(utc / SECONDS_PER_DAY);
318
+ const secondOfDay = utc - days * SECONDS_PER_DAY;
319
+ return {
320
+ date: civilFromDays(days),
321
+ time: {
322
+ hour: Math.floor(secondOfDay / 3600),
323
+ minute: Math.floor(secondOfDay / 60) % 60,
324
+ second: secondOfDay % 60,
325
+ fraction: clock.fraction
326
+ },
327
+ offsetSeconds: 0
328
+ };
329
+ }
330
+ function position(value) {
331
+ const { time } = value;
332
+ return [
333
+ value.date === void 0 ? 0 : daysFromCivil(value.date),
334
+ time.hour * 3600 + time.minute * 60 + time.second,
335
+ time.fraction.padEnd(MAX_FRACTION_DIGITS, "0")
336
+ ];
337
+ }
338
+ function isBefore(left, right) {
339
+ if (left[0] !== right[0]) return left[0] < right[0];
340
+ if (left[1] !== right[1]) return left[1] < right[1];
341
+ return left[2] < right[2];
342
+ }
343
+ function printed(value, shape) {
344
+ const { date, time, offsetSeconds } = value;
345
+ if (date === void 0) return shape === "timeWithOffset" ? `${timeText(time)}${offsetText(offsetSeconds)}` : timeText(time);
346
+ if (shape === "date") return dateText(date);
347
+ if (shape === "dateTime") return `${dateText(date)}T${timeText(time)}`;
348
+ return `${dateText(date)}T${timeText(time)}Z`;
349
+ }
350
+ /** The position of a range bound, which the data type declares in canonical form. */
351
+ function boundPosition(text, shape) {
352
+ const written = readWritten(text);
353
+ if (written === void 0) throw new InternalError(`The range bound "${text}" is not in canonical form.`);
354
+ return position(normalized(written, shape));
355
+ }
356
+ /**
357
+ * The canonical form of written date or time text, or a refusal with a message that says what is
358
+ * wrong and shows text the type holds. `written` is the text as its author wrote it, which the
359
+ * message shows, when a target rewrote it into ISO 8601 before calling this.
360
+ */
361
+ function canonicalDateTime(text, options, written = text) {
362
+ const shape = SHAPES[options.shape];
363
+ const { dataTypeId: id } = options;
364
+ const parts = readWritten(text);
365
+ if (parts === void 0) refused(`${id} cannot read "${written}". Write ${shape.description}, as in "${shape.example}".`);
366
+ if (parts.date !== void 0 && !shape.date) refused(`${id} holds a time of day without a date, but "${written}" has a date. Write the time alone, as in "${shape.example}".`);
367
+ if (parts.date === void 0 && shape.date) refused(shape.time ? `${id} holds ${shape.description}, but "${written}" has no date. Write the date too, as in "${shape.example}".` : `${id} holds a date, and "${written}" is a time of day. Write a date, as in "${shape.example}".`);
368
+ if (parts.time !== void 0 && !shape.time) refused(`${id} holds a date without a time of day, but "${written}" has a time. Write the date alone, as in "${shape.example}".`);
369
+ if (parts.time === void 0 && shape.offset) refused(`${id} holds ${shape.description}, but "${written}" has no time of day. Write the time too, as in "${shape.example}".`);
370
+ if (parts.offsetSeconds !== void 0 && !shape.offset) refused(`${id} holds no UTC offset, but "${written}" has one. Leave it out, as in "${shape.example}".`);
371
+ if (parts.offsetSeconds === void 0 && shape.offset) refused(`${id} needs a UTC offset, but "${written}" has none. Add Z for UTC or an offset such as +02:00, as in "${shape.example}".`);
372
+ const maxFractionDigits = options.maxFractionDigits ?? MAX_FRACTION_DIGITS;
373
+ if (parts.fractionDigits > maxFractionDigits) refused(`"${written}" has ${parts.fractionDigits} digits after the decimal point, but ${id} holds ${FRACTION_UNITS[maxFractionDigits]}, so at most ${maxFractionDigits}. Round it, as in "${withFraction(shape.example, maxFractionDigits)}".`);
374
+ const { date, time } = parts;
375
+ if (date !== void 0 && (date.month < 1 || date.month > 12 || date.day < 1 || date.day > daysInMonth(date.year, date.month))) refused(`"${written}" is not a date that exists. Write a real date, as in "${shape.example}".`);
376
+ if (time !== void 0 && (time.hour > 23 || time.minute > 59 || time.second > 59)) refused(`"${written}" is not a time of day that exists: hours run from 00 to 23, and minutes and seconds from 00 to 59. Write one, as in "${shape.example}".`);
377
+ const offsetLimit = options.maxOffsetHours ?? 23;
378
+ if (parts.offsetSeconds !== void 0 && Math.abs(parts.offsetSeconds) >= (offsetLimit + 1) * 3600) refused(`"${written}" has a UTC offset outside -${pad(offsetLimit)}:59 to +${pad(offsetLimit)}:59, which ${id} does not hold. Write a smaller offset, as in "${shape.example}".`);
379
+ const value = normalized(parts, options.shape);
380
+ const { range } = options;
381
+ if (range !== void 0) {
382
+ const at = position(value);
383
+ if (isBefore(at, boundPosition(range.earliest, options.shape)) || isBefore(boundPosition(range.latest, options.shape), at)) refused(`${id} holds ${shape.plural} from ${range.earliest} to ${range.latest}, and "${written}" is outside them.`);
384
+ }
385
+ return printed(value, options.shape);
386
+ }
127
387
  var JsonValueProjection = class {
128
388
  value;
129
389
  constructor(value) {
@@ -385,6 +645,6 @@ var SqlVarcharDescriptor = class extends CodecDescriptorTemplateImpl {
385
645
  const sqlVarcharDescriptor = new SqlVarcharDescriptor();
386
646
  const sqlVarcharColumn = (params = {}) => column(sqlVarcharDescriptor.factory(params), sqlVarcharDescriptor.codecId, params, "varchar");
387
647
  //#endregion
388
- export { sqlCharDescriptor as A, sqlIntDecode as B, isNumeralText as C, signedRange as D, printJsonBody as E, sqlFloatDecodeJson as F, sqlTextDescriptor as G, sqlIntEncode as H, sqlFloatDescriptor as I, sqlVarcharDecode as J, sqlTextEncode as K, sqlFloatEncode as L, sqlCharRenderOutputType as M, sqlFloatColumn as N, sqlCharColumn as O, sqlFloatDecode as P, sqlFloatEncodeJson as R, isNonFiniteText as S, parseJsonBody as T, sqlTextColumn as U, sqlIntDescriptor as V, sqlTextDecode as W, sqlVarcharEncode as X, sqlVarcharDescriptor as Y, sqlVarcharRenderOutputType as Z, SqlVarcharCodec as _, SQL_FLOAT_CODEC_ID as a, createNumberClassifier 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, sqlCharEncode as j, sqlCharDecode as k, SqlCharCodec as l, SqlIntDescriptor as m, JsonDocumentProjection as n, SQL_INT_CODEC_ID as o, SqlIntCodec as p, sqlVarcharColumn as q, NativeJsonValueProjection as r, SQL_TEXT_CODEC_ID as s, CodecJsonValueProjection as t, SqlCharDescriptor as u, SqlVarcharDescriptor as v, numeralText as w, escapePslString as x, canonicalNumeralText as y, sqlIntColumn as z };
648
+ export { sqlCharDecode as A, sqlIntColumn as B, isNonFiniteText as C, printJsonBody as D, parseJsonBody as E, sqlFloatDecode as F, sqlTextDecode as G, sqlIntDescriptor as H, sqlFloatDecodeJson as I, sqlVarcharColumn as J, sqlTextDescriptor as K, sqlFloatDescriptor as L, sqlCharEncode as M, sqlCharRenderOutputType as N, signedRange as O, sqlFloatColumn as P, sqlVarcharRenderOutputType as Q, sqlFloatEncode as R, escapePslString as S, numeralText as T, sqlIntEncode as U, sqlIntDecode as V, sqlTextColumn as W, sqlVarcharDescriptor as X, sqlVarcharDecode as Y, sqlVarcharEncode as Z, SqlVarcharCodec as _, SQL_FLOAT_CODEC_ID as a, canonicalNumeralText 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, sqlCharDescriptor as j, sqlCharColumn as k, SqlCharCodec as l, SqlIntDescriptor as m, JsonDocumentProjection as n, SQL_INT_CODEC_ID as o, SqlIntCodec as p, sqlTextEncode as q, NativeJsonValueProjection as r, SQL_TEXT_CODEC_ID as s, CodecJsonValueProjection as t, SqlCharDescriptor as u, SqlVarcharDescriptor as v, isNumeralText as w, createNumberClassifier as x, canonicalDateTime as y, sqlFloatEncodeJson as z };
389
649
 
390
- //# sourceMappingURL=ast-Bhj549wG.mjs.map
650
+ //# sourceMappingURL=ast-CJd4157-.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-CJd4157-.mjs","names":[],"sources":["../../../../2-sql/4-lanes/relational-core/dist/exports/ast.mjs"],"sourcesContent":["import { A as PreparedParamRef, B as isAggregateFn, C as LiteralExpr, D as OrExpr, E as OperationExpr, F as SubqueryExpr, G as queryAstKinds, H as isOrderByNulls, I as TableSource, K as whereExprKinds, L as UpdateAst, M as RawExpr, N as RawQueryAst, O as OrderByItem, P as SelectAst, R as WindowFuncExpr, S as ListExpression, T as NullCheckExpr, U as isQueryAst, V as isOrderByDirection, W as isWhereExpr, _ 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 ProjectionItem, k as ParamRef, l as DerivedTableSource, m as FunctionCallExpr, n as AndExpr, o as ColumnRef, p as ExistsExpr, q as frozenCodecRef, r as BinaryExpr, s as DefaultValueExpr, t as AggregateExpr, u as DoNothingConflictAction, v as InsertOnConflict, w as NotExpr, x as JsonObjectExpr, y as JoinAst, z as aggregateFnNames } from \"../types-BPi4d3WI.mjs\";\nimport { a as ForeignKeyConstraint, c as PrimaryKeyConstraint, i as DdlNode, l as UniqueConstraint, n as DdlColumn, o as FunctionColumnDefault, r as DdlColumnDefault, s as LiteralColumnDefault, t as CheckExpressionConstraint, u as isDdlNode } from \"../ddl-types-DOgOmDOh.mjs\";\nimport { n as compact, t as collectOrderedParamRefs } from \"../util-DQQgv2j1.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { CodecDescriptorTemplateImpl, CodecImpl, column } from \"@internal/framework-components/codec\";\nimport { type } from \"arktype\";\n//#region src/ast/data-type-support.ts\nconst INTEGER_TEXT = /^-?\\d+$/;\nconst DECIMAL_TEXT = /^-?\\d+\\.\\d+$/;\nconst NON_FINITE_WORDS = /* @__PURE__ */ new Set([\n\t\"NaN\",\n\t\"Infinity\",\n\t\"-Infinity\"\n]);\nconst DECIMAL_NUMERAL = /^(-?)0*(\\d+)(\\.\\d+)?$/;\n/** Whether `text` is a whole number or a decimal as a contract source writes one. */\nfunction isNumeralText(text) {\n\treturn INTEGER_TEXT.test(text) || DECIMAL_TEXT.test(text);\n}\n/** Whether `text` is one of the three words a floating-point value is written as. */\nfunction isNonFiniteText(text) {\n\treturn NON_FINITE_WORDS.has(text);\n}\n/**\n* A written numeral as the contract stores it. Leading zeros and the sign of zero never change a\n* number, so they go; trailing zeros stay, because a type without a scale keeps them.\n*/\nfunction canonicalNumeralText(text) {\n\tconst numeral = DECIMAL_NUMERAL.exec(text);\n\tif (numeral === null) return text;\n\tconst [, sign = \"\", whole = \"\", fraction = \"\"] = numeral;\n\tconst digits = `${whole}${fraction}`;\n\treturn /^[0.]+$/.test(digits) ? digits : `${sign}${digits}`;\n}\n/**\n* A number as a contract source writes it: no exponent, because no schema language has that syntax,\n* so the decimal point moves to where the exponent puts it. A non-finite number is its own word.\n*/\nfunction numeralText(value) {\n\tconst [coefficient = \"\", exponent] = String(value).split(\"e\");\n\tif (exponent === void 0) return coefficient;\n\tconst sign = coefficient.startsWith(\"-\") ? \"-\" : \"\";\n\tconst [whole = \"\", fraction = \"\"] = coefficient.slice(sign.length).split(\".\");\n\tconst digits = `${whole}${fraction}`;\n\tconst point = whole.length + Number(exponent);\n\tif (point <= 0) return `${sign}0.${\"0\".repeat(-point)}${digits}`;\n\tif (point >= digits.length) return `${sign}${digits}${\"0\".repeat(point - digits.length)}`;\n\treturn `${sign}${digits.slice(0, point)}.${digits.slice(point)}`;\n}\n/** A string as a contract source writes it, with the escapes its string reader resolves. */\nfunction escapePslString(value) {\n\treturn value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n}\n/** The range of a signed integer of `bits` bits. */\nfunction signedRange(bits) {\n\tconst half = 2n ** (BigInt(bits) - 1n);\n\treturn {\n\t\tmin: -half,\n\t\tmax: half - 1n\n\t};\n}\n/**\n* The classifier one target's plain-number authoring entry carries: it reads the digits and says\n* which of the target's types the value is, in that type's canonical form. `undefined` means no\n* type of this target holds the number.\n*/\nfunction createNumberClassifier(spec) {\n\tconst as = (classification, value) => classification === void 0 ? void 0 : {\n\t\ttype: classification.type,\n\t\tvalue\n\t};\n\treturn (text) => {\n\t\tif (NON_FINITE_WORDS.has(text)) return as(spec.words, spec.words?.form === \"number\" ? Number(text) : text);\n\t\tif (DECIMAL_TEXT.test(text)) {\n\t\t\tconst canonical = canonicalNumeralText(text);\n\t\t\treturn as(spec.fraction, spec.fraction?.form === \"number\" ? Number(canonical) : canonical);\n\t\t}\n\t\tif (!INTEGER_TEXT.test(text)) return void 0;\n\t\tconst digits = BigInt(text);\n\t\tconst classification = spec.integers.find(({ min, max }) => digits >= min && digits <= max) ?? spec.largerWhole;\n\t\treturn as(classification, classification?.form === \"number\" ? Number(digits) : digits.toString());\n\t};\n}\n/**\n* Read a JSON body into the document it holds.\n*\n* `JSON.parse` reads a numeral too large for a double as `Infinity`, and `JSON.stringify` writes\n* that back as `null`, so a document holding one would not be the document stored; it is refused\n* here instead, naming where the number is.\n*/\nfunction parseJsonBody(text) {\n\tlet value;\n\ttry {\n\t\tvalue = JSON.parse(text);\n\t} catch (error) {\n\t\tthrow structuredError(\"CONTRACT.INVALID_JSON_LITERAL\", error instanceof Error ? error.message : String(error), {\n\t\t\twhy: \"The body is not a JSON document.\",\n\t\t\tfix: \"Write a JSON document.\"\n\t\t});\n\t}\n\tconst overflowed = nonFiniteNumberIn(value, \"\");\n\tif (overflowed !== void 0) throw structuredError(\"CONTRACT.INVALID_JSON_LITERAL\", `${overflowed.path} is ${overflowed.value}, which JSON cannot write back: the number in the text is outside the range a JSON number holds.`, {\n\t\twhy: \"JSON.parse reads a numeral too large for a double as Infinity, which JSON.stringify writes back as null.\",\n\t\tfix: \"Write a number JSON can hold, or write it as text.\"\n\t});\n\treturn value;\n}\n/** Write a document as the body of a JSON literal. */\nfunction printJsonBody(value) {\n\treturn JSON.stringify(value);\n}\nfunction nonFiniteNumberIn(value, path) {\n\tif (typeof value === \"number\") return Number.isFinite(value) ? void 0 : {\n\t\tpath: path === \"\" ? \"The value\" : path,\n\t\tvalue\n\t};\n\tif (Array.isArray(value)) {\n\t\tfor (const [index, element] of value.entries()) {\n\t\t\tconst found = nonFiniteNumberIn(element, `${path}[${index}]`);\n\t\t\tif (found !== void 0) return found;\n\t\t}\n\t\treturn;\n\t}\n\tif (typeof value === \"object\" && value !== null) for (const [key, member] of Object.entries(value)) {\n\t\tconst found = nonFiniteNumberIn(member, path === \"\" ? key : `${path}.${key}`);\n\t\tif (found !== void 0) return found;\n\t}\n}\n//#endregion\n//#region src/ast/date-time-canonical-form.ts\n/**\n* The reader the SQL targets build the canonical form of each date and time type with; ADR 254\n* states the forms and the text it reads.\n*/\nconst SHAPES = {\n\tdate: {\n\t\tdescription: \"a date\",\n\t\tplural: \"dates\",\n\t\texample: \"2024-01-01\",\n\t\tdate: true,\n\t\ttime: false,\n\t\toffset: false\n\t},\n\ttime: {\n\t\tdescription: \"a time of day\",\n\t\tplural: \"times of day\",\n\t\texample: \"12:34:56\",\n\t\tdate: false,\n\t\ttime: true,\n\t\toffset: false\n\t},\n\ttimeWithOffset: {\n\t\tdescription: \"a time of day with a UTC offset\",\n\t\tplural: \"times of day with a UTC offset\",\n\t\texample: \"12:34:56+02:00\",\n\t\tdate: false,\n\t\ttime: true,\n\t\toffset: true\n\t},\n\tdateTime: {\n\t\tdescription: \"a date and time\",\n\t\tplural: \"dates and times\",\n\t\texample: \"2024-01-01T12:34:56\",\n\t\tdate: true,\n\t\ttime: true,\n\t\toffset: false\n\t},\n\tinstant: {\n\t\tdescription: \"a date and time with a UTC offset\",\n\t\tplural: \"instants\",\n\t\texample: \"2024-01-01T12:34:56Z\",\n\t\tdate: true,\n\t\ttime: true,\n\t\toffset: true\n\t}\n};\nconst DATE_PREFIX = /^([+-]\\d{6}|\\d{4})-(\\d{2})-(\\d{2})/;\nconst TIME_PREFIX = /^(\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d+))?)?/;\nconst OFFSET = /^([+-])(\\d{2})(?::(\\d{2})(?::(\\d{2}))?)?$/;\nconst MAX_FRACTION_DIGITS = 6;\nconst FRACTION_UNITS = {\n\t3: \"milliseconds\",\n\t6: \"microseconds\"\n};\nconst SECONDS_PER_DAY = 86400;\nconst MIDNIGHT = {\n\thour: 0,\n\tminute: 0,\n\tsecond: 0,\n\tfraction: \"\"\n};\nfunction refused(message) {\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", message, {\n\t\twhy: \"A date or time type stores one canonical form for each value (ADR 254).\",\n\t\tfix: \"Write text the type holds, as the message shows.\"\n\t});\n}\nfunction isLeapYear(year) {\n\treturn year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n}\nfunction daysInMonth(year, month) {\n\tif (month === 2) return isLeapYear(year) ? 29 : 28;\n\treturn [\n\t\t4,\n\t\t6,\n\t\t9,\n\t\t11\n\t].includes(month) ? 30 : 31;\n}\n/** Days from 1970-01-01 to a date of the proleptic Gregorian calendar, with year 0 as 1 BC. */\nfunction daysFromCivil({ year, month, day }) {\n\tconst shifted = month <= 2 ? year - 1 : year;\n\tconst era = Math.floor(shifted / 400);\n\tconst yearOfEra = shifted - era * 400;\n\tconst dayOfYear = Math.floor((153 * (month + (month > 2 ? -3 : 9)) + 2) / 5) + day - 1;\n\tconst dayOfEra = yearOfEra * 365 + Math.floor(yearOfEra / 4) - Math.floor(yearOfEra / 100) + dayOfYear;\n\treturn era * 146097 + dayOfEra - 719468;\n}\nfunction civilFromDays(days) {\n\tconst shifted = days + 719468;\n\tconst era = Math.floor(shifted / 146097);\n\tconst dayOfEra = shifted - era * 146097;\n\tconst yearOfEra = Math.floor((dayOfEra - Math.floor(dayOfEra / 1460) + Math.floor(dayOfEra / 36524) - Math.floor(dayOfEra / 146096)) / 365);\n\tconst dayOfYear = dayOfEra - (365 * yearOfEra + Math.floor(yearOfEra / 4) - Math.floor(yearOfEra / 100));\n\tconst monthIndex = Math.floor((5 * dayOfYear + 2) / 153);\n\tconst day = dayOfYear - Math.floor((153 * monthIndex + 2) / 5) + 1;\n\tconst month = monthIndex < 10 ? monthIndex + 3 : monthIndex - 9;\n\treturn {\n\t\tyear: yearOfEra + era * 400 + (month <= 2 ? 1 : 0),\n\t\tmonth,\n\t\tday\n\t};\n}\nfunction pad(value, width = 2) {\n\treturn String(value).padStart(width, \"0\");\n}\nfunction yearText(year) {\n\tif (year >= 0 && year <= 9999) return pad(year, 4);\n\treturn `${year < 0 ? \"-\" : \"+\"}${pad(Math.abs(year), 6)}`;\n}\nfunction dateText(date) {\n\treturn `${yearText(date.year)}-${pad(date.month)}-${pad(date.day)}`;\n}\nfunction timeText(time) {\n\tconst fraction = time.fraction.replace(/0+$/, \"\");\n\treturn `${pad(time.hour)}:${pad(time.minute)}:${pad(time.second)}${fraction === \"\" ? \"\" : `.${fraction}`}`;\n}\nfunction offsetText(seconds) {\n\tif (seconds === 0) return \"Z\";\n\tconst magnitude = Math.abs(seconds);\n\tconst rest = magnitude % 60;\n\treturn `${seconds < 0 ? \"-\" : \"+\"}${pad(Math.floor(magnitude / 3600))}:${pad(Math.floor(magnitude / 60) % 60)}${rest === 0 ? \"\" : `:${pad(rest)}`}`;\n}\n/**\n* The fields of an ISO 8601 date, time, or date and time, or `undefined` when the text is not one.\n* Ranges are checked by the caller, which words the refusal.\n*/\nfunction readWritten(text) {\n\tlet rest = text;\n\tlet date;\n\tlet timeFollows = true;\n\tconst dateMatch = DATE_PREFIX.exec(rest);\n\tif (dateMatch !== null) {\n\t\tconst [whole, yearDigits = \"\", month = \"\", day = \"\"] = dateMatch;\n\t\tif (yearDigits === \"-000000\") return void 0;\n\t\tdate = {\n\t\t\tyear: Number(yearDigits),\n\t\t\tmonth: Number(month),\n\t\t\tday: Number(day)\n\t\t};\n\t\trest = rest.slice(whole.length);\n\t\ttimeFollows = /^[Tt ]/.test(rest);\n\t\tif (timeFollows) rest = rest.slice(1);\n\t}\n\tlet time;\n\tlet fractionDigits = 0;\n\tif (timeFollows) {\n\t\tconst timeMatch = TIME_PREFIX.exec(rest);\n\t\tif (timeMatch === null) return void 0;\n\t\tconst [whole, hour = \"\", minute = \"\", second = \"00\", fraction = \"\"] = timeMatch;\n\t\ttime = {\n\t\t\thour: Number(hour),\n\t\t\tminute: Number(minute),\n\t\t\tsecond: Number(second),\n\t\t\tfraction\n\t\t};\n\t\tfractionDigits = fraction.length;\n\t\trest = rest.slice(whole.length);\n\t}\n\tlet offsetSeconds;\n\tif (rest === \"Z\" || rest === \"z\") offsetSeconds = 0;\n\telse if (rest !== \"\") {\n\t\tconst offset = OFFSET.exec(rest);\n\t\tif (offset === null) return void 0;\n\t\tconst [, sign, hours = \"\", minutes = \"00\", seconds = \"00\"] = offset;\n\t\tif (Number(minutes) > 59 || Number(seconds) > 59) return void 0;\n\t\tconst magnitude = Number(hours) * 3600 + Number(minutes) * 60 + Number(seconds);\n\t\toffsetSeconds = sign === \"-\" ? -magnitude : magnitude;\n\t}\n\treturn {\n\t\tdate,\n\t\ttime,\n\t\toffsetSeconds,\n\t\tfractionDigits\n\t};\n}\nfunction withFraction(example, digits) {\n\treturn example.replace(/(\\d{2}:\\d{2}:\\d{2})/, `$1.${\"123456\".slice(0, digits)}`);\n}\n/** The value with an instant moved to UTC. */\nfunction normalized(written, shape) {\n\tconst clock = written.time ?? MIDNIGHT;\n\tconst offsetSeconds = written.offsetSeconds ?? 0;\n\tif (written.date === void 0 || shape !== \"instant\") return {\n\t\tdate: written.date,\n\t\ttime: clock,\n\t\toffsetSeconds\n\t};\n\tconst utc = daysFromCivil(written.date) * SECONDS_PER_DAY + clock.hour * 3600 + clock.minute * 60 + clock.second - offsetSeconds;\n\tconst days = Math.floor(utc / SECONDS_PER_DAY);\n\tconst secondOfDay = utc - days * SECONDS_PER_DAY;\n\treturn {\n\t\tdate: civilFromDays(days),\n\t\ttime: {\n\t\t\thour: Math.floor(secondOfDay / 3600),\n\t\t\tminute: Math.floor(secondOfDay / 60) % 60,\n\t\t\tsecond: secondOfDay % 60,\n\t\t\tfraction: clock.fraction\n\t\t},\n\t\toffsetSeconds: 0\n\t};\n}\nfunction position(value) {\n\tconst { time } = value;\n\treturn [\n\t\tvalue.date === void 0 ? 0 : daysFromCivil(value.date),\n\t\ttime.hour * 3600 + time.minute * 60 + time.second,\n\t\ttime.fraction.padEnd(MAX_FRACTION_DIGITS, \"0\")\n\t];\n}\nfunction isBefore(left, right) {\n\tif (left[0] !== right[0]) return left[0] < right[0];\n\tif (left[1] !== right[1]) return left[1] < right[1];\n\treturn left[2] < right[2];\n}\nfunction printed(value, shape) {\n\tconst { date, time, offsetSeconds } = value;\n\tif (date === void 0) return shape === \"timeWithOffset\" ? `${timeText(time)}${offsetText(offsetSeconds)}` : timeText(time);\n\tif (shape === \"date\") return dateText(date);\n\tif (shape === \"dateTime\") return `${dateText(date)}T${timeText(time)}`;\n\treturn `${dateText(date)}T${timeText(time)}Z`;\n}\n/** The position of a range bound, which the data type declares in canonical form. */\nfunction boundPosition(text, shape) {\n\tconst written = readWritten(text);\n\tif (written === void 0) throw new InternalError(`The range bound \"${text}\" is not in canonical form.`);\n\treturn position(normalized(written, shape));\n}\n/**\n* The canonical form of written date or time text, or a refusal with a message that says what is\n* wrong and shows text the type holds. `written` is the text as its author wrote it, which the\n* message shows, when a target rewrote it into ISO 8601 before calling this.\n*/\nfunction canonicalDateTime(text, options, written = text) {\n\tconst shape = SHAPES[options.shape];\n\tconst { dataTypeId: id } = options;\n\tconst parts = readWritten(text);\n\tif (parts === void 0) refused(`${id} cannot read \"${written}\". Write ${shape.description}, as in \"${shape.example}\".`);\n\tif (parts.date !== void 0 && !shape.date) refused(`${id} holds a time of day without a date, but \"${written}\" has a date. Write the time alone, as in \"${shape.example}\".`);\n\tif (parts.date === void 0 && shape.date) refused(shape.time ? `${id} holds ${shape.description}, but \"${written}\" has no date. Write the date too, as in \"${shape.example}\".` : `${id} holds a date, and \"${written}\" is a time of day. Write a date, as in \"${shape.example}\".`);\n\tif (parts.time !== void 0 && !shape.time) refused(`${id} holds a date without a time of day, but \"${written}\" has a time. Write the date alone, as in \"${shape.example}\".`);\n\tif (parts.time === void 0 && shape.offset) refused(`${id} holds ${shape.description}, but \"${written}\" has no time of day. Write the time too, as in \"${shape.example}\".`);\n\tif (parts.offsetSeconds !== void 0 && !shape.offset) refused(`${id} holds no UTC offset, but \"${written}\" has one. Leave it out, as in \"${shape.example}\".`);\n\tif (parts.offsetSeconds === void 0 && shape.offset) refused(`${id} needs a UTC offset, but \"${written}\" has none. Add Z for UTC or an offset such as +02:00, as in \"${shape.example}\".`);\n\tconst maxFractionDigits = options.maxFractionDigits ?? MAX_FRACTION_DIGITS;\n\tif (parts.fractionDigits > maxFractionDigits) refused(`\"${written}\" has ${parts.fractionDigits} digits after the decimal point, but ${id} holds ${FRACTION_UNITS[maxFractionDigits]}, so at most ${maxFractionDigits}. Round it, as in \"${withFraction(shape.example, maxFractionDigits)}\".`);\n\tconst { date, time } = parts;\n\tif (date !== void 0 && (date.month < 1 || date.month > 12 || date.day < 1 || date.day > daysInMonth(date.year, date.month))) refused(`\"${written}\" is not a date that exists. Write a real date, as in \"${shape.example}\".`);\n\tif (time !== void 0 && (time.hour > 23 || time.minute > 59 || time.second > 59)) refused(`\"${written}\" is not a time of day that exists: hours run from 00 to 23, and minutes and seconds from 00 to 59. Write one, as in \"${shape.example}\".`);\n\tconst offsetLimit = options.maxOffsetHours ?? 23;\n\tif (parts.offsetSeconds !== void 0 && Math.abs(parts.offsetSeconds) >= (offsetLimit + 1) * 3600) refused(`\"${written}\" has a UTC offset outside -${pad(offsetLimit)}:59 to +${pad(offsetLimit)}:59, which ${id} does not hold. Write a smaller offset, as in \"${shape.example}\".`);\n\tconst value = normalized(parts, options.shape);\n\tconst { range } = options;\n\tif (range !== void 0) {\n\t\tconst at = position(value);\n\t\tif (isBefore(at, boundPosition(range.earliest, options.shape)) || isBefore(boundPosition(range.latest, options.shape), at)) refused(`${id} holds ${shape.plural} from ${range.earliest} to ${range.latest}, and \"${written}\" is outside them.`);\n\t}\n\treturn printed(value, options.shape);\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/sql-codec-helpers.ts\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 sqlCharEncode = (value) => value;\nconst sqlCharDecode = (wire) => wire.trimEnd();\nconst sqlCharRenderOutputType = (typeParams) => {\n\tconst length = typeParams.length;\n\tif (length === void 0) return void 0;\n\tif (typeof length !== \"number\" || !Number.isFinite(length) || !Number.isInteger(length)) throw structuredError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"length\" in typeParams for Char, got ${String(length)}`, { meta: {\n\t\tcodec: SQL_CHAR_CODEC_ID,\n\t\tparam: \"length\",\n\t\treceived: String(length)\n\t} });\n\treturn `Char<${length}>`;\n};\nconst sqlVarcharEncode = (value) => value;\nconst sqlVarcharDecode = (wire) => wire;\nconst sqlVarcharRenderOutputType = (typeParams) => {\n\tconst length = typeParams.length;\n\tif (length === void 0) return void 0;\n\tif (typeof length !== \"number\" || !Number.isFinite(length) || !Number.isInteger(length)) throw structuredError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"length\" in typeParams for Varchar, got ${String(length)}`, { meta: {\n\t\tcodec: SQL_VARCHAR_CODEC_ID,\n\t\tparam: \"length\",\n\t\treceived: String(length)\n\t} });\n\treturn `Varchar<${length}>`;\n};\nconst sqlIntEncode = (value) => value;\nconst sqlIntDecode = (wire) => wire;\nconst sqlFloatEncode = (value) => value;\nconst sqlFloatDecode = (wire) => wire;\n/**\n* JSON has no spelling for a non-finite number, and a database that holds one\n* emits it as a string — PostgreSQL writes `\"NaN\"` and `\"Infinity\"`. This\n* codec's application type is `number`, so both directions reject rather than\n* carry a value that type cannot hold.\n*/\nconst sqlFloatEncodeJson = (value) => {\n\tif (!Number.isFinite(value)) throw structuredError(\"RUNTIME.ENCODE_FAILED\", `${SQL_FLOAT_CODEC_ID} application value must be a finite number, got ${value}`, { meta: { codec: SQL_FLOAT_CODEC_ID } });\n\treturn value;\n};\nconst sqlFloatDecodeJson = (json) => {\n\tif (typeof json !== \"number\" || !Number.isFinite(json)) throw structuredError(\"RUNTIME.DECODE_FAILED\", `Expected a finite number for ${SQL_FLOAT_CODEC_ID}, got ${JSON.stringify(json)}`, { meta: { codec: SQL_FLOAT_CODEC_ID } });\n\treturn json;\n};\nconst sqlTextEncode = (value) => value;\nconst sqlTextDecode = (wire) => wire;\n//#endregion\n//#region src/ast/sql-codecs.ts\nconst lengthParamsSchema = type({ \"length?\": \"number.integer > 0\" });\nvar SqlTextCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlTextEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlTextDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\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\ttargetTypes = [\"text\"];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => new SqlTextCodec(this);\n\t}\n};\nconst sqlTextDescriptor = new SqlTextDescriptor();\nconst sqlTextColumn = () => column(sqlTextDescriptor.factory(), sqlTextDescriptor.codecId, void 0, \"text\");\nvar SqlIntCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlIntEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlIntDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\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\ttargetTypes = [\"int\"];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => new SqlIntCodec(this);\n\t}\n};\nconst sqlIntDescriptor = new SqlIntDescriptor();\nconst sqlIntColumn = () => column(sqlIntDescriptor.factory(), sqlIntDescriptor.codecId, void 0, \"int\");\nvar SqlFloatCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlFloatEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlFloatDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn sqlFloatEncodeJson(value);\n\t}\n\tdecodeJson(json) {\n\t\treturn sqlFloatDecodeJson(json);\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\ttargetTypes = [\"float\"];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => new SqlFloatCodec(this);\n\t}\n};\nconst sqlFloatDescriptor = new SqlFloatDescriptor();\nconst sqlFloatColumn = () => column(sqlFloatDescriptor.factory(), sqlFloatDescriptor.codecId, void 0, \"float\");\nvar SqlCharCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlCharEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlCharDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\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\ttargetTypes = [\"char\"];\n\tparamsSchema = lengthParamsSchema;\n\trenderOutputType(params) {\n\t\treturn sqlCharRenderOutputType(params);\n\t}\n\tfactory(_params) {\n\t\treturn () => new SqlCharCodec(this);\n\t}\n};\nconst sqlCharDescriptor = new SqlCharDescriptor();\nconst sqlCharColumn = (params = {}) => column(sqlCharDescriptor.factory(params), sqlCharDescriptor.codecId, params, \"char\");\nvar SqlVarcharCodec = class extends CodecImpl {\n\tasync encode(value, _ctx) {\n\t\treturn sqlVarcharEncode(value);\n\t}\n\tasync decode(wire, _ctx) {\n\t\treturn sqlVarcharDecode(wire);\n\t}\n\tencodeJson(value) {\n\t\treturn value;\n\t}\n\tdecodeJson(json) {\n\t\treturn json;\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\ttargetTypes = [\"varchar\"];\n\tparamsSchema = lengthParamsSchema;\n\trenderOutputType(params) {\n\t\treturn sqlVarcharRenderOutputType(params);\n\t}\n\tfactory(_params) {\n\t\treturn () => new SqlVarcharCodec(this);\n\t}\n};\nconst sqlVarcharDescriptor = new SqlVarcharDescriptor();\nconst sqlVarcharColumn = (params = {}) => column(sqlVarcharDescriptor.factory(params), sqlVarcharDescriptor.codecId, params, \"varchar\");\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, NativeJsonValueProjection, NotExpr, NullCheckExpr, OperationExpr, OrExpr, OrderByItem, ParamRef, PreparedParamRef, PrimaryKeyConstraint, ProjectionItem, RawExpr, RawQueryAst, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID, SelectAst, SqlCharCodec, SqlCharDescriptor, SqlFloatCodec, SqlFloatDescriptor, SqlIntCodec, SqlIntDescriptor, SqlTextCodec, SqlTextDescriptor, SqlVarcharCodec, SqlVarcharDescriptor, SubqueryExpr, TableSource, UniqueConstraint, UpdateAst, WindowFuncExpr, aggregateFnNames, canonicalDateTime, canonicalNumeralText, collectOrderedParamRefs, compact, createNumberClassifier, escapePslString, frozenCodecRef, isAggregateFn, isDdlNode, isNonFiniteText, isNumeralText, isOrderByDirection, isOrderByNulls, isQueryAst, isWhereExpr, numeralText, parseJsonBody, printJsonBody, queryAstKinds, signedRange, sqlCharColumn, sqlCharDecode, sqlCharDescriptor, sqlCharEncode, sqlCharRenderOutputType, sqlFloatColumn, sqlFloatDecode, sqlFloatDecodeJson, sqlFloatDescriptor, sqlFloatEncode, sqlFloatEncodeJson, sqlIntColumn, sqlIntDecode, sqlIntDescriptor, sqlIntEncode, sqlTextColumn, sqlTextDecode, sqlTextDescriptor, sqlTextEncode, sqlVarcharColumn, sqlVarcharDecode, sqlVarcharDescriptor, sqlVarcharEncode, sqlVarcharRenderOutputType, whereExprKinds };\n\n//# sourceMappingURL=ast.mjs.map"],"mappings":";;;;;;AAQA,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,mCAAmC,IAAI,IAAI;CAChD;CACA;CACA;AACD,CAAC;AACD,MAAM,kBAAkB;;AAExB,SAAS,cAAc,MAAM;CAC5B,OAAO,aAAa,KAAK,IAAI,KAAK,aAAa,KAAK,IAAI;AACzD;;AAEA,SAAS,gBAAgB,MAAM;CAC9B,OAAO,iBAAiB,IAAI,IAAI;AACjC;;;;;AAKA,SAAS,qBAAqB,MAAM;CACnC,MAAM,UAAU,gBAAgB,KAAK,IAAI;CACzC,IAAI,YAAY,M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;AACtD,MAAM,oBAAoB,SAAS,CAAC,MAAM,OAAO,qBAAqB,QAAQ,MAAM,GAAG,qBAAqB,SAAS,QAAQ,SAAS"}
@@ -105,6 +105,34 @@ declare function parseJsonBody(text: string): JsonValue;
105
105
  /** Write a document as the body of a JSON literal. */
106
106
  declare function printJsonBody(value: JsonValue): string;
107
107
  //#endregion
108
+ //#region src/ast/date-time-canonical-form.d.ts
109
+ /**
110
+ * The reader the SQL targets build the canonical form of each date and time type with; ADR 254
111
+ * states the forms and the text it reads.
112
+ */
113
+ /** What a date or time type holds, which decides the text it reads and writes. */
114
+ type DateTimeShape = 'date' | 'time' | 'timeWithOffset' | 'dateTime' | 'instant';
115
+ interface CanonicalDateTimeOptions {
116
+ readonly shape: DateTimeShape;
117
+ /** The data type id, which messages name. */
118
+ readonly dataTypeId: string;
119
+ /** The largest UTC offset the type holds, in hours. Defaults to 23. */
120
+ readonly maxOffsetHours?: number;
121
+ /** The most digits after the decimal point the type holds. Defaults to 6, microseconds. */
122
+ readonly maxFractionDigits?: 3 | 6;
123
+ /** The earliest and latest values the type holds, each in canonical form. */
124
+ readonly range?: {
125
+ readonly earliest: string;
126
+ readonly latest: string;
127
+ };
128
+ }
129
+ /**
130
+ * The canonical form of written date or time text, or a refusal with a message that says what is
131
+ * wrong and shows text the type holds. `written` is the text as its author wrote it, which the
132
+ * message shows, when a target rewrote it into ISO 8601 before calling this.
133
+ */
134
+ declare function canonicalDateTime(text: string, options: CanonicalDateTimeOptions, written?: string): string;
135
+ //#endregion
108
136
  //#region src/ast/sql-codec-helpers.d.ts
109
137
  declare const SQL_CHAR_CODEC_ID: "sql/char@1";
110
138
  declare const SQL_VARCHAR_CODEC_ID: "sql/varchar@1";
@@ -232,5 +260,5 @@ declare function compact<T extends Record<string, unknown>>(o: T): T;
232
260
  */
233
261
  declare function collectOrderedParamRefs(ast: AnyQueryAst): ReadonlyArray<AnyParamRef>;
234
262
  //#endregion
235
- export { sqlTextDescriptor as $, isNonFiniteText as A, sqlCharRenderOutputType as B, SqlVarcharCodec as C, compact as D, collectOrderedParamRefs as E, signedRange as F, sqlFloatEncode as G, sqlFloatDecode as H, sqlCharColumn as I, sqlIntDecode as J, sqlFloatEncodeJson as K, sqlCharDecode as L, numeralText as M, parseJsonBody as N, createNumberClassifier as O, printJsonBody as P, sqlTextDecode as Q, sqlCharDescriptor as R, SqlTextDescriptor as S, canonicalNumeralText as T, sqlFloatDecodeJson as U, sqlFloatColumn as V, sqlFloatDescriptor as W, sqlIntEncode as X, sqlIntDescriptor as Y, sqlTextColumn as Z, SqlFloatCodec as _, Lowerer as a, sqlVarcharRenderOutputType as at, SqlIntDescriptor as b, NumberClassification as c, SQL_FLOAT_CODEC_ID as d, sqlTextEncode as et, SQL_INT_CODEC_ID as f, SqlCharDescriptor as g, SqlCharCodec as h, IntegerStep as i, sqlVarcharEncode as it, isNumeralText as j, escapePslString as k, NumberClassifierSpec as l, SQL_VARCHAR_CODEC_ID as m, AdapterProfile as n, sqlVarcharDecode as nt, LowererContext as o, SQL_TEXT_CODEC_ID as p, sqlIntColumn as q, AdapterTarget as r, sqlVarcharDescriptor as rt, MarkerReadResult as s, Adapter as t, sqlVarcharColumn as tt, SQL_CHAR_CODEC_ID as u, SqlFloatDescriptor as v, SqlVarcharDescriptor as w, SqlTextCodec as x, SqlIntCodec as y, sqlCharEncode as z };
236
- //# sourceMappingURL=ast-B9jF6tRJ.d.mts.map
263
+ export { sqlIntEncode as $, compact as A, sqlCharDecode as B, SqlTextCodec as C, canonicalDateTime as D, SqlVarcharDescriptor as E, numeralText as F, sqlFloatDecode as G, sqlCharEncode as H, parseJsonBody as I, sqlFloatEncode as J, sqlFloatDecodeJson as K, printJsonBody as L, escapePslString as M, isNonFiniteText as N, canonicalNumeralText as O, isNumeralText as P, sqlIntDescriptor as Q, signedRange as R, SqlIntDescriptor as S, SqlVarcharCodec as T, sqlCharRenderOutputType as U, sqlCharDescriptor as V, sqlFloatColumn as W, sqlIntColumn as X, sqlFloatEncodeJson as Y, sqlIntDecode as Z, SqlCharCodec as _, DateTimeShape as a, sqlVarcharDecode as at, SqlFloatDescriptor as b, LowererContext as c, sqlVarcharRenderOutputType as ct, NumberClassifierSpec as d, sqlTextColumn as et, SQL_CHAR_CODEC_ID as f, SQL_VARCHAR_CODEC_ID as g, SQL_TEXT_CODEC_ID as h, CanonicalDateTimeOptions as i, sqlVarcharColumn as it, createNumberClassifier as j, collectOrderedParamRefs as k, MarkerReadResult as l, SQL_INT_CODEC_ID as m, AdapterProfile as n, sqlTextDescriptor as nt, IntegerStep as o, sqlVarcharDescriptor as ot, SQL_FLOAT_CODEC_ID as p, sqlFloatDescriptor as q, AdapterTarget as r, sqlTextEncode as rt, Lowerer as s, sqlVarcharEncode as st, Adapter as t, sqlTextDecode as tt, NumberClassification as u, SqlCharDescriptor as v, SqlTextDescriptor as w, SqlIntCodec as x, SqlFloatCodec as y, sqlCharColumn as z };
264
+ //# sourceMappingURL=ast-DQU1yUQ5.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-DQU1yUQ5.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;;;;;iBAKtC,cAAc;;iBAEd,gBAAgB;;;;;iBAKhB,qBAAqB;;;;;iBAKrB,YAAY;;iBAEZ,gBAAgB;;UAEvB;WACC,MAAM;WACN;;;UAGD,oBAAoB;WACnB;WACA;;;iBAGM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;cAE9B,oBAAoB;cACpB,qEAAqE,WAAW;cAChF,qBAAqB,iBAAiB;EAClD,OAAO,eAAe,MAAM,mBAAqB;EACjD,OAAO,cAAc,MAAM,mBAAqB;EAChD,WAAW,gBAAgB;EAC3B,WAAW,MAAM;;cAEL,0BAA0B,4BAA4B;WACzD;WACA;WACA;WACA,cAAc,iBAAiB;EACxC,iBAAiB,QAAQ;EACzB,QAAQ,SAAS,gBAAgB,KAAK,yBAAyB;;cAEnD,mBAAmB;cACnB,gBAAgB,SAAS,gEAAgE,WAAW,cAAc;cAClH,wBAAwB,iBAAiB;EACrD,OAAO,eAAe,MAAM,mBAAqB;EACjD,OAAO,cAAc,MAAM,mBAAqB;EAChD,WAAW,gBAAgB;EAC3B,WAAW,MAAM;;cAEL,6BAA6B,4BAA4B;WAC5D;WACA;WACA;WACA,cAAc,iBAAiB;EACxC,iBAAiB,QAAQ;EACzB,QAAQ,SAAS,gBAAgB,KAAK,yBAAyB;;cAEnD,sBAAsB;cACtB,mBAAmB,SAAS,gEAAgE,WAAW,iBAAiB;;;iBAGrH,QAAQ,UAAU,yBAAyB,GAAG,IAAI;;;;;;;;;;;iBAWlD,wBAAwB,KAAK,cAAc,cAAc"}
@@ -1,6 +1,6 @@
1
1
  import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
2
- import { i as computeCheckContentHash, n as assertWireNamePrefixLength } from "./naming-DKr4TJd7-Cszhq9RV.mjs";
3
- import { t as exactNameBodyWarning } from "./index-naming-Cj1Anq-T-w1JL7-EM.mjs";
2
+ import { i as computeCheckContentHash, n as assertWireNamePrefixLength } from "./naming-Cc_t1q6s-CouBOmqZ.mjs";
3
+ import { t as exactNameBodyWarning } from "./index-naming-Cj1Anq-T-C9TevpPR.mjs";
4
4
  import { flushAuthoringWarnings } from "@prisma/orm-framework/components/authoring";
5
5
  //#region ../../../2-sql/1-core/contract/dist/authored-check-naming.mjs
6
6
  /**
@@ -44,4 +44,4 @@ function lowerAuthoredCheck(tableName, authored, warnings) {
44
44
  //#endregion
45
45
  export { lowerAuthoredCheck as t };
46
46
 
47
- //# sourceMappingURL=authored-check-naming-9UFx77db.mjs.map
47
+ //# sourceMappingURL=authored-check-naming-CJRDf9-V.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"authored-check-naming-9UFx77db.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/authored-check-naming.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { t as exactNameBodyWarning } from \"./index-naming-Cj1Anq-T.mjs\";\nimport { flushAuthoringWarnings } from \"@internal/framework-components/authoring\";\nimport { assertWireNamePrefixLength, computeCheckContentHash } from \"@internal/sql-schema-ir/naming\";\n//#region src/authored-check-naming.ts\n/**\n* Lowers an authored check constraint into the name-identified entity\n* `contract.json` persists: exact mode adopts `map` verbatim (no prefix, no\n* hash) and warns, because a hand-authored body compared verbatim against\n* Postgres's reprint would false-drift; wire mode appends the content-hash\n* suffix to the authored prefix. There is no default prefix to fall back on\n* — a check has no column tuple to derive one from, unlike an index — so an\n* absent `name` is only valid alongside a present `map`. The cross-field\n* guards are the shared enforcement backstop for both authoring surfaces\n* (PSL pre-empts them with span-anchored diagnostics).\n*/\nfunction lowerAuthoredCheck(tableName, authored, warnings) {\n\tif (authored.map !== void 0 && authored.name !== void 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Check \"${authored.map}\" on table \"${tableName}\": map and name are mutually exclusive — map adopts an exact physical name, name is a wire prefix.`);\n\tif (authored.expression.trim().length === 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Check on table \"${tableName}\": expression must not be empty — an empty predicate is not a constraint.`);\n\tif (authored.map !== void 0) {\n\t\tconst warning = exactNameBodyWarning(\"check\", authored.map);\n\t\tif (warnings !== void 0) warnings.push(warning);\n\t\telse flushAuthoringWarnings([warning]);\n\t\treturn {\n\t\t\tnaming: {\n\t\t\t\tkind: \"exact\",\n\t\t\t\tname: authored.map\n\t\t\t},\n\t\t\texpression: authored.expression\n\t\t};\n\t}\n\tif (authored.name === void 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Check on table \"${tableName}\": a check constraint requires an explicit name (name:) or exact physical name (map:) — unlike an index there is no column tuple to derive a default name from.`);\n\tconst prefix = authored.name;\n\tassertWireNamePrefixLength(prefix, \"check prefix\");\n\treturn {\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix,\n\t\t\thash: computeCheckContentHash(authored.expression)\n\t\t},\n\t\texpression: authored.expression\n\t};\n}\n//#endregion\nexport { lowerAuthoredCheck };\n\n//# sourceMappingURL=authored-check-naming.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAS,mBAAmB,WAAW,UAAU,UAAU;CAC1D,IAAI,SAAS,QAAQ,KAAK,KAAK,SAAS,SAAS,KAAK,GAAG,MAAM,cAAc,6BAA6B,UAAU,SAAS,IAAI,cAAc,UAAU,mGAAmG;CAC5P,IAAI,SAAS,WAAW,KAAK,CAAC,CAAC,WAAW,GAAG,MAAM,cAAc,6BAA6B,mBAAmB,UAAU,0EAA0E;CACrM,IAAI,SAAS,QAAQ,KAAK,GAAG;EAC5B,MAAM,UAAU,qBAAqB,SAAS,SAAS,GAAG;EAC1D,IAAI,aAAa,KAAK,GAAG,SAAS,KAAK,OAAO;OACzC,uBAAuB,CAAC,OAAO,CAAC;EACrC,OAAO;GACN,QAAQ;IACP,MAAM;IACN,MAAM,SAAS;GAChB;GACA,YAAY,SAAS;EACtB;CACD;CACA,IAAI,SAAS,SAAS,KAAK,GAAG,MAAM,cAAc,6BAA6B,mBAAmB,UAAU,gKAAgK;CAC5Q,MAAM,SAAS,SAAS;CACxB,2BAA2B,QAAQ,cAAc;CACjD,OAAO;EACN,QAAQ;GACP,MAAM;GACN;GACA,MAAM,wBAAwB,SAAS,UAAU;EAClD;EACA,YAAY,SAAS;CACtB;AACD"}
1
+ {"version":3,"file":"authored-check-naming-CJRDf9-V.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/authored-check-naming.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { t as exactNameBodyWarning } from \"./index-naming-Cj1Anq-T.mjs\";\nimport { flushAuthoringWarnings } from \"@internal/framework-components/authoring\";\nimport { assertWireNamePrefixLength, computeCheckContentHash } from \"@internal/sql-schema-ir/naming\";\n//#region src/authored-check-naming.ts\n/**\n* Lowers an authored check constraint into the name-identified entity\n* `contract.json` persists: exact mode adopts `map` verbatim (no prefix, no\n* hash) and warns, because a hand-authored body compared verbatim against\n* Postgres's reprint would false-drift; wire mode appends the content-hash\n* suffix to the authored prefix. There is no default prefix to fall back on\n* — a check has no column tuple to derive one from, unlike an index — so an\n* absent `name` is only valid alongside a present `map`. The cross-field\n* guards are the shared enforcement backstop for both authoring surfaces\n* (PSL pre-empts them with span-anchored diagnostics).\n*/\nfunction lowerAuthoredCheck(tableName, authored, warnings) {\n\tif (authored.map !== void 0 && authored.name !== void 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Check \"${authored.map}\" on table \"${tableName}\": map and name are mutually exclusive — map adopts an exact physical name, name is a wire prefix.`);\n\tif (authored.expression.trim().length === 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Check on table \"${tableName}\": expression must not be empty — an empty predicate is not a constraint.`);\n\tif (authored.map !== void 0) {\n\t\tconst warning = exactNameBodyWarning(\"check\", authored.map);\n\t\tif (warnings !== void 0) warnings.push(warning);\n\t\telse flushAuthoringWarnings([warning]);\n\t\treturn {\n\t\t\tnaming: {\n\t\t\t\tkind: \"exact\",\n\t\t\t\tname: authored.map\n\t\t\t},\n\t\t\texpression: authored.expression\n\t\t};\n\t}\n\tif (authored.name === void 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `Check on table \"${tableName}\": a check constraint requires an explicit name (name:) or exact physical name (map:) — unlike an index there is no column tuple to derive a default name from.`);\n\tconst prefix = authored.name;\n\tassertWireNamePrefixLength(prefix, \"check prefix\");\n\treturn {\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix,\n\t\t\thash: computeCheckContentHash(authored.expression)\n\t\t},\n\t\texpression: authored.expression\n\t};\n}\n//#endregion\nexport { lowerAuthoredCheck };\n\n//# sourceMappingURL=authored-check-naming.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAS,mBAAmB,WAAW,UAAU,UAAU;CAC1D,IAAI,SAAS,QAAQ,KAAK,KAAK,SAAS,SAAS,KAAK,GAAG,MAAM,cAAc,6BAA6B,UAAU,SAAS,IAAI,cAAc,UAAU,mGAAmG;CAC5P,IAAI,SAAS,WAAW,KAAK,CAAC,CAAC,WAAW,GAAG,MAAM,cAAc,6BAA6B,mBAAmB,UAAU,0EAA0E;CACrM,IAAI,SAAS,QAAQ,KAAK,GAAG;EAC5B,MAAM,UAAU,qBAAqB,SAAS,SAAS,GAAG;EAC1D,IAAI,aAAa,KAAK,GAAG,SAAS,KAAK,OAAO;OACzC,uBAAuB,CAAC,OAAO,CAAC;EACrC,OAAO;GACN,QAAQ;IACP,MAAM;IACN,MAAM,SAAS;GAChB;GACA,YAAY,SAAS;EACtB;CACD;CACA,IAAI,SAAS,SAAS,KAAK,GAAG,MAAM,cAAc,6BAA6B,mBAAmB,UAAU,gKAAgK;CAC5Q,MAAM,SAAS,SAAS;CACxB,2BAA2B,QAAQ,cAAc;CACjD,OAAO;EACN,QAAQ;GACP,MAAM;GACN;GACA,MAAM,wBAAwB,SAAS,UAAU;EAClD;EACA,YAAY,SAAS;CACtB;AACD"}
@@ -1,4 +1,4 @@
1
- import { s as enumType } from "./contract-builder-BKfGg37_.mjs";
1
+ import { s as enumType } from "./contract-builder-CqKOW_SG.mjs";
2
2
  import { resolveEnumCodecId } from "@prisma/orm-framework/components/authoring";
3
3
  import { blockAttribute, jsonValue, mapBlock, str } from "@prisma/orm-framework/psl-parser";
4
4
  //#region ../../../2-sql/9-family/dist/authoring-type-constructors-DQZEX4Sb.mjs
@@ -318,4 +318,4 @@ const sqlFamilyAuthoringTypes = { sql: { String: {
318
318
  //#endregion
319
319
  export { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringTypes as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringFieldPresets as t };
320
320
 
321
- //# sourceMappingURL=authoring-type-constructors-DQZEX4Sb-DORF5BnN.mjs.map
321
+ //# sourceMappingURL=authoring-type-constructors-DQZEX4Sb-DXWRbv5g.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"authoring-type-constructors-DQZEX4Sb-DORF5BnN.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/authoring-type-constructors-DQZEX4Sb.mjs"],"sourcesContent":["import { resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport { blockAttribute, jsonValue, mapBlock, str } from \"@internal/psl-parser\";\nimport { enumType } from \"@internal/sql-contract-ts/contract-builder\";\n//#region src/core/authoring-entity-types.ts\nfunction sqlFamilyEnumSpec() {\n\treturn mapBlock({\n\t\tvalue: {\n\t\t\ttype: jsonValue(),\n\t\t\tdocumentation: \"The stored member value; a bare member stores its own name.\"\n\t\t},\n\t\tallowBare: true\n\t});\n}\nconst sqlFamilyEntityTypes = { enum: {\n\tkind: \"entity\",\n\tdiscriminator: \"enum\",\n\toutput: { factory: (block, ctx) => {\n\t\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\t\tconst diagnostics = ctx.diagnostics;\n\t\tconst resolved = resolveEnumCodecId(block, ctx);\n\t\tif (resolved === void 0) return;\n\t\tconst { codecId, codecSpan } = resolved;\n\t\tconst nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];\n\t\tif (nativeType === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst codec = ctx.codecLookup?.get(codecId);\n\t\tif (codec === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst seenValues = /* @__PURE__ */ new Set();\n\t\tconst members = [];\n\t\tlet memberError = false;\n\t\tfor (const [memberName, memberValue] of Object.entries(block.values)) {\n\t\t\tconst span = block.parameterSpans[memberName] ?? block.span;\n\t\t\tlet value;\n\t\t\tif (memberValue === void 0) try {\n\t\t\t\tvalue = codec.decodeJson(memberName);\n\t\t\t} catch {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC\",\n\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse try {\n\t\t\t\tvalue = codec.decodeJson(memberValue);\n\t\t\t} catch (err) {\n\t\t\t\tconst reason = err instanceof Error ? err.message : String(err);\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst valueKey = String(value);\n\t\t\tif (seenValues.has(valueKey)) {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\t\t\tmessage: `enum \"${block.name}\": duplicate member value \"${valueKey}\"`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenValues.add(valueKey);\n\t\t\tmembers.push({\n\t\t\t\tname: memberName,\n\t\t\t\tvalue\n\t\t\t});\n\t\t}\n\t\tif (memberError) return void 0;\n\t\tif (members.length === 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_MISSING_TYPE\",\n\t\t\t\tmessage: `enum \"${block.name}\" must have at least one member`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.span\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\treturn enumType(block.name, {\n\t\t\tcodecId,\n\t\t\tnativeType\n\t\t}, ...members.map((m) => ({\n\t\t\tname: m.name,\n\t\t\tvalue: m.value\n\t\t})));\n\t} }\n} };\nconst enumTypeBlockAttribute = blockAttribute(\"type\", {\n\tdocumentation: \"Selects the storage codec for this enum.\",\n\tpositional: [{\n\t\tkey: \"codecId\",\n\t\ttype: str(),\n\t\tdocumentation: \"The fully qualified codec identifier used to store enum values.\"\n\t}]\n});\nconst sqlFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdocumentation: \"Defines an enum with named values and an inferred or explicitly selected storage codec.\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tspec: sqlFamilyEnumSpec,\n\tattributes: { type: () => enumTypeBlockAttribute }\n} };\n//#endregion\n//#region src/core/authoring-field-presets.ts\n/**\n* Family-level SQL authoring field presets.\n*\n* Only presets whose codec IDs align with the ID generator metadata live here\n* (see `@internal/ids`). These presets are target-agnostic because the\n* generator metadata fixes their codec/native-type to `sql/char@1`\n* (`character`) regardless of target, and the PSL interpreter lets the\n* generator override the scalar descriptor.\n*\n* The `uuidString` / `id.uuidv4String` / `id.uuidv7String` presets store UUID\n* values as `character(36)` — portable across all SQL targets. For a native\n* Postgres `uuid` column use `uuidNative` / `id.uuidv4Native` /\n* `id.uuidv7Native` from `@internal/target-postgres`.\n*\n* Scalar presets that map to target-specific codecs (e.g. `text`, `int`,\n* `boolean`, `dateTime`) are contributed by the target pack (see\n* `postgresAuthoringFieldPresets` in `@internal/target-postgres`) so the\n* TS callback surface and the PSL scalar surface lower to byte-identical\n* contracts for the active target.\n*/\nconst CHARACTER_CODEC_ID = \"sql/char@1\";\nconst CHARACTER_NATIVE_TYPE = \"character\";\nconst nanoidOptionsArgument = {\n\tkind: \"object\",\n\toptional: true,\n\tproperties: { size: {\n\t\tkind: \"number\",\n\t\toptional: true,\n\t\tinteger: true,\n\t\tminimum: 2,\n\t\tmaximum: 255\n\t} }\n};\nconst sqlFamilyAuthoringFieldPresets = {\n\tuuidString: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 36 }\n\t\t}\n\t},\n\tulid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 26 }\n\t\t}\n\t},\n\tnanoid: {\n\t\tkind: \"fieldPreset\",\n\t\targs: [nanoidOptionsArgument],\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0,\n\t\t\t\tpath: [\"size\"],\n\t\t\t\tdefault: 21\n\t\t\t} }\n\t\t}\n\t},\n\tcuid2: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 24 }\n\t\t}\n\t},\n\tksuid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 27 }\n\t\t}\n\t},\n\tid: {\n\t\tuuidv4String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv4\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tuuidv7String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv7\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tulid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 26 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ulid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tnanoid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\targs: [nanoidOptionsArgument],\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0,\n\t\t\t\t\tpath: [\"size\"],\n\t\t\t\t\tdefault: 21\n\t\t\t\t} },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"nanoid\",\n\t\t\t\t\tparams: { size: {\n\t\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\t\tindex: 0,\n\t\t\t\t\t\tpath: [\"size\"]\n\t\t\t\t\t} }\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tcuid2: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 24 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"cuid2\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tksuid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 27 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ksuid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/authoring-type-constructors.ts\nconst sqlFamilyAuthoringTypes = { sql: { String: {\n\tkind: \"typeConstructor\",\n\tdocumentation: \"Variable-length text with a required maximum character length.\",\n\targs: [{\n\t\tkind: \"number\",\n\t\tname: \"length\",\n\t\tinteger: true,\n\t\tminimum: 1,\n\t\tmaximum: 10485760\n\t}],\n\toutput: {\n\t\tcodecId: \"sql/varchar@1\",\n\t\tnativeType: \"character varying\",\n\t\ttypeParams: { length: {\n\t\t\tkind: \"arg\",\n\t\t\tindex: 0\n\t\t} }\n\t}\n} } };\n//#endregion\nexport { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringFieldPresets as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringTypes as t };\n\n//# sourceMappingURL=authoring-type-constructors-DQZEX4Sb.mjs.map"],"mappings":";;;;AAIA,SAAS,oBAAoB;CAC5B,OAAO,SAAS;EACf,OAAO;GACN,MAAM,UAAU;GAChB,eAAe;EAChB;EACA,WAAW;CACZ,CAAC;AACF;AACA,MAAM,uBAAuB,EAAE,MAAM;CACpC,MAAM;CACN,eAAe;CACf,QAAQ,EAAE,UAAU,OAAO,QAAQ;EAClC,MAAM,WAAW,IAAI,YAAY;EACjC,MAAM,cAAc,IAAI;EACxB,MAAM,WAAW,mBAAmB,OAAO,GAAG;EAC9C,IAAI,aAAa,KAAK,GAAG;EACzB,MAAM,EAAE,SAAS,cAAc;EAC/B,MAAM,aAAa,IAAI,aAAa,eAAe,OAAO,CAAC,GAAG;EAC9D,IAAI,eAAe,KAAK,GAAG;GAC1B,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,qCAAqC,QAAQ;IAC1E;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,QAAQ,IAAI,aAAa,IAAI,OAAO;EAC1C,IAAI,UAAU,KAAK,GAAG;GACrB,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,kBAAkB,QAAQ;IACvD;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,6BAA6B,IAAI,IAAI;EAC3C,MAAM,UAAU,CAAC;EACjB,IAAI,cAAc;EAClB,KAAK,MAAM,CAAC,YAAY,gBAAgB,OAAO,QAAQ,MAAM,MAAM,GAAG;GACrE,MAAM,OAAO,MAAM,eAAe,eAAe,MAAM;GACvD,IAAI;GACJ,IAAI,gBAAgB,KAAK,GAAG,IAAI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GACN,QAAQ;IACP,SAAS;IACT,YAAY;IACZ,YAAY,EAAE,QAAQ,GAAG;IACzB,mBAAmB,EAAE,UAAU;KAC9B,MAAM;KACN,IAAI;IACL,EAAE;IACF,IAAI;GACL;EACD;EACA,QAAQ;GACP,MAAM;GACN,MAAM,CAAC,qBAAqB;GAC5B,QAAQ;IACP,SAAS;IACT,YAAY;IACZ,YAAY,EAAE,QAAQ;KACrB,MAAM;KACN,OAAO;KACP,MAAM,CAAC,MAAM;KACb,SAAS;IACV,EAAE;IACF,mBAAmB,EAAE,UAAU;KAC9B,MAAM;KACN,IAAI;KACJ,QAAQ,EAAE,MAAM;MACf,MAAM;MACN,OAAO;MACP,MAAM,CAAC,MAAM;KACd,EAAE;IACH,EAAE;IACF,IAAI;GACL;EACD;EACA,OAAO;GACN,MAAM;GACN,QAAQ;IACP,SAAS;IACT,YAAY;IACZ,YAAY,EAAE,QAAQ,GAAG;IACzB,mBAAmB,EAAE,UAAU;KAC9B,MAAM;KACN,IAAI;IACL,EAAE;IACF,IAAI;GACL;EACD;EACA,OAAO;GACN,MAAM;GACN,QAAQ;IACP,SAAS;IACT,YAAY;IACZ,YAAY,EAAE,QAAQ,GAAG;IACzB,mBAAmB,EAAE,UAAU;KAC9B,MAAM;KACN,IAAI;IACL,EAAE;IACF,IAAI;GACL;EACD;CACD;AACD;AAGA,MAAM,0BAA0B,EAAE,KAAK,EAAE,QAAQ;CAChD,MAAM;CACN,eAAe;CACf,MAAM,CAAC;EACN,MAAM;EACN,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS;CACV,CAAC;CACD,QAAQ;EACP,SAAS;EACT,YAAY;EACZ,YAAY,EAAE,QAAQ;GACrB,MAAM;GACN,OAAO;EACR,EAAE;CACH;AACD,EAAE,EAAE"}
1
+ {"version":3,"file":"authoring-type-constructors-DQZEX4Sb-DXWRbv5g.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/authoring-type-constructors-DQZEX4Sb.mjs"],"sourcesContent":["import { resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport { blockAttribute, jsonValue, mapBlock, str } from \"@internal/psl-parser\";\nimport { enumType } from \"@internal/sql-contract-ts/contract-builder\";\n//#region src/core/authoring-entity-types.ts\nfunction sqlFamilyEnumSpec() {\n\treturn mapBlock({\n\t\tvalue: {\n\t\t\ttype: jsonValue(),\n\t\t\tdocumentation: \"The stored member value; a bare member stores its own name.\"\n\t\t},\n\t\tallowBare: true\n\t});\n}\nconst sqlFamilyEntityTypes = { enum: {\n\tkind: \"entity\",\n\tdiscriminator: \"enum\",\n\toutput: { factory: (block, ctx) => {\n\t\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\t\tconst diagnostics = ctx.diagnostics;\n\t\tconst resolved = resolveEnumCodecId(block, ctx);\n\t\tif (resolved === void 0) return;\n\t\tconst { codecId, codecSpan } = resolved;\n\t\tconst nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];\n\t\tif (nativeType === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst codec = ctx.codecLookup?.get(codecId);\n\t\tif (codec === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst seenValues = /* @__PURE__ */ new Set();\n\t\tconst members = [];\n\t\tlet memberError = false;\n\t\tfor (const [memberName, memberValue] of Object.entries(block.values)) {\n\t\t\tconst span = block.parameterSpans[memberName] ?? block.span;\n\t\t\tlet value;\n\t\t\tif (memberValue === void 0) try {\n\t\t\t\tvalue = codec.decodeJson(memberName);\n\t\t\t} catch {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC\",\n\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse try {\n\t\t\t\tvalue = codec.decodeJson(memberValue);\n\t\t\t} catch (err) {\n\t\t\t\tconst reason = err instanceof Error ? err.message : String(err);\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst valueKey = String(value);\n\t\t\tif (seenValues.has(valueKey)) {\n\t\t\t\tdiagnostics?.push({\n\t\t\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\t\t\tmessage: `enum \"${block.name}\": duplicate member value \"${valueKey}\"`,\n\t\t\t\t\tsourceId,\n\t\t\t\t\tspan\n\t\t\t\t});\n\t\t\t\tmemberError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenValues.add(valueKey);\n\t\t\tmembers.push({\n\t\t\t\tname: memberName,\n\t\t\t\tvalue\n\t\t\t});\n\t\t}\n\t\tif (memberError) return void 0;\n\t\tif (members.length === 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_MISSING_TYPE\",\n\t\t\t\tmessage: `enum \"${block.name}\" must have at least one member`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.span\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\treturn enumType(block.name, {\n\t\t\tcodecId,\n\t\t\tnativeType\n\t\t}, ...members.map((m) => ({\n\t\t\tname: m.name,\n\t\t\tvalue: m.value\n\t\t})));\n\t} }\n} };\nconst enumTypeBlockAttribute = blockAttribute(\"type\", {\n\tdocumentation: \"Selects the storage codec for this enum.\",\n\tpositional: [{\n\t\tkey: \"codecId\",\n\t\ttype: str(),\n\t\tdocumentation: \"The fully qualified codec identifier used to store enum values.\"\n\t}]\n});\nconst sqlFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdocumentation: \"Defines an enum with named values and an inferred or explicitly selected storage codec.\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tspec: sqlFamilyEnumSpec,\n\tattributes: { type: () => enumTypeBlockAttribute }\n} };\n//#endregion\n//#region src/core/authoring-field-presets.ts\n/**\n* Family-level SQL authoring field presets.\n*\n* Only presets whose codec IDs align with the ID generator metadata live here\n* (see `@internal/ids`). These presets are target-agnostic because the\n* generator metadata fixes their codec/native-type to `sql/char@1`\n* (`character`) regardless of target, and the PSL interpreter lets the\n* generator override the scalar descriptor.\n*\n* The `uuidString` / `id.uuidv4String` / `id.uuidv7String` presets store UUID\n* values as `character(36)` — portable across all SQL targets. For a native\n* Postgres `uuid` column use `uuidNative` / `id.uuidv4Native` /\n* `id.uuidv7Native` from `@internal/target-postgres`.\n*\n* Scalar presets that map to target-specific codecs (e.g. `text`, `int`,\n* `boolean`, `dateTime`) are contributed by the target pack (see\n* `postgresAuthoringFieldPresets` in `@internal/target-postgres`) so the\n* TS callback surface and the PSL scalar surface lower to byte-identical\n* contracts for the active target.\n*/\nconst CHARACTER_CODEC_ID = \"sql/char@1\";\nconst CHARACTER_NATIVE_TYPE = \"character\";\nconst nanoidOptionsArgument = {\n\tkind: \"object\",\n\toptional: true,\n\tproperties: { size: {\n\t\tkind: \"number\",\n\t\toptional: true,\n\t\tinteger: true,\n\t\tminimum: 2,\n\t\tmaximum: 255\n\t} }\n};\nconst sqlFamilyAuthoringFieldPresets = {\n\tuuidString: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 36 }\n\t\t}\n\t},\n\tulid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 26 }\n\t\t}\n\t},\n\tnanoid: {\n\t\tkind: \"fieldPreset\",\n\t\targs: [nanoidOptionsArgument],\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0,\n\t\t\t\tpath: [\"size\"],\n\t\t\t\tdefault: 21\n\t\t\t} }\n\t\t}\n\t},\n\tcuid2: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 24 }\n\t\t}\n\t},\n\tksuid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\ttypeParams: { length: 27 }\n\t\t}\n\t},\n\tid: {\n\t\tuuidv4String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv4\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tuuidv7String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv7\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tulid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 26 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ulid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tnanoid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\targs: [nanoidOptionsArgument],\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0,\n\t\t\t\t\tpath: [\"size\"],\n\t\t\t\t\tdefault: 21\n\t\t\t\t} },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"nanoid\",\n\t\t\t\t\tparams: { size: {\n\t\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\t\tindex: 0,\n\t\t\t\t\t\tpath: [\"size\"]\n\t\t\t\t\t} }\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tcuid2: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 24 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"cuid2\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tksuid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\tnativeType: CHARACTER_NATIVE_TYPE,\n\t\t\t\ttypeParams: { length: 27 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ksuid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/authoring-type-constructors.ts\nconst sqlFamilyAuthoringTypes = { sql: { String: {\n\tkind: \"typeConstructor\",\n\tdocumentation: \"Variable-length text with a required maximum character length.\",\n\targs: [{\n\t\tkind: \"number\",\n\t\tname: \"length\",\n\t\tinteger: true,\n\t\tminimum: 1,\n\t\tmaximum: 10485760\n\t}],\n\toutput: {\n\t\tcodecId: \"sql/varchar@1\",\n\t\tnativeType: \"character varying\",\n\t\ttypeParams: { length: {\n\t\t\tkind: \"arg\",\n\t\t\tindex: 0\n\t\t} }\n\t}\n} } };\n//#endregion\nexport { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringFieldPresets as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringTypes as t };\n\n//# sourceMappingURL=authoring-type-constructors-DQZEX4Sb.mjs.map"],"mappings":";;;;AAIA,SAAS,oBAAoB;CAC5B,OAAO,SAAS;EACf,OAAO;GACN,MAAM,UAAU;GAChB,eAAe;EAChB;EACA,WAAW;CACZ,CAAC;AACF;AACA,MAAM,uBAAuB,EAAE,MAAM;CACpC,MAAM;CACN,eAAe;CACf,QAAQ,EAAE,UA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AM;KACd,EAAE;IACH,EAAE;IACF,IAAI;GACL;EACD;EACA,OAAO;GACN,MAAM;GACN,QAAQ;IACP,SAAS;IACT,YAAY;IACZ,YAAY,EAAE,QAAQ,GAAG;IACzB,mBAAmB,EAAE,UAAU;KAC9B,MAAM;KACN,IAAI;IACL,EAAE;IACF,IAAI;GACL;EACD;EACA,OAAO;GACN,MAAM;GACN,QAAQ;IACP,SAAS;IACT,YAAY;IACZ,YAAY,EAAE,QAAQ,GAAG;IACzB,mBAAmB,EAAE,UAAU;KAC9B,MAAM;KACN,IAAI;IACL,EAAE;IACF,IAAI;GACL;EACD;CACD;AACD;AAGA,MAAM,0BAA0B,EAAE,KAAK,EAAE,QAAQ;CAChD,MAAM;CACN,eAAe;CACf,MAAM,CAAC;EACN,MAAM;EACN,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS;CACV,CAAC;CACD,QAAQ;EACP,SAAS;EACT,YAAY;EACZ,YAAY,EAAE,QAAQ;GACrB,MAAM;GACN,OAAO;EACR,EAAE;CACH;AACD,EAAE,EAAE"}
@@ -1,3 +1,3 @@
1
1
  import { o as Expression, x as ScopeField } from "./expression-BPoA5eEl.mjs";
2
- import { T as WhereFilter, _ as SelectQuery, a as DeleteQuery, c as GatedMethod, f as QueryContext, g as Scope, h as ResolveRow, i as Db, l as GroupedQuery, s as Functions, t as AggregateFunctions, u as InsertQuery, v as Subquery, w as UpdateQuery, x as TableProxy } from "./db-DLjWu9-f-6BG2QArC.mjs";
2
+ import { T as WhereFilter, _ as SelectQuery, a as DeleteQuery, c as GatedMethod, f as QueryContext, g as Scope, h as ResolveRow, i as Db, l as GroupedQuery, s as Functions, t as AggregateFunctions, u as InsertQuery, v as Subquery, w as UpdateQuery, x as TableProxy } from "./db-DLjWu9-f-CVAu8jgd.mjs";
3
3
  export type { AggregateFunctions, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, InsertQuery, QueryContext, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableProxy, UpdateQuery, WhereFilter };
@@ -2,9 +2,9 @@ import { c as SqlStorage } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
2
2
  import "./types-C36_3E6_.mjs";
3
3
  import { i as SqlOperationEntry } from "./index-Cef8iy1o.mjs";
4
4
  import { c as AnyExpression } from "./types-Yui2yFf6-TP-oRDTX.mjs";
5
- import "./ast-B9jF6tRJ.mjs";
5
+ import "./ast-DQU1yUQ5.mjs";
6
6
  import { l as RawCodecInferer, o as Expression, x as ScopeField } from "./expression-BPoA5eEl.mjs";
7
- import { S as TableProxyContract, f as QueryContext, g as Scope, i as Db, o as FieldProxy, p as RawLane, s as Functions, t as AggregateFunctions } from "./db-DLjWu9-f-6BG2QArC.mjs";
7
+ import { S as TableProxyContract, f as QueryContext, g as Scope, i as Db, o as FieldProxy, p as RawLane, s as Functions, t as AggregateFunctions } from "./db-DLjWu9-f-CVAu8jgd.mjs";
8
8
  import { a as SqlAggregateDescriptorRegistry, n as ExecutionContext } from "./query-lane-context-D6o9YrEV-bouFPM6u.mjs";
9
9
  import "./query-lane-context-BcXiJasG.mjs";
10
10
  import { Contract } from "@prisma/orm-framework/contract/types";
@@ -1,7 +1,7 @@
1
1
  import { C as LiteralExpr, D as OrExpr, F as SubqueryExpr, H as isOrderByDirection, I as TableSource, L as UpdateAst, O as OrderByItem, P as SelectAst, S as ListExpression, T as NullCheckExpr, U as isOrderByNulls, V as isAggregateFn, _ as InsertAst, c as DeleteAst, g as IdentifierRef, j as ProjectionItem, k as ParamRef, l as DerivedTableSource, n as AndExpr, o as ColumnRef, p as ExistsExpr, r as BinaryExpr, t as AggregateExpr, y as JoinAst } from "./types-BPi4d3WI-D8PIEqBU.mjs";
2
2
  import { t as collectOrderedParamRefs } from "./util-DQQgv2j1-D6INZaRG.mjs";
3
3
  import { i as isExpression, n as codecOf, o as toExpr, r as createRawSql } from "./expression-vAEOvq7J.mjs";
4
- import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-ECZ4ohtG.mjs";
4
+ import { n as codecRefForStorageColumn } from "./codec-descriptor-registry-Cj-tqpFL.mjs";
5
5
  import { assertAnnotationsApplicable } from "@prisma/orm-framework/components/runtime";
6
6
  //#region ../../../2-sql/4-lanes/sql-builder/dist/runtime/index.mjs
7
7
  /**
@@ -1,3 +1,3 @@
1
1
  import { o as Expression, x as ScopeField } from "./expression-BPoA5eEl.mjs";
2
- import { C as UnboundTables, S as TableProxyContract, T as WhereFilter, _ as SelectQuery, a as DeleteQuery, b as TableNamesAcrossNamespaces, c as GatedMethod, d as Namespace, f as QueryContext, g as Scope, h as ResolveRow, i as Db, l as GroupedQuery, m as RawTagFor, n as BooleanCodecType, p as RawLane, r as ContractRawTag, s as Functions, t as AggregateFunctions, u as InsertQuery, v as Subquery, w as UpdateQuery, x as TableProxy, y as TableInAnyNamespace } from "./db-DLjWu9-f-6BG2QArC.mjs";
2
+ import { C as UnboundTables, S as TableProxyContract, T as WhereFilter, _ as SelectQuery, a as DeleteQuery, b as TableNamesAcrossNamespaces, c as GatedMethod, d as Namespace, f as QueryContext, g as Scope, h as ResolveRow, i as Db, l as GroupedQuery, m as RawTagFor, n as BooleanCodecType, p as RawLane, r as ContractRawTag, s as Functions, t as AggregateFunctions, u as InsertQuery, v as Subquery, w as UpdateQuery, x as TableProxy, y as TableInAnyNamespace } from "./db-DLjWu9-f-CVAu8jgd.mjs";
3
3
  export type { AggregateFunctions, BooleanCodecType, ContractRawTag, Db, DeleteQuery, Expression, Functions, GatedMethod, GroupedQuery, InsertQuery, Namespace, QueryContext, RawLane, RawTagFor, ResolveRow, Scope, ScopeField, SelectQuery, Subquery, TableInAnyNamespace, TableNamesAcrossNamespaces, TableProxy, TableProxyContract, UnboundTables, UpdateQuery, WhereFilter };
@@ -1,5 +1,5 @@
1
1
  import { t as resolveStorageTable } from "./resolve-storage-table-DZsfnzeW.mjs";
2
- import { u as isStorageTypeInstance } from "./types-D0B65hip.mjs";
2
+ import { u as isStorageTypeInstance } from "./types-D8Se4rnB.mjs";
3
3
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
4
4
  import { blindCast } from "@prisma/orm-framework/utils/casts";
5
5
  //#region ../../../2-sql/4-lanes/relational-core/dist/exports/codec-descriptor-registry.mjs
@@ -93,4 +93,4 @@ function buildCodecDescriptorRegistry(allDescriptors, storage) {
93
93
  //#endregion
94
94
  export { codecRefForStorageColumn as n, buildCodecDescriptorRegistry as t };
95
95
 
96
- //# sourceMappingURL=codec-descriptor-registry-ECZ4ohtG.mjs.map
96
+ //# sourceMappingURL=codec-descriptor-registry-Cj-tqpFL.mjs.map