@prisma-next/sql-relational-core 0.3.0-dev.6 → 0.3.0-dev.63

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 (174) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +18 -2
  3. package/dist/errors-7_V3El9I.mjs +3 -0
  4. package/dist/errors-DVufq9PT.d.mts +2 -0
  5. package/dist/exports/ast.d.mts +192 -0
  6. package/dist/exports/ast.d.mts.map +1 -0
  7. package/dist/exports/ast.mjs +361 -0
  8. package/dist/exports/ast.mjs.map +1 -0
  9. package/dist/exports/errors.d.mts +2 -0
  10. package/dist/exports/errors.mjs +3 -0
  11. package/dist/exports/guards.d.mts +5 -0
  12. package/dist/exports/guards.mjs +3 -0
  13. package/dist/exports/operations-registry.d.mts +5 -0
  14. package/dist/exports/operations-registry.mjs +3 -0
  15. package/dist/exports/param.d.mts +5 -0
  16. package/dist/exports/param.mjs +3 -0
  17. package/dist/exports/plan.d.mts +2 -0
  18. package/dist/exports/plan.mjs +17 -0
  19. package/dist/exports/plan.mjs.map +1 -0
  20. package/dist/exports/query-lane-context.d.mts +2 -0
  21. package/dist/exports/query-lane-context.mjs +1 -0
  22. package/dist/exports/schema.d.mts +5 -0
  23. package/dist/exports/schema.mjs +4 -0
  24. package/dist/exports/types.d.mts +4 -0
  25. package/dist/exports/types.mjs +3 -0
  26. package/dist/exports/utils/guards.d.mts +5 -0
  27. package/dist/exports/utils/guards.mjs +4 -0
  28. package/dist/guards-0ycyntYX.mjs +132 -0
  29. package/dist/guards-0ycyntYX.mjs.map +1 -0
  30. package/dist/guards-DCCpAlOL.d.mts +87 -0
  31. package/dist/guards-DCCpAlOL.d.mts.map +1 -0
  32. package/dist/index.d.mts +12 -0
  33. package/dist/index.mjs +12 -0
  34. package/dist/operations-registry-DPZ5aElH.mjs +152 -0
  35. package/dist/operations-registry-DPZ5aElH.mjs.map +1 -0
  36. package/dist/operations-registry-wVEaiLyt.d.mts +9 -0
  37. package/dist/operations-registry-wVEaiLyt.d.mts.map +1 -0
  38. package/dist/param-C4n0OW59.d.mts +8 -0
  39. package/dist/param-C4n0OW59.d.mts.map +1 -0
  40. package/dist/param-DMU3OWfI.mjs +14 -0
  41. package/dist/param-DMU3OWfI.mjs.map +1 -0
  42. package/dist/plan-BhSWuTfw.d.mts +194 -0
  43. package/dist/plan-BhSWuTfw.d.mts.map +1 -0
  44. package/dist/query-lane-context-CgkPuKaR.d.mts +259 -0
  45. package/dist/query-lane-context-CgkPuKaR.d.mts.map +1 -0
  46. package/dist/schema-Bi5p4aAc.mjs +175 -0
  47. package/dist/schema-Bi5p4aAc.mjs.map +1 -0
  48. package/dist/schema-CgrEMqEd.d.mts +86 -0
  49. package/dist/schema-CgrEMqEd.d.mts.map +1 -0
  50. package/dist/types-CEUzDuDC.d.mts +447 -0
  51. package/dist/types-CEUzDuDC.d.mts.map +1 -0
  52. package/dist/types-Cdi4Whda.mjs +18 -0
  53. package/dist/types-Cdi4Whda.mjs.map +1 -0
  54. package/package.json +38 -55
  55. package/src/ast/codec-types.ts +77 -8
  56. package/src/ast/delete.ts +2 -2
  57. package/src/ast/driver-types.ts +20 -3
  58. package/src/ast/predicate.ts +14 -4
  59. package/src/ast/select.ts +4 -3
  60. package/src/ast/sql-codecs.ts +67 -0
  61. package/src/ast/types.ts +89 -19
  62. package/src/ast/update.ts +2 -2
  63. package/src/exports/ast.ts +1 -0
  64. package/src/exports/guards.ts +5 -0
  65. package/src/exports/utils/guards.ts +1 -0
  66. package/src/operations-registry.ts +112 -73
  67. package/src/query-lane-context.ts +77 -1
  68. package/src/schema.ts +91 -33
  69. package/src/types.ts +327 -75
  70. package/src/utils/guards.ts +88 -18
  71. package/dist/ast/adapter-types.d.ts +0 -28
  72. package/dist/ast/adapter-types.d.ts.map +0 -1
  73. package/dist/ast/codec-types.d.ts +0 -141
  74. package/dist/ast/codec-types.d.ts.map +0 -1
  75. package/dist/ast/common.d.ts +0 -7
  76. package/dist/ast/common.d.ts.map +0 -1
  77. package/dist/ast/delete.d.ts +0 -8
  78. package/dist/ast/delete.d.ts.map +0 -1
  79. package/dist/ast/driver-types.d.ts +0 -20
  80. package/dist/ast/driver-types.d.ts.map +0 -1
  81. package/dist/ast/insert.d.ts +0 -8
  82. package/dist/ast/insert.d.ts.map +0 -1
  83. package/dist/ast/join.d.ts +0 -6
  84. package/dist/ast/join.d.ts.map +0 -1
  85. package/dist/ast/order.d.ts +0 -6
  86. package/dist/ast/order.d.ts.map +0 -1
  87. package/dist/ast/predicate.d.ts +0 -4
  88. package/dist/ast/predicate.d.ts.map +0 -1
  89. package/dist/ast/select.d.ts +0 -18
  90. package/dist/ast/select.d.ts.map +0 -1
  91. package/dist/ast/types.d.ts +0 -118
  92. package/dist/ast/types.d.ts.map +0 -1
  93. package/dist/ast/update.d.ts +0 -9
  94. package/dist/ast/update.d.ts.map +0 -1
  95. package/dist/ast/util.d.ts +0 -2
  96. package/dist/ast/util.d.ts.map +0 -1
  97. package/dist/chunk-2F7DSEOU.js +0 -8
  98. package/dist/chunk-2F7DSEOU.js.map +0 -1
  99. package/dist/chunk-36WJWNHT.js +0 -1
  100. package/dist/chunk-36WJWNHT.js.map +0 -1
  101. package/dist/chunk-5N34PNVZ.js +0 -62
  102. package/dist/chunk-5N34PNVZ.js.map +0 -1
  103. package/dist/chunk-7I3EMQID.js +0 -16
  104. package/dist/chunk-7I3EMQID.js.map +0 -1
  105. package/dist/chunk-CBTYMOX2.js +0 -152
  106. package/dist/chunk-CBTYMOX2.js.map +0 -1
  107. package/dist/chunk-G52ENULI.js +0 -1
  108. package/dist/chunk-G52ENULI.js.map +0 -1
  109. package/dist/chunk-KYSP7L5C.js +0 -16
  110. package/dist/chunk-KYSP7L5C.js.map +0 -1
  111. package/dist/chunk-M23L3JHG.js +0 -159
  112. package/dist/chunk-M23L3JHG.js.map +0 -1
  113. package/dist/chunk-MM74SVJ4.js +0 -13
  114. package/dist/chunk-MM74SVJ4.js.map +0 -1
  115. package/dist/chunk-U7AXAUJA.js +0 -1
  116. package/dist/chunk-U7AXAUJA.js.map +0 -1
  117. package/dist/chunk-WZBPVEZI.js +0 -320
  118. package/dist/chunk-WZBPVEZI.js.map +0 -1
  119. package/dist/errors.d.ts +0 -2
  120. package/dist/errors.d.ts.map +0 -1
  121. package/dist/exports/ast.d.ts +0 -14
  122. package/dist/exports/ast.d.ts.map +0 -1
  123. package/dist/exports/ast.js +0 -46
  124. package/dist/exports/ast.js.map +0 -1
  125. package/dist/exports/errors.d.ts +0 -2
  126. package/dist/exports/errors.d.ts.map +0 -1
  127. package/dist/exports/errors.js +0 -9
  128. package/dist/exports/errors.js.map +0 -1
  129. package/dist/exports/guards.d.ts +0 -2
  130. package/dist/exports/guards.d.ts.map +0 -1
  131. package/dist/exports/guards.js +0 -21
  132. package/dist/exports/guards.js.map +0 -1
  133. package/dist/exports/operations-registry.d.ts +0 -2
  134. package/dist/exports/operations-registry.d.ts.map +0 -1
  135. package/dist/exports/operations-registry.js +0 -9
  136. package/dist/exports/operations-registry.js.map +0 -1
  137. package/dist/exports/param.d.ts +0 -3
  138. package/dist/exports/param.d.ts.map +0 -1
  139. package/dist/exports/param.js +0 -7
  140. package/dist/exports/param.js.map +0 -1
  141. package/dist/exports/plan.d.ts +0 -2
  142. package/dist/exports/plan.d.ts.map +0 -1
  143. package/dist/exports/plan.js +0 -7
  144. package/dist/exports/plan.js.map +0 -1
  145. package/dist/exports/query-lane-context.d.ts +0 -2
  146. package/dist/exports/query-lane-context.d.ts.map +0 -1
  147. package/dist/exports/query-lane-context.js +0 -2
  148. package/dist/exports/query-lane-context.js.map +0 -1
  149. package/dist/exports/schema.d.ts +0 -3
  150. package/dist/exports/schema.d.ts.map +0 -1
  151. package/dist/exports/schema.js +0 -14
  152. package/dist/exports/schema.js.map +0 -1
  153. package/dist/exports/types.d.ts +0 -2
  154. package/dist/exports/types.d.ts.map +0 -1
  155. package/dist/exports/types.js +0 -10
  156. package/dist/exports/types.js.map +0 -1
  157. package/dist/index.d.ts +0 -9
  158. package/dist/index.d.ts.map +0 -1
  159. package/dist/index.js +0 -81
  160. package/dist/index.js.map +0 -1
  161. package/dist/operations-registry.d.ts +0 -5
  162. package/dist/operations-registry.d.ts.map +0 -1
  163. package/dist/param.d.ts +0 -4
  164. package/dist/param.d.ts.map +0 -1
  165. package/dist/plan.d.ts +0 -23
  166. package/dist/plan.d.ts.map +0 -1
  167. package/dist/query-lane-context.d.ts +0 -16
  168. package/dist/query-lane-context.d.ts.map +0 -1
  169. package/dist/schema.d.ts +0 -63
  170. package/dist/schema.d.ts.map +0 -1
  171. package/dist/types.d.ts +0 -332
  172. package/dist/types.d.ts.map +0 -1
  173. package/dist/utils/guards.d.ts +0 -55
  174. package/dist/utils/guards.d.ts.map +0 -1
@@ -0,0 +1,361 @@
1
+ import { n as isColumnBuilder } from "../types-Cdi4Whda.mjs";
2
+ import { ifDefined } from "@prisma-next/utils/defined";
3
+ import { planInvalid } from "@prisma-next/plan";
4
+ import { type } from "arktype";
5
+
6
+ //#region src/ast/codec-types.ts
7
+ /**
8
+ * Implementation of CodecRegistry.
9
+ */
10
+ var CodecRegistryImpl = class {
11
+ _byId = /* @__PURE__ */ new Map();
12
+ _byScalar = /* @__PURE__ */ new Map();
13
+ /**
14
+ * Map-like interface for codec lookup by ID.
15
+ * Example: registry.get('pg/text@1')
16
+ */
17
+ get(id) {
18
+ return this._byId.get(id);
19
+ }
20
+ /**
21
+ * Check if a codec with the given ID is registered.
22
+ */
23
+ has(id) {
24
+ return this._byId.has(id);
25
+ }
26
+ /**
27
+ * Get all codecs that handle a given scalar type.
28
+ * Returns an empty frozen array if no codecs are found.
29
+ * Example: registry.getByScalar('text') → [codec1, codec2, ...]
30
+ */
31
+ getByScalar(scalar) {
32
+ return this._byScalar.get(scalar) ?? Object.freeze([]);
33
+ }
34
+ /**
35
+ * Get the default codec for a scalar type (first registered codec).
36
+ * Returns undefined if no codec handles this scalar type.
37
+ */
38
+ getDefaultCodec(scalar) {
39
+ return this._byScalar.get(scalar)?.[0];
40
+ }
41
+ /**
42
+ * Register a codec in the registry.
43
+ * Throws an error if a codec with the same ID is already registered.
44
+ *
45
+ * @param codec - The codec to register
46
+ * @throws Error if a codec with the same ID already exists
47
+ */
48
+ register(codec$1) {
49
+ if (this._byId.has(codec$1.id)) throw new Error(`Codec with ID '${codec$1.id}' is already registered`);
50
+ this._byId.set(codec$1.id, codec$1);
51
+ for (const scalarType of codec$1.targetTypes) {
52
+ const existing = this._byScalar.get(scalarType);
53
+ if (existing) existing.push(codec$1);
54
+ else this._byScalar.set(scalarType, [codec$1]);
55
+ }
56
+ }
57
+ /**
58
+ * Returns an iterator over all registered codecs.
59
+ * Useful for iterating through codecs from another registry.
60
+ */
61
+ *[Symbol.iterator]() {
62
+ for (const codec$1 of this._byId.values()) yield codec$1;
63
+ }
64
+ /**
65
+ * Returns an iterable of all registered codecs.
66
+ */
67
+ values() {
68
+ return this._byId.values();
69
+ }
70
+ };
71
+ /**
72
+ * Codec factory - creates a codec with typeId and encode/decode functions.
73
+ */
74
+ function codec(config) {
75
+ return {
76
+ id: config.typeId,
77
+ targetTypes: config.targetTypes,
78
+ ...ifDefined("meta", config.meta),
79
+ ...ifDefined("paramsSchema", config.paramsSchema),
80
+ ...ifDefined("init", config.init),
81
+ encode: config.encode,
82
+ decode: config.decode
83
+ };
84
+ }
85
+ /**
86
+ * Implementation of CodecDefBuilder.
87
+ */
88
+ var CodecDefBuilderImpl = class CodecDefBuilderImpl {
89
+ _codecs;
90
+ CodecTypes;
91
+ dataTypes;
92
+ constructor(codecs$1) {
93
+ this._codecs = codecs$1;
94
+ const codecTypes = {};
95
+ for (const [, codecImpl] of Object.entries(this._codecs)) {
96
+ const codecImplTyped = codecImpl;
97
+ codecTypes[codecImplTyped.id] = {
98
+ input: void 0,
99
+ output: void 0
100
+ };
101
+ }
102
+ this.CodecTypes = codecTypes;
103
+ const dataTypes = {};
104
+ for (const key in this._codecs) if (Object.hasOwn(this._codecs, key)) dataTypes[key] = this._codecs[key].id;
105
+ this.dataTypes = dataTypes;
106
+ }
107
+ add(scalarName, codecImpl) {
108
+ return new CodecDefBuilderImpl({
109
+ ...this._codecs,
110
+ [scalarName]: codecImpl
111
+ });
112
+ }
113
+ /**
114
+ * Derive codecDefinitions structure.
115
+ */
116
+ get codecDefinitions() {
117
+ const result = {};
118
+ for (const [scalarName, codecImpl] of Object.entries(this._codecs)) {
119
+ const codec$1 = codecImpl;
120
+ result[scalarName] = {
121
+ typeId: codec$1.id,
122
+ scalar: scalarName,
123
+ codec: codec$1,
124
+ input: void 0,
125
+ output: void 0,
126
+ jsType: void 0
127
+ };
128
+ }
129
+ return result;
130
+ }
131
+ };
132
+ /**
133
+ * Create a new codec registry.
134
+ */
135
+ function createCodecRegistry() {
136
+ return new CodecRegistryImpl();
137
+ }
138
+ /**
139
+ * Create a new codec definition builder.
140
+ */
141
+ function defineCodecs() {
142
+ return new CodecDefBuilderImpl({});
143
+ }
144
+
145
+ //#endregion
146
+ //#region src/ast/util.ts
147
+ function compact(o) {
148
+ const out = {};
149
+ for (const [k, v] of Object.entries(o)) {
150
+ if (v === void 0 || v === null) continue;
151
+ if (Array.isArray(v) && v.length === 0) continue;
152
+ out[k] = v;
153
+ }
154
+ return out;
155
+ }
156
+
157
+ //#endregion
158
+ //#region src/ast/common.ts
159
+ function createTableRef(name) {
160
+ return {
161
+ kind: "table",
162
+ name
163
+ };
164
+ }
165
+ function createColumnRef(table, column) {
166
+ return {
167
+ kind: "col",
168
+ table,
169
+ column
170
+ };
171
+ }
172
+ function createParamRef(index, name) {
173
+ return compact({
174
+ kind: "param",
175
+ index,
176
+ name
177
+ });
178
+ }
179
+ function createOperationExpr(operation) {
180
+ return operation;
181
+ }
182
+ function createLiteralExpr(value) {
183
+ return {
184
+ kind: "literal",
185
+ value
186
+ };
187
+ }
188
+
189
+ //#endregion
190
+ //#region src/ast/delete.ts
191
+ function createDeleteAst(options) {
192
+ return compact({
193
+ kind: "delete",
194
+ table: options.table,
195
+ where: options.where,
196
+ returning: options.returning
197
+ });
198
+ }
199
+
200
+ //#endregion
201
+ //#region src/ast/insert.ts
202
+ function createInsertAst(options) {
203
+ return compact({
204
+ kind: "insert",
205
+ table: options.table,
206
+ values: options.values,
207
+ returning: options.returning
208
+ });
209
+ }
210
+
211
+ //#endregion
212
+ //#region src/ast/join.ts
213
+ function createJoin(joinType, table, on) {
214
+ return {
215
+ kind: "join",
216
+ joinType,
217
+ table,
218
+ on
219
+ };
220
+ }
221
+ function createJoinOnExpr(left, right) {
222
+ return {
223
+ kind: "eqCol",
224
+ left,
225
+ right
226
+ };
227
+ }
228
+ var JoinOnBuilderImpl = class {
229
+ eqCol(left, right) {
230
+ if (!left || !isColumnBuilder(left)) throw planInvalid("Join ON left operand must be a column");
231
+ if (!right || !isColumnBuilder(right)) throw planInvalid("Join ON right operand must be a column");
232
+ const leftCol = left;
233
+ const rightCol = right;
234
+ if (leftCol.table === rightCol.table) throw planInvalid("Self-joins are not supported in MVP");
235
+ return {
236
+ kind: "join-on",
237
+ left,
238
+ right
239
+ };
240
+ }
241
+ };
242
+ function createJoinOnBuilder() {
243
+ return new JoinOnBuilderImpl();
244
+ }
245
+
246
+ //#endregion
247
+ //#region src/ast/order.ts
248
+ function createOrderByItem(expr, dir) {
249
+ return {
250
+ expr,
251
+ dir
252
+ };
253
+ }
254
+
255
+ //#endregion
256
+ //#region src/ast/predicate.ts
257
+ function createBinaryExpr(op, left, right) {
258
+ return {
259
+ kind: "bin",
260
+ op,
261
+ left,
262
+ right
263
+ };
264
+ }
265
+ function createExistsExpr(not, subquery) {
266
+ return {
267
+ kind: "exists",
268
+ not,
269
+ subquery
270
+ };
271
+ }
272
+ function createNullCheckExpr(expr, isNull) {
273
+ return {
274
+ kind: "nullCheck",
275
+ expr,
276
+ isNull
277
+ };
278
+ }
279
+
280
+ //#endregion
281
+ //#region src/ast/select.ts
282
+ function createSelectAst(options) {
283
+ return compact({
284
+ kind: "select",
285
+ from: options.from,
286
+ joins: options.joins,
287
+ includes: options.includes,
288
+ project: options.project,
289
+ where: options.where,
290
+ orderBy: options.orderBy,
291
+ limit: options.limit,
292
+ selectAllIntent: options.selectAllIntent
293
+ });
294
+ }
295
+
296
+ //#endregion
297
+ //#region src/ast/sql-codecs.ts
298
+ const SQL_CHAR_CODEC_ID = "sql/char@1";
299
+ const SQL_VARCHAR_CODEC_ID = "sql/varchar@1";
300
+ const SQL_INT_CODEC_ID = "sql/int@1";
301
+ const SQL_FLOAT_CODEC_ID = "sql/float@1";
302
+ const lengthParamsSchema = type({ length: "number.integer > 0" });
303
+ function createLengthTypeHelper(kind) {
304
+ return (params) => ({
305
+ kind,
306
+ maxLength: params["length"]
307
+ });
308
+ }
309
+ const sqlCharCodec = codec({
310
+ typeId: SQL_CHAR_CODEC_ID,
311
+ targetTypes: ["char"],
312
+ encode: (value) => value,
313
+ decode: (wire) => wire.trimEnd(),
314
+ paramsSchema: lengthParamsSchema,
315
+ init: createLengthTypeHelper("fixed")
316
+ });
317
+ const sqlVarcharCodec = codec({
318
+ typeId: SQL_VARCHAR_CODEC_ID,
319
+ targetTypes: ["varchar"],
320
+ encode: (value) => value,
321
+ decode: (wire) => wire,
322
+ paramsSchema: lengthParamsSchema,
323
+ init: createLengthTypeHelper("variable")
324
+ });
325
+ const sqlIntCodec = codec({
326
+ typeId: SQL_INT_CODEC_ID,
327
+ targetTypes: ["int"],
328
+ encode: (value) => value,
329
+ decode: (wire) => wire
330
+ });
331
+ const sqlFloatCodec = codec({
332
+ typeId: SQL_FLOAT_CODEC_ID,
333
+ targetTypes: ["float"],
334
+ encode: (value) => value,
335
+ decode: (wire) => wire
336
+ });
337
+ const codecs = defineCodecs().add("char", sqlCharCodec).add("varchar", sqlVarcharCodec).add("int", sqlIntCodec).add("float", sqlFloatCodec);
338
+ const sqlCodecDefinitions = codecs.codecDefinitions;
339
+ const sqlDataTypes = codecs.dataTypes;
340
+
341
+ //#endregion
342
+ //#region src/ast/types.ts
343
+ function isOperationExpr(expr) {
344
+ return expr.kind === "operation";
345
+ }
346
+
347
+ //#endregion
348
+ //#region src/ast/update.ts
349
+ function createUpdateAst(options) {
350
+ return compact({
351
+ kind: "update",
352
+ table: options.table,
353
+ set: options.set,
354
+ where: options.where,
355
+ returning: options.returning
356
+ });
357
+ }
358
+
359
+ //#endregion
360
+ export { SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_VARCHAR_CODEC_ID, codec, compact, createBinaryExpr, createCodecRegistry, createColumnRef, createDeleteAst, createExistsExpr, createInsertAst, createJoin, createJoinOnBuilder, createJoinOnExpr, createLiteralExpr, createNullCheckExpr, createOperationExpr, createOrderByItem, createParamRef, createSelectAst, createTableRef, createUpdateAst, defineCodecs, isOperationExpr, sqlCodecDefinitions, sqlDataTypes };
361
+ //# sourceMappingURL=ast.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast.mjs","names":["codec","codecs","codecTypes: Record<string, { readonly input: unknown; readonly output: unknown }>","result: Record<\n string,\n {\n typeId: string;\n scalar: string;\n codec: Codec;\n input: unknown;\n output: unknown;\n jsType: unknown;\n }\n >","out: Record<string, unknown>","arktype"],"sources":["../../src/ast/codec-types.ts","../../src/ast/util.ts","../../src/ast/common.ts","../../src/ast/delete.ts","../../src/ast/insert.ts","../../src/ast/join.ts","../../src/ast/order.ts","../../src/ast/predicate.ts","../../src/ast/select.ts","../../src/ast/sql-codecs.ts","../../src/ast/types.ts","../../src/ast/update.ts"],"sourcesContent":["import { ifDefined } from '@prisma-next/utils/defined';\nimport type { Type } from 'arktype';\nimport type { O } from 'ts-toolbelt';\n\n/**\n * Descriptor for parameterized codecs that require type parameter validation.\n * Shared between adapter (compile-time) and runtime layers to avoid duplication.\n *\n * @template TParams - The shape of the type parameters (e.g., `{ length: number }`)\n * @template THelper - The type returned by the optional `init` hook\n */\nexport interface CodecParamsDescriptor<TParams = Record<string, unknown>, THelper = unknown> {\n /** The codec ID this descriptor applies to (e.g., 'pg/vector@1') */\n readonly codecId: string;\n\n /**\n * Arktype schema for validating typeParams.\n * Used to validate both storage.types entries and inline column typeParams.\n */\n readonly paramsSchema: Type<TParams>;\n\n /**\n * Optional init hook called during runtime context creation.\n * Receives validated params and returns a helper object to be stored in context.types.\n * If not provided, the validated params are stored directly.\n */\n readonly init?: (params: TParams) => THelper;\n}\n\n/**\n * Codec metadata for database-specific type information.\n * Used for schema introspection and verification.\n */\nexport interface CodecMeta {\n readonly db?: {\n readonly sql?: {\n readonly postgres?: {\n readonly nativeType: string; // e.g. 'integer', 'text', 'vector', 'timestamp with time zone'\n };\n };\n };\n}\n\n/**\n * Codec interface for encoding/decoding values between wire format and JavaScript types.\n *\n * Codecs are pure, synchronous functions with no side effects or IO.\n * They provide deterministic conversion between database wire types and JS values.\n */\nexport interface Codec<\n Id extends string = string,\n TWire = unknown,\n TJs = unknown,\n TParams = Record<string, unknown>,\n THelper = unknown,\n> {\n /**\n * Namespaced codec identifier in format 'namespace/name@version'\n * Examples: 'pg/text@1', 'pg/uuid@1', 'pg/timestamptz@1'\n */\n readonly id: Id;\n\n /**\n * Contract scalar type IDs that this codec can handle.\n * Examples: ['text'], ['int4', 'float8'], ['timestamp', 'timestamptz']\n */\n readonly targetTypes: readonly string[];\n\n /**\n * Optional metadata for database-specific type information.\n * Used for schema introspection and verification.\n */\n readonly meta?: CodecMeta;\n\n /**\n * Optional params schema for parameterized codecs.\n * If provided, typeParams are validated against this schema.\n */\n readonly paramsSchema?: Type<TParams>;\n\n /**\n * Optional init hook for building runtime helper state from validated params.\n *\n * Useful when parameterized types need derived data at runtime, for example:\n * - normalize typeParams into a stable helper shape consumed by lanes/adapters\n * - precompute reusable values once during context creation\n * - avoid repeating typeParams parsing logic during query execution\n *\n * Example:\n * { length: 255 } -> { kind: 'variable', maxLength: 255 }\n *\n * **Convention for JSON/JSONB codecs**: When the helper includes a `validate`\n * property of type `JsonSchemaValidateFn`, the runtime will use it to enforce\n * JSON Schema conformance during encoding and decoding. The property is\n * discovered via duck typing (`helper?.validate`) for flexibility across\n * different codec types.\n */\n readonly init?: (params: TParams) => THelper;\n\n /**\n * Decode a wire value (from database) to JavaScript type.\n * Must be synchronous and pure (no side effects).\n */\n decode(wire: TWire): TJs;\n\n /**\n * Encode a JavaScript value to wire format (for database).\n * Optional - if not provided, values pass through unchanged.\n * Must be synchronous and pure (no side effects).\n */\n encode?(value: TJs): TWire;\n}\n\n/**\n * Registry interface for codecs organized by ID and by contract scalar type.\n *\n * The registry allows looking up codecs by their namespaced ID or by the\n * contract scalar types they handle. Multiple codecs may handle the same\n * scalar type; ordering in byScalar reflects preference (adapter first,\n * then packs, then app overrides).\n */\nexport interface CodecRegistry {\n get(id: string): Codec<string> | undefined;\n has(id: string): boolean;\n getByScalar(scalar: string): readonly Codec<string>[];\n getDefaultCodec(scalar: string): Codec<string> | undefined;\n register(codec: Codec<string>): void;\n [Symbol.iterator](): Iterator<Codec<string>>;\n values(): IterableIterator<Codec<string>>;\n}\n\n/**\n * Implementation of CodecRegistry.\n */\nclass CodecRegistryImpl implements CodecRegistry {\n private readonly _byId = new Map<string, Codec<string>>();\n private readonly _byScalar = new Map<string, Codec<string>[]>();\n\n /**\n * Map-like interface for codec lookup by ID.\n * Example: registry.get('pg/text@1')\n */\n get(id: string): Codec<string> | undefined {\n return this._byId.get(id);\n }\n\n /**\n * Check if a codec with the given ID is registered.\n */\n has(id: string): boolean {\n return this._byId.has(id);\n }\n\n /**\n * Get all codecs that handle a given scalar type.\n * Returns an empty frozen array if no codecs are found.\n * Example: registry.getByScalar('text') → [codec1, codec2, ...]\n */\n getByScalar(scalar: string): readonly Codec<string>[] {\n return this._byScalar.get(scalar) ?? Object.freeze([]);\n }\n\n /**\n * Get the default codec for a scalar type (first registered codec).\n * Returns undefined if no codec handles this scalar type.\n */\n getDefaultCodec(scalar: string): Codec<string> | undefined {\n const _codecs = this._byScalar.get(scalar);\n return _codecs?.[0];\n }\n\n /**\n * Register a codec in the registry.\n * Throws an error if a codec with the same ID is already registered.\n *\n * @param codec - The codec to register\n * @throws Error if a codec with the same ID already exists\n */\n register(codec: Codec<string>): void {\n if (this._byId.has(codec.id)) {\n throw new Error(`Codec with ID '${codec.id}' is already registered`);\n }\n\n this._byId.set(codec.id, codec);\n\n // Update byScalar mapping\n for (const scalarType of codec.targetTypes) {\n const existing = this._byScalar.get(scalarType);\n if (existing) {\n existing.push(codec);\n } else {\n this._byScalar.set(scalarType, [codec]);\n }\n }\n }\n\n /**\n * Returns an iterator over all registered codecs.\n * Useful for iterating through codecs from another registry.\n */\n *[Symbol.iterator](): Iterator<Codec<string>> {\n for (const codec of this._byId.values()) {\n yield codec;\n }\n }\n\n /**\n * Returns an iterable of all registered codecs.\n */\n values(): IterableIterator<Codec<string>> {\n return this._byId.values();\n }\n}\n\n/**\n * Codec factory - creates a codec with typeId and encode/decode functions.\n */\nexport function codec<\n Id extends string,\n TWire,\n TJs,\n TParams = Record<string, unknown>,\n THelper = unknown,\n>(config: {\n typeId: Id;\n targetTypes: readonly string[];\n encode: (value: TJs) => TWire;\n decode: (wire: TWire) => TJs;\n meta?: CodecMeta;\n paramsSchema?: Type<TParams>;\n init?: (params: TParams) => THelper;\n}): Codec<Id, TWire, TJs, TParams, THelper> {\n return {\n id: config.typeId,\n targetTypes: config.targetTypes,\n ...ifDefined('meta', config.meta),\n ...ifDefined('paramsSchema', config.paramsSchema),\n ...ifDefined('init', config.init),\n encode: config.encode,\n decode: config.decode,\n };\n}\n\n/**\n * Type helpers to extract codec types.\n */\nexport type CodecId<T> =\n T extends Codec<infer Id, unknown, unknown>\n ? Id\n : T extends { readonly id: infer Id }\n ? Id\n : never;\nexport type CodecInput<T> = T extends Codec<string, unknown, infer JsT> ? JsT : never;\nexport type CodecOutput<T> = T extends Codec<string, unknown, infer JsT> ? JsT : never;\n\n/**\n * Type helper to extract codec types from builder instance.\n */\nexport type ExtractCodecTypes<\n ScalarNames extends { readonly [K in keyof ScalarNames]: Codec<string> } = Record<never, never>,\n> = {\n readonly [K in keyof ScalarNames as ScalarNames[K] extends Codec<infer Id, unknown, unknown>\n ? Id\n : never]: {\n readonly input: CodecInput<ScalarNames[K]>;\n readonly output: CodecOutput<ScalarNames[K]>;\n };\n};\n\n/**\n * Type helper to extract data type IDs from builder instance.\n * Uses ExtractCodecTypes which preserves literal types as keys.\n * Since ExtractCodecTypes<Record<K, ScalarNames[K]>> has exactly one key (the Id),\n * we extract it by creating a mapped type that uses the Id as both key and value,\n * then extract the value type. This preserves literal types.\n */\nexport type ExtractDataTypes<\n ScalarNames extends { readonly [K in keyof ScalarNames]: Codec<string> },\n> = {\n readonly [K in keyof ScalarNames]: {\n readonly [Id in keyof ExtractCodecTypes<Record<K, ScalarNames[K]>>]: Id;\n }[keyof ExtractCodecTypes<Record<K, ScalarNames[K]>>];\n};\n\n/**\n * Builder interface for declaring codecs.\n */\nexport interface CodecDefBuilder<\n ScalarNames extends { readonly [K in keyof ScalarNames]: Codec<string> } = Record<never, never>,\n> {\n readonly CodecTypes: ExtractCodecTypes<ScalarNames>;\n\n add<ScalarName extends string, CodecImpl extends Codec<string>>(\n scalarName: ScalarName,\n codecImpl: CodecImpl,\n ): CodecDefBuilder<\n O.Overwrite<ScalarNames, Record<ScalarName, CodecImpl>> & Record<ScalarName, CodecImpl>\n >;\n\n readonly codecDefinitions: {\n readonly [K in keyof ScalarNames]: {\n readonly typeId: ScalarNames[K] extends Codec<infer Id extends string, unknown, unknown>\n ? Id\n : never;\n readonly scalar: K;\n readonly codec: ScalarNames[K];\n readonly input: CodecInput<ScalarNames[K]>;\n readonly output: CodecOutput<ScalarNames[K]>;\n readonly jsType: CodecOutput<ScalarNames[K]>;\n };\n };\n\n readonly dataTypes: {\n readonly [K in keyof ScalarNames]: {\n readonly [Id in keyof ExtractCodecTypes<Record<K, ScalarNames[K]>>]: Id;\n }[keyof ExtractCodecTypes<Record<K, ScalarNames[K]>>];\n };\n}\n\n/**\n * Implementation of CodecDefBuilder.\n */\nclass CodecDefBuilderImpl<\n ScalarNames extends { readonly [K in keyof ScalarNames]: Codec<string> } = Record<never, never>,\n> implements CodecDefBuilder<ScalarNames>\n{\n private readonly _codecs: ScalarNames;\n\n public readonly CodecTypes: ExtractCodecTypes<ScalarNames>;\n public readonly dataTypes: {\n readonly [K in keyof ScalarNames]: {\n readonly [Id in keyof ExtractCodecTypes<Record<K, ScalarNames[K]>>]: Id;\n }[keyof ExtractCodecTypes<Record<K, ScalarNames[K]>>];\n };\n\n constructor(codecs: ScalarNames) {\n this._codecs = codecs;\n\n // Populate CodecTypes from codecs\n const codecTypes: Record<string, { readonly input: unknown; readonly output: unknown }> = {};\n for (const [, codecImpl] of Object.entries(this._codecs)) {\n const codecImplTyped = codecImpl as Codec<string>;\n codecTypes[codecImplTyped.id] = {\n input: undefined as unknown as CodecInput<typeof codecImplTyped>,\n output: undefined as unknown as CodecOutput<typeof codecImplTyped>,\n };\n }\n this.CodecTypes = codecTypes as ExtractCodecTypes<ScalarNames>;\n\n // Populate dataTypes from codecs - extract id property from each codec\n // Build object preserving keys from ScalarNames\n // Type assertion is safe because we know ScalarNames structure matches the return type\n // biome-ignore lint/suspicious/noExplicitAny: dynamic codec mapping requires any\n const dataTypes = {} as any;\n for (const key in this._codecs) {\n if (Object.hasOwn(this._codecs, key)) {\n const codec = this._codecs[key] as Codec<string>;\n dataTypes[key] = codec.id;\n }\n }\n this.dataTypes = dataTypes as {\n readonly [K in keyof ScalarNames]: {\n readonly [Id in keyof ExtractCodecTypes<Record<K, ScalarNames[K]>>]: Id;\n }[keyof ExtractCodecTypes<Record<K, ScalarNames[K]>>];\n };\n }\n\n add<ScalarName extends string, CodecImpl extends Codec<string>>(\n scalarName: ScalarName,\n codecImpl: CodecImpl,\n ): CodecDefBuilder<\n O.Overwrite<ScalarNames, Record<ScalarName, CodecImpl>> & Record<ScalarName, CodecImpl>\n > {\n return new CodecDefBuilderImpl({\n ...this._codecs,\n [scalarName]: codecImpl,\n } as O.Overwrite<ScalarNames, Record<ScalarName, CodecImpl>> & Record<ScalarName, CodecImpl>);\n }\n\n /**\n * Derive codecDefinitions structure.\n */\n get codecDefinitions(): {\n readonly [K in keyof ScalarNames]: {\n readonly typeId: ScalarNames[K] extends Codec<infer Id, unknown, unknown> ? Id : never;\n readonly scalar: K;\n readonly codec: ScalarNames[K];\n readonly input: CodecInput<ScalarNames[K]>;\n readonly output: CodecOutput<ScalarNames[K]>;\n readonly jsType: CodecOutput<ScalarNames[K]>;\n };\n } {\n const result: Record<\n string,\n {\n typeId: string;\n scalar: string;\n codec: Codec;\n input: unknown;\n output: unknown;\n jsType: unknown;\n }\n > = {};\n\n for (const [scalarName, codecImpl] of Object.entries(this._codecs)) {\n const codec = codecImpl as Codec<string>;\n result[scalarName] = {\n typeId: codec.id,\n scalar: scalarName,\n codec: codec,\n input: undefined as unknown as CodecInput<typeof codec>,\n output: undefined as unknown as CodecOutput<typeof codec>,\n jsType: undefined as unknown as CodecOutput<typeof codec>,\n };\n }\n\n return result as {\n readonly [K in keyof ScalarNames]: {\n readonly typeId: ScalarNames[K] extends Codec<infer Id extends string, unknown, unknown>\n ? Id\n : never;\n readonly scalar: K;\n readonly codec: ScalarNames[K];\n readonly input: CodecInput<ScalarNames[K]>;\n readonly output: CodecOutput<ScalarNames[K]>;\n readonly jsType: CodecOutput<ScalarNames[K]>;\n };\n };\n }\n}\n\n/**\n * Create a new codec registry.\n */\nexport function createCodecRegistry(): CodecRegistry {\n return new CodecRegistryImpl();\n}\n\n/**\n * Create a new codec definition builder.\n */\nexport function defineCodecs(): CodecDefBuilder<Record<never, never>> {\n return new CodecDefBuilderImpl({});\n}\n","export function compact<T extends Record<string, unknown>>(o: T): T {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(o)) {\n if (v === undefined || v === null) continue;\n if (Array.isArray(v) && v.length === 0) continue;\n out[k] = v;\n }\n return out as T;\n}\n","import type { ColumnRef, LiteralExpr, OperationExpr, ParamRef, TableRef } from './types';\nimport { compact } from './util';\n\nexport function createTableRef(name: string): TableRef {\n return {\n kind: 'table',\n name,\n };\n}\n\nexport function createColumnRef(table: string, column: string): ColumnRef {\n return {\n kind: 'col',\n table,\n column,\n };\n}\n\nexport function createParamRef(index: number, name?: string): ParamRef {\n return compact({\n kind: 'param',\n index,\n name,\n }) as ParamRef;\n}\n\nexport function createOperationExpr(operation: OperationExpr): OperationExpr {\n return operation;\n}\n\nexport function createLiteralExpr(value: unknown): LiteralExpr {\n return {\n kind: 'literal',\n value,\n };\n}\n","import type { ColumnRef, DeleteAst, TableRef, WhereExpr } from './types';\nimport { compact } from './util';\n\nexport interface CreateDeleteAstOptions {\n readonly table: TableRef;\n readonly where: WhereExpr;\n readonly returning?: ReadonlyArray<ColumnRef>;\n}\n\nexport function createDeleteAst(options: CreateDeleteAstOptions): DeleteAst {\n return compact({\n kind: 'delete',\n table: options.table,\n where: options.where,\n returning: options.returning,\n }) as DeleteAst;\n}\n","import type { ColumnRef, InsertAst, ParamRef, TableRef } from './types';\nimport { compact } from './util';\n\nexport interface CreateInsertAstOptions {\n readonly table: TableRef;\n readonly values: Record<string, ColumnRef | ParamRef>;\n readonly returning?: ReadonlyArray<ColumnRef>;\n}\n\nexport function createInsertAst(options: CreateInsertAstOptions): InsertAst {\n return compact({\n kind: 'insert',\n table: options.table,\n values: options.values,\n returning: options.returning,\n }) as InsertAst;\n}\n","import { planInvalid } from '@prisma-next/plan';\nimport type { AnyColumnBuilder, JoinOnBuilder, JoinOnPredicate } from '../types';\nimport { isColumnBuilder } from '../types';\nimport type { ColumnRef, JoinAst, JoinOnExpr, TableRef } from './types';\n\nexport function createJoin(\n joinType: 'inner' | 'left' | 'right' | 'full',\n table: TableRef,\n on: JoinOnExpr,\n): JoinAst {\n return {\n kind: 'join',\n joinType,\n table,\n on,\n };\n}\n\nexport function createJoinOnExpr(left: ColumnRef, right: ColumnRef): JoinOnExpr {\n return {\n kind: 'eqCol',\n left,\n right,\n };\n}\n\nclass JoinOnBuilderImpl implements JoinOnBuilder {\n eqCol(left: AnyColumnBuilder, right: AnyColumnBuilder): JoinOnPredicate {\n if (!left || !isColumnBuilder(left)) {\n throw planInvalid('Join ON left operand must be a column');\n }\n\n if (!right || !isColumnBuilder(right)) {\n throw planInvalid('Join ON right operand must be a column');\n }\n\n // TypeScript can't narrow ColumnBuilder properly, so we assert\n const leftCol = left as unknown as { table: string; column: string };\n const rightCol = right as unknown as { table: string; column: string };\n if (leftCol.table === rightCol.table) {\n throw planInvalid('Self-joins are not supported in MVP');\n }\n\n return {\n kind: 'join-on',\n left: left as AnyColumnBuilder,\n right: right as AnyColumnBuilder,\n };\n }\n}\n\nexport function createJoinOnBuilder(): JoinOnBuilder {\n return new JoinOnBuilderImpl();\n}\n","import type { ColumnRef, Direction, OperationExpr } from './types';\n\nexport function createOrderByItem(\n expr: ColumnRef | OperationExpr,\n dir: 'asc' | 'desc',\n): { expr: ColumnRef | OperationExpr; dir: Direction } {\n return {\n expr,\n dir,\n };\n}\n","import type {\n BinaryExpr,\n BinaryOp,\n ExistsExpr,\n Expression,\n ListLiteralExpr,\n LiteralExpr,\n NullCheckExpr,\n ParamRef,\n SelectAst,\n} from './types';\n\nexport function createBinaryExpr(\n op: BinaryOp,\n left: Expression,\n right: Expression | ParamRef | LiteralExpr | ListLiteralExpr,\n): BinaryExpr {\n return {\n kind: 'bin',\n op,\n left,\n right,\n };\n}\n\nexport function createExistsExpr(not: boolean, subquery: SelectAst): ExistsExpr {\n return {\n kind: 'exists',\n not,\n subquery,\n };\n}\n\nexport function createNullCheckExpr(expr: Expression, isNull: boolean): NullCheckExpr {\n return {\n kind: 'nullCheck',\n expr,\n isNull,\n };\n}\n","import type {\n ColumnRef,\n Direction,\n IncludeAst,\n IncludeRef,\n JoinAst,\n OperationExpr,\n SelectAst,\n TableRef,\n WhereExpr,\n} from './types';\nimport { compact } from './util';\n\nexport interface CreateSelectAstOptions {\n readonly from: TableRef;\n readonly joins?: ReadonlyArray<JoinAst>;\n readonly includes?: ReadonlyArray<IncludeAst>;\n readonly project: ReadonlyArray<{\n alias: string;\n expr: ColumnRef | IncludeRef | OperationExpr;\n }>;\n readonly where?: WhereExpr;\n readonly orderBy?: ReadonlyArray<{ expr: ColumnRef | OperationExpr; dir: Direction }>;\n readonly limit?: number;\n readonly selectAllIntent?: { table?: string };\n}\n\nexport function createSelectAst(options: CreateSelectAstOptions): SelectAst {\n return compact({\n kind: 'select',\n from: options.from,\n joins: options.joins,\n includes: options.includes,\n project: options.project,\n where: options.where,\n orderBy: options.orderBy,\n limit: options.limit,\n selectAllIntent: options.selectAllIntent,\n }) as SelectAst;\n}\n","import { type as arktype } from 'arktype';\nimport { codec, defineCodecs } from './codec-types';\n\nexport const SQL_CHAR_CODEC_ID = 'sql/char@1' as const;\nexport const SQL_VARCHAR_CODEC_ID = 'sql/varchar@1' as const;\nexport const SQL_INT_CODEC_ID = 'sql/int@1' as const;\nexport const SQL_FLOAT_CODEC_ID = 'sql/float@1' as const;\n\nconst lengthParamsSchema = arktype({\n length: 'number.integer > 0',\n});\n\ntype LengthTypeHelper = {\n readonly kind: 'fixed' | 'variable';\n readonly maxLength: number;\n};\n\nfunction createLengthTypeHelper(\n kind: LengthTypeHelper['kind'],\n): (params: Record<string, unknown>) => LengthTypeHelper {\n return (params) => ({\n kind,\n maxLength: params['length'] as number,\n });\n}\n\nconst sqlCharCodec = codec<typeof SQL_CHAR_CODEC_ID, string, string>({\n typeId: SQL_CHAR_CODEC_ID,\n targetTypes: ['char'],\n encode: (value: string): string => value,\n decode: (wire: string): string => wire.trimEnd(),\n paramsSchema: lengthParamsSchema,\n init: createLengthTypeHelper('fixed'),\n});\n\nconst sqlVarcharCodec = codec<typeof SQL_VARCHAR_CODEC_ID, string, string>({\n typeId: SQL_VARCHAR_CODEC_ID,\n targetTypes: ['varchar'],\n encode: (value: string): string => value,\n decode: (wire: string): string => wire,\n paramsSchema: lengthParamsSchema,\n init: createLengthTypeHelper('variable'),\n});\n\nconst sqlIntCodec = codec<typeof SQL_INT_CODEC_ID, number, number>({\n typeId: SQL_INT_CODEC_ID,\n targetTypes: ['int'],\n encode: (value) => value,\n decode: (wire) => wire,\n});\n\nconst sqlFloatCodec = codec<typeof SQL_FLOAT_CODEC_ID, number, number>({\n typeId: SQL_FLOAT_CODEC_ID,\n targetTypes: ['float'],\n encode: (value) => value,\n decode: (wire) => wire,\n});\n\nconst codecs = defineCodecs()\n .add('char', sqlCharCodec)\n .add('varchar', sqlVarcharCodec)\n .add('int', sqlIntCodec)\n .add('float', sqlFloatCodec);\n\nexport const sqlCodecDefinitions = codecs.codecDefinitions;\nexport const sqlDataTypes = codecs.dataTypes;\nexport type SqlCodecTypes = typeof codecs.CodecTypes;\n","import type { ParamDescriptor } from '@prisma-next/contract/types';\nimport type { ReturnSpec } from '@prisma-next/operations';\nimport type { SqlLoweringSpec } from '@prisma-next/sql-operations';\n\n// SQL-specific AST types and supporting types\n// These types are needed by adapters and runtime for SQL query execution\n\nexport type Direction = 'asc' | 'desc';\n\nexport interface TableRef {\n readonly kind: 'table';\n readonly name: string;\n}\n\nexport interface ColumnRef {\n readonly kind: 'col';\n readonly table: string;\n readonly column: string;\n}\n\nexport interface ParamRef {\n readonly kind: 'param';\n readonly index: number;\n readonly name?: string;\n}\n\nexport interface LiteralExpr {\n readonly kind: 'literal';\n readonly value: unknown;\n}\n\nexport interface OperationExpr {\n readonly kind: 'operation';\n readonly method: string;\n readonly forTypeId: string;\n readonly self: Expression;\n readonly args: ReadonlyArray<Expression | ParamRef | LiteralExpr>;\n readonly returns: ReturnSpec;\n readonly lowering: SqlLoweringSpec;\n}\n\n/**\n * Unified expression type - the canonical AST representation for column references\n * and operation expressions. This is what all builders convert to via toExpr().\n */\nexport type Expression = ColumnRef | OperationExpr;\n\n/**\n * Interface for any builder that can produce an Expression.\n * Implemented by ColumnBuilder and ExpressionBuilder.\n */\nexport interface ExpressionSource {\n toExpr(): Expression;\n}\n\nexport function isOperationExpr(expr: Expression): expr is OperationExpr {\n return expr.kind === 'operation';\n}\n\nexport type BinaryOp =\n | 'eq'\n | 'neq'\n | 'gt'\n | 'lt'\n | 'gte'\n | 'lte'\n | 'like'\n | 'ilike'\n | 'in'\n | 'notIn';\n\nexport interface BinaryExpr {\n readonly kind: 'bin';\n readonly op: BinaryOp;\n readonly left: Expression;\n readonly right: Expression | ParamRef | LiteralExpr | ListLiteralExpr;\n}\n\nexport interface ListLiteralExpr {\n readonly kind: 'listLiteral';\n readonly values: ReadonlyArray<ParamRef | LiteralExpr>;\n}\n\nexport interface AndExpr {\n readonly kind: 'and';\n readonly exprs: ReadonlyArray<WhereExpr>;\n}\n\nexport interface OrExpr {\n readonly kind: 'or';\n readonly exprs: ReadonlyArray<WhereExpr>;\n}\n\nexport interface ExistsExpr {\n readonly kind: 'exists';\n readonly not: boolean;\n readonly subquery: SelectAst;\n}\n\n/**\n * Unary expression for IS NULL / IS NOT NULL checks.\n * Used in WHERE clauses to check for null values.\n */\nexport interface NullCheckExpr {\n readonly kind: 'nullCheck';\n readonly expr: Expression;\n readonly isNull: boolean;\n}\n\n/**\n * Union type for WHERE clause expressions.\n */\nexport type WhereExpr = BinaryExpr | ExistsExpr | NullCheckExpr | AndExpr | OrExpr;\n\nexport interface BoundWhereExpr {\n readonly expr: WhereExpr;\n readonly params: readonly unknown[];\n readonly paramDescriptors: ReadonlyArray<ParamDescriptor>;\n}\n\nexport interface ToWhereExpr {\n toWhereExpr(): BoundWhereExpr;\n}\n\nexport type WhereArg = WhereExpr | ToWhereExpr;\n\nexport type JoinOnExpr =\n | {\n readonly kind: 'eqCol';\n readonly left: ColumnRef;\n readonly right: ColumnRef;\n }\n | WhereExpr;\n\nexport interface JoinAst {\n readonly kind: 'join';\n readonly joinType: 'inner' | 'left' | 'right' | 'full';\n readonly table: TableRef;\n readonly on: JoinOnExpr;\n}\n\nexport interface IncludeRef {\n readonly kind: 'includeRef';\n readonly alias: string;\n}\n\nexport interface IncludeAst {\n readonly kind: 'includeMany';\n readonly alias: string;\n readonly child: {\n readonly table: TableRef;\n readonly on: JoinOnExpr;\n readonly where?: WhereExpr;\n readonly orderBy?: ReadonlyArray<{ expr: Expression; dir: Direction }>;\n readonly limit?: number;\n readonly project: ReadonlyArray<{ alias: string; expr: Expression }>;\n };\n}\n\nexport interface SelectAst {\n readonly kind: 'select';\n readonly from: TableRef;\n readonly joins?: ReadonlyArray<JoinAst>;\n readonly includes?: ReadonlyArray<IncludeAst>;\n readonly project: ReadonlyArray<{\n alias: string;\n expr: Expression | IncludeRef | LiteralExpr;\n }>;\n readonly where?: WhereExpr;\n readonly orderBy?: ReadonlyArray<{ expr: Expression; dir: Direction }>;\n readonly limit?: number;\n readonly selectAllIntent?: { table?: string };\n}\n\nexport interface InsertAst {\n readonly kind: 'insert';\n readonly table: TableRef;\n readonly values: Record<string, ColumnRef | ParamRef>;\n readonly returning?: ReadonlyArray<ColumnRef>;\n}\n\nexport interface UpdateAst {\n readonly kind: 'update';\n readonly table: TableRef;\n readonly set: Record<string, ColumnRef | ParamRef>;\n readonly where?: WhereExpr;\n readonly returning?: ReadonlyArray<ColumnRef>;\n}\n\nexport interface DeleteAst {\n readonly kind: 'delete';\n readonly table: TableRef;\n readonly where?: WhereExpr;\n readonly returning?: ReadonlyArray<ColumnRef>;\n}\n\nexport type QueryAst = SelectAst | InsertAst | UpdateAst | DeleteAst;\n\nexport interface LoweredStatement {\n readonly sql: string;\n readonly params: readonly unknown[];\n readonly annotations?: Record<string, unknown>;\n}\n","import type { ColumnRef, ParamRef, TableRef, UpdateAst, WhereExpr } from './types';\nimport { compact } from './util';\n\nexport interface CreateUpdateAstOptions {\n readonly table: TableRef;\n readonly set: Record<string, ColumnRef | ParamRef>;\n readonly where?: WhereExpr;\n readonly returning?: ReadonlyArray<ColumnRef>;\n}\n\nexport function createUpdateAst(options: CreateUpdateAstOptions): UpdateAst {\n return compact({\n kind: 'update',\n table: options.table,\n set: options.set,\n where: options.where,\n returning: options.returning,\n }) as UpdateAst;\n}\n"],"mappings":";;;;;;;;;AAsIA,IAAM,oBAAN,M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SAA4C;AAC1E,QAAO,QAAQ;EACb,MAAM;EACN,OAAO,QAAQ;EACf,KAAK,QAAQ;EACb,OAAO,QAAQ;EACf,WAAW,QAAQ;EACpB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { n as planUnsupported, t as planInvalid } from "../errors-DVufq9PT.mjs";
2
+ export { planInvalid, planUnsupported };
@@ -0,0 +1,3 @@
1
+ import { n as planUnsupported, t as planInvalid } from "../errors-7_V3El9I.mjs";
2
+
3
+ export { planInvalid, planUnsupported };
@@ -0,0 +1,5 @@
1
+ import "../query-lane-context-CgkPuKaR.mjs";
2
+ import "../plan-BhSWuTfw.mjs";
3
+ import "../types-CEUzDuDC.mjs";
4
+ import { a as getColumnMeta, c as isExpressionBuilder, d as isParamPlaceholder, f as isValueSource, i as getColumnInfo, l as isExpressionSource, n as expressionFromSource, o as getOperationExpr, p as toExpression, r as extractBaseColumnRef, s as isColumnBuilder, t as collectColumnRefs, u as isOperationExpr } from "../guards-DCCpAlOL.mjs";
5
+ export { collectColumnRefs, expressionFromSource, extractBaseColumnRef, getColumnInfo, getColumnMeta, getOperationExpr, isColumnBuilder, isExpressionBuilder, isExpressionSource, isOperationExpr, isParamPlaceholder, isValueSource, toExpression };
@@ -0,0 +1,3 @@
1
+ import { a as getColumnMeta, c as isExpressionBuilder, d as isParamPlaceholder, f as isValueSource, i as getColumnInfo, l as isExpressionSource, n as expressionFromSource, o as getOperationExpr, p as toExpression, r as extractBaseColumnRef, s as isColumnBuilder, t as collectColumnRefs, u as isOperationExpr } from "../guards-0ycyntYX.mjs";
2
+
3
+ export { collectColumnRefs, expressionFromSource, extractBaseColumnRef, getColumnInfo, getColumnMeta, getOperationExpr, isColumnBuilder, isExpressionBuilder, isExpressionSource, isOperationExpr, isParamPlaceholder, isValueSource, toExpression };
@@ -0,0 +1,5 @@
1
+ import "../query-lane-context-CgkPuKaR.mjs";
2
+ import "../plan-BhSWuTfw.mjs";
3
+ import "../types-CEUzDuDC.mjs";
4
+ import { t as attachOperationsToColumnBuilder } from "../operations-registry-wVEaiLyt.mjs";
5
+ export { attachOperationsToColumnBuilder };
@@ -0,0 +1,3 @@
1
+ import { t as attachOperationsToColumnBuilder } from "../operations-registry-DPZ5aElH.mjs";
2
+
3
+ export { attachOperationsToColumnBuilder };
@@ -0,0 +1,5 @@
1
+ import "../query-lane-context-CgkPuKaR.mjs";
2
+ import "../plan-BhSWuTfw.mjs";
3
+ import "../types-CEUzDuDC.mjs";
4
+ import { n as param, t as Parameter } from "../param-C4n0OW59.mjs";
5
+ export { Parameter, param };
@@ -0,0 +1,3 @@
1
+ import { t as param } from "../param-DMU3OWfI.mjs";
2
+
3
+ export { param };
@@ -0,0 +1,2 @@
1
+ import { n as augmentDescriptorWithColumnMeta, t as SqlQueryPlan } from "../plan-BhSWuTfw.mjs";
2
+ export { SqlQueryPlan, augmentDescriptorWithColumnMeta };
@@ -0,0 +1,17 @@
1
+ //#region src/plan.ts
2
+ /**
3
+ * Augments the last ParamDescriptor in the array with codecId and nativeType from columnMeta.
4
+ * This is used when building WHERE expressions to ensure param descriptors have type information.
5
+ */
6
+ function augmentDescriptorWithColumnMeta(descriptors, columnMeta) {
7
+ const descriptor = descriptors[descriptors.length - 1];
8
+ if (descriptor && columnMeta) descriptors[descriptors.length - 1] = {
9
+ ...descriptor,
10
+ codecId: columnMeta.codecId,
11
+ nativeType: columnMeta.nativeType
12
+ };
13
+ }
14
+
15
+ //#endregion
16
+ export { augmentDescriptorWithColumnMeta };
17
+ //# sourceMappingURL=plan.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.mjs","names":[],"sources":["../../src/plan.ts"],"sourcesContent":["import type { ExecutionPlan, ParamDescriptor } from '@prisma-next/contract/types';\nimport type { StorageColumn } from '@prisma-next/sql-contract/types';\nimport type { QueryAst } from './ast/types';\n\n/**\n * SQL query plan produced by lanes before lowering.\n *\n * Lanes build ASTs and metadata but do not perform SQL lowering.\n * The `sql` field is absent - lowering happens in the runtime executor.\n *\n * Structurally aligns with ExecutionPlan<Row, QueryAst> (without sql field) to maintain\n * compatibility with ExecutionPlan/Plan-based utilities.\n * The generic parameter `_Row` is preserved for type extraction via ResultType.\n */\nexport interface SqlQueryPlan<_Row = unknown>\n extends Pick<ExecutionPlan<_Row, QueryAst>, 'params' | 'meta'> {\n readonly ast: QueryAst;\n // Phantom property to preserve generic parameter for type extraction\n // This allows ResultType to extract _Row for SqlQueryPlan values.\n readonly _Row?: _Row;\n}\n\n/**\n * Augments the last ParamDescriptor in the array with codecId and nativeType from columnMeta.\n * This is used when building WHERE expressions to ensure param descriptors have type information.\n */\nexport function augmentDescriptorWithColumnMeta(\n descriptors: ParamDescriptor[],\n columnMeta: StorageColumn | undefined,\n): void {\n const descriptor = descriptors[descriptors.length - 1];\n if (descriptor && columnMeta) {\n descriptors[descriptors.length - 1] = {\n ...descriptor,\n codecId: columnMeta.codecId,\n nativeType: columnMeta.nativeType,\n };\n }\n}\n"],"mappings":";;;;;AA0BA,SAAgB,gCACd,aACA,YACM;CACN,MAAM,aAAa,YAAY,YAAY,SAAS;AACpD,KAAI,cAAc,WAChB,aAAY,YAAY,SAAS,KAAK;EACpC,GAAG;EACH,SAAS,WAAW;EACpB,YAAY,WAAW;EACxB"}
@@ -0,0 +1,2 @@
1
+ import { a as JsonSchemaValidationResult, c as MutationDefaultsOptions, i as JsonSchemaValidationError, l as TypeHelperRegistry, n as ExecutionContext, o as JsonSchemaValidatorRegistry, r as JsonSchemaValidateFn, s as MutationDefaultsOp, t as AppliedMutationDefault } from "../query-lane-context-CgkPuKaR.mjs";
2
+ export { AppliedMutationDefault, ExecutionContext, JsonSchemaValidateFn, JsonSchemaValidationError, JsonSchemaValidationResult, JsonSchemaValidatorRegistry, MutationDefaultsOp, MutationDefaultsOptions, TypeHelperRegistry };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,5 @@
1
+ import "../query-lane-context-CgkPuKaR.mjs";
2
+ import "../plan-BhSWuTfw.mjs";
3
+ import "../types-CEUzDuDC.mjs";
4
+ import { i as schema, n as SchemaHandle, r as TableBuilderImpl, t as ColumnBuilderImpl } from "../schema-CgrEMqEd.mjs";
5
+ export { ColumnBuilderImpl as Column, ColumnBuilderImpl, SchemaHandle, TableBuilderImpl as Table, TableBuilderImpl, schema };
@@ -0,0 +1,4 @@
1
+ import "../operations-registry-DPZ5aElH.mjs";
2
+ import { n as TableBuilderImpl, r as schema, t as ColumnBuilderImpl } from "../schema-Bi5p4aAc.mjs";
3
+
4
+ export { ColumnBuilderImpl, TableBuilderImpl, schema };
@@ -0,0 +1,4 @@
1
+ import "../query-lane-context-CgkPuKaR.mjs";
2
+ import "../plan-BhSWuTfw.mjs";
3
+ import { A as OperationTypes, B as SqlBuilderOptions, C as Meta, D as NullCheckBuilder, E as NestedProjection, F as RawFunctionOptions, G as TablesOf, H as TableDef, I as RawTemplateFactory, J as createOrderBuilder, K as UnaryBuilder, L as RawTemplateOptions, M as OrderBuilder, N as ParamPlaceholder, O as NullableMethods, P as RawFactory, R as ResultType, S as META, T as ModelMetadata, U as TableKey, V as SqlPlan, W as TableMetadata, Y as isColumnBuilder, _ as InferNestedProjectionRow, a as AnyOrderBuilder, b as JoinOnBuilder, c as BuildOptions, d as ColumnBuilder, f as ColumnsOf, g as HasIncludeManyCapabilities, h as ExpressionBuilder, i as AnyExpressionSource, j as OperationsForTypeId, k as OperationTypeSignature, l as BuildParamsMap, m as Expr, n as AnyColumnBuilder, o as AnyUnaryBuilder, p as ComputeColumnJsType, q as ValueSource, r as AnyColumnBuilderBase, s as BinaryBuilder, t as AnyBinaryBuilder, u as CodecTypes, v as InferProjectionRow, w as ModelDef, x as JoinOnPredicate, y as InferReturningRow, z as RuntimeError } from "../types-CEUzDuDC.mjs";
4
+ export { AnyBinaryBuilder, AnyColumnBuilder, AnyColumnBuilderBase, AnyExpressionSource, AnyOrderBuilder, AnyUnaryBuilder, BinaryBuilder, BuildOptions, BuildParamsMap, CodecTypes, ColumnBuilder, ColumnsOf, ComputeColumnJsType, Expr, ExpressionBuilder, HasIncludeManyCapabilities, InferNestedProjectionRow, InferProjectionRow, InferReturningRow, JoinOnBuilder, JoinOnPredicate, META, Meta, ModelDef, ModelMetadata, NestedProjection, NullCheckBuilder, NullableMethods, OperationTypeSignature, OperationTypes, OperationsForTypeId, OrderBuilder, ParamPlaceholder, RawFactory, RawFunctionOptions, RawTemplateFactory, RawTemplateOptions, ResultType, RuntimeError, SqlBuilderOptions, SqlPlan, TableDef, TableKey, TableMetadata, TablesOf, UnaryBuilder, ValueSource, createOrderBuilder, isColumnBuilder };
@@ -0,0 +1,3 @@
1
+ import { n as isColumnBuilder, t as createOrderBuilder } from "../types-Cdi4Whda.mjs";
2
+
3
+ export { createOrderBuilder, isColumnBuilder };
@@ -0,0 +1,5 @@
1
+ import "../../query-lane-context-CgkPuKaR.mjs";
2
+ import "../../plan-BhSWuTfw.mjs";
3
+ import "../../types-CEUzDuDC.mjs";
4
+ import { a as getColumnMeta, c as isExpressionBuilder, d as isParamPlaceholder, f as isValueSource, i as getColumnInfo, l as isExpressionSource, n as expressionFromSource, o as getOperationExpr, p as toExpression, r as extractBaseColumnRef, s as isColumnBuilder, t as collectColumnRefs, u as isOperationExpr } from "../../guards-DCCpAlOL.mjs";
5
+ export { collectColumnRefs, expressionFromSource, extractBaseColumnRef, getColumnInfo, getColumnMeta, getOperationExpr, isColumnBuilder, isExpressionBuilder, isExpressionSource, isOperationExpr, isParamPlaceholder, isValueSource, toExpression };
@@ -0,0 +1,4 @@
1
+ import { a as getColumnMeta, c as isExpressionBuilder, d as isParamPlaceholder, f as isValueSource, i as getColumnInfo, l as isExpressionSource, n as expressionFromSource, o as getOperationExpr, p as toExpression, r as extractBaseColumnRef, s as isColumnBuilder, t as collectColumnRefs, u as isOperationExpr } from "../../guards-0ycyntYX.mjs";
2
+ import "../guards.mjs";
3
+
4
+ export { collectColumnRefs, expressionFromSource, extractBaseColumnRef, getColumnInfo, getColumnMeta, getOperationExpr, isColumnBuilder, isExpressionBuilder, isExpressionSource, isOperationExpr, isParamPlaceholder, isValueSource, toExpression };