prisma-ltree 0.5.0 → 0.7.0

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 (35) hide show
  1. package/README.md +41 -8
  2. package/dist/{codec-types-BJE-5cwk.d.mts → codec-types-B0DtEnU6.d.mts} +16 -13
  3. package/dist/codec-types-B0DtEnU6.d.mts.map +1 -0
  4. package/dist/codec-types.d.mts +1 -1
  5. package/dist/control.d.mts.map +1 -1
  6. package/dist/control.mjs +236 -16
  7. package/dist/control.mjs.map +1 -1
  8. package/dist/{descriptor-meta-2In8FI1I.mjs → descriptor-meta-DwbFei9y.mjs} +341 -34
  9. package/dist/descriptor-meta-DwbFei9y.mjs.map +1 -0
  10. package/dist/{operation-types-8su4lbK-.d.mts → operation-types-DD-KyBms.d.mts} +46 -1
  11. package/dist/{operation-types-8su4lbK-.d.mts.map → operation-types-DD-KyBms.d.mts.map} +1 -1
  12. package/dist/operation-types.d.mts +1 -1
  13. package/dist/pack.d.mts +1 -1
  14. package/dist/pack.d.mts.map +1 -1
  15. package/dist/pack.mjs +1 -1
  16. package/dist/runtime.d.mts +35 -1
  17. package/dist/runtime.d.mts.map +1 -1
  18. package/dist/runtime.mjs +34 -1
  19. package/dist/runtime.mjs.map +1 -1
  20. package/package.json +11 -10
  21. package/src/contract.d.ts +87 -20
  22. package/src/contract.json +22 -1
  23. package/src/contract.ts +21 -3
  24. package/src/core/codecs-validation.ts +31 -0
  25. package/src/core/codecs.ts +32 -55
  26. package/src/core/contract-space-constants.ts +11 -0
  27. package/src/core/data-types.ts +36 -2
  28. package/src/core/descriptor-meta.ts +64 -4
  29. package/src/core/hierarchy-collection-methods.ts +111 -0
  30. package/src/core/pattern-validation.ts +313 -0
  31. package/src/exports/control.ts +36 -1
  32. package/src/exports/runtime.ts +3 -0
  33. package/src/types/operation-types.ts +37 -0
  34. package/dist/codec-types-BJE-5cwk.d.mts.map +0 -1
  35. package/dist/descriptor-meta-2In8FI1I.mjs.map +0 -1
@@ -1,9 +1,10 @@
1
1
  import { i as LTREE_MAX_LABEL_LENGTH, n as LTREE_CODEC_ID, r as LTREE_MAX_LABELS, t as LTREE_ARRAY_CODEC_ID } from "./constants-Dfknw-h5.mjs";
2
2
  import { buildOperation, codecOf, toExpr } from "@prisma/orm-family-sql/relational-core/expression";
3
+ import { CodecImpl, refuseJsonValue } from "@prisma/orm-framework/components/codec";
3
4
  import { sqlDataType } from "@prisma/orm-family-sql/contract/data-type";
4
5
  import { pgText } from "@prisma/orm-target-postgres/target/data-types";
5
6
  import { buildCodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/codec-descriptor-registry";
6
- import { CodecImpl } from "@prisma/orm-framework/components/codec";
7
+ import { CastExpr } from "@prisma/orm-family-sql/relational-core/ast";
7
8
  import { PostgresCodecDescriptor, definePostgresCodecs } from "@prisma/orm-target-postgres/target/codec-descriptor";
8
9
  //#region src/core/authoring.ts
9
10
  const ltreeAuthoringTypes = { ltree: {
@@ -19,8 +20,32 @@ const ltreeAuthoringTypes = { ltree: {
19
20
  }
20
21
  } };
21
22
  //#endregion
23
+ //#region src/core/codecs-validation.ts
24
+ const LABEL_PATTERN = /^[A-Za-z0-9_-]+$/;
25
+ function assertValidLtree(value) {
26
+ if (typeof value !== "string") throw new Error("ltree value must be a string");
27
+ if (value.length === 0) throw new Error("ltree value must not be empty");
28
+ const labels = value.split(".");
29
+ if (labels.length > 65535) throw new Error(`ltree path exceeds max labels: got ${labels.length}, max ${LTREE_MAX_LABELS}`);
30
+ for (const label of labels) {
31
+ if (label.length === 0) throw new Error(`ltree label must not be empty in path "${value}"`);
32
+ if (label.length > 1e3) throw new Error(`ltree label exceeds max length: got ${label.length}, max ${LTREE_MAX_LABEL_LENGTH}`);
33
+ if (!LABEL_PATTERN.test(label)) throw new Error(`ltree label "${label}" contains invalid characters; allowed: alphanumeric, underscore, hyphen`);
34
+ }
35
+ }
36
+ //#endregion
22
37
  //#region src/core/data-types.ts
38
+ const readLtree = (json) => {
39
+ if (typeof json !== "string") return refuseJsonValue("ltree/ltree", "an ltree path string", json);
40
+ try {
41
+ assertValidLtree(json);
42
+ } catch {
43
+ return refuseJsonValue("ltree/ltree", "a valid ltree path string", json);
44
+ }
45
+ return json;
46
+ };
23
47
  const ltreeDataType = sqlDataType("ltree/ltree", {
48
+ read: readLtree,
24
49
  texts: [{
25
50
  text: "ltree",
26
51
  written: true,
@@ -28,15 +53,31 @@ const ltreeDataType = sqlDataType("ltree/ltree", {
28
53
  }],
29
54
  casts: { [pgText.id]: (value) => value }
30
55
  });
56
+ const readLtreeArray = (json) => {
57
+ const expected = "an array of ltree path strings";
58
+ if (!Array.isArray(json)) return refuseJsonValue("ltree/ltree-array", expected, json);
59
+ for (const entry of json) {
60
+ if (typeof entry !== "string") return refuseJsonValue("ltree/ltree-array", expected, entry);
61
+ try {
62
+ assertValidLtree(entry);
63
+ } catch {
64
+ return refuseJsonValue("ltree/ltree-array", expected, entry);
65
+ }
66
+ }
67
+ return json;
68
+ };
31
69
  /**
32
70
  * `sqlDataType` accepts parentheses in a type name and refuses square brackets.
33
71
  * PostgreSQL writes this type as `ltree[]`, and `format_type` reports `ltree[]`.
34
72
  * Declare the type first, then set that text so a migration and a catalog check use it.
35
73
  */
36
- const ltreeArrayDeclared = sqlDataType("ltree/ltree-array", { listCast: {
37
- of: [pgText.id],
38
- cast: (elements) => [...elements]
39
- } });
74
+ const ltreeArrayDeclared = sqlDataType("ltree/ltree-array", {
75
+ read: readLtreeArray,
76
+ listCast: {
77
+ of: [pgText.id],
78
+ cast: (elements) => [...elements]
79
+ }
80
+ });
40
81
  const ltreeArrayDataType = {
41
82
  ...ltreeArrayDeclared,
42
83
  sql: {
@@ -50,39 +91,265 @@ const ltreeArrayDataType = {
50
91
  };
51
92
  const ltreeDataTypes = [ltreeDataType, ltreeArrayDataType];
52
93
  //#endregion
53
- //#region src/core/codecs.ts
54
- const LABEL_PATTERN = /^[A-Za-z0-9_-]+$/;
55
- function assertValidLtree(value) {
56
- if (typeof value !== "string") throw new Error("ltree value must be a string");
57
- if (value.length === 0) throw new Error("ltree value must not be empty");
58
- const labels = value.split(".");
59
- if (labels.length > 65535) throw new Error(`ltree path exceeds max labels: got ${labels.length}, max ${LTREE_MAX_LABELS}`);
60
- for (const label of labels) {
61
- if (label.length === 0) throw new Error(`ltree label must not be empty in path "${value}"`);
62
- if (label.length > 1e3) throw new Error(`ltree label exceeds max length: got ${label.length}, max ${LTREE_MAX_LABEL_LENGTH}`);
63
- if (!LABEL_PATTERN.test(label)) throw new Error(`ltree label "${label}" contains invalid characters; allowed: alphanumeric, underscore, hyphen`);
94
+ //#region src/core/pattern-validation.ts
95
+ /**
96
+ * Lightweight structural checks for PostgreSQL `lquery` / `ltxtquery` pattern
97
+ * arguments. These catch empty values, empty path segments, unbalanced
98
+ * operators/parentheses, and obviously illegal syntax before the value is cast
99
+ * in SQL — without inventing framework PN-* error codes.
100
+ *
101
+ * Label bodies intentionally allow Unicode letters/numbers (`\p{L}` / `\p{N}`)
102
+ * plus `_` / `-` so locale-dependent labels that Postgres accepts are not
103
+ * rejected here. Full Postgres parsing still happens at the database.
104
+ */
105
+ /** Word body chars: locale letters/digits, underscore, hyphen. */
106
+ const WORD_CHAR = /[\p{L}\p{N}_-]/u;
107
+ function isWordChar(ch) {
108
+ return WORD_CHAR.test(ch);
109
+ }
110
+ function isDigit(ch) {
111
+ return ch >= "0" && ch <= "9";
112
+ }
113
+ function fail(kind, message, value) {
114
+ throw new Error(`${kind} ${message}: "${value}"`);
115
+ }
116
+ /**
117
+ * Parse an optional `{n}`, `{n,}`, `{,m}`, `{n,m}`, or `{,}` quantifier starting
118
+ * at `i`. Returns the index after the closing `}`, or `i` when no quantifier
119
+ * begins here. Throws on a malformed `{...}`.
120
+ */
121
+ function consumeQuantifier(kind, value, i, allow) {
122
+ if (value[i] !== "{") return i;
123
+ if (!allow) fail(kind, `syntax error at character ${i + 1}`, value);
124
+ let j = i + 1;
125
+ let low;
126
+ let high;
127
+ let sawComma = false;
128
+ const readNumber = () => {
129
+ if (j >= value.length || !isDigit(value[j])) return void 0;
130
+ const start = j;
131
+ while (j < value.length && isDigit(value[j])) j += 1;
132
+ return Number(value.slice(start, j));
133
+ };
134
+ low = readNumber();
135
+ if (j < value.length && value[j] === ",") {
136
+ sawComma = true;
137
+ j += 1;
138
+ high = readNumber();
139
+ }
140
+ if (j >= value.length || value[j] !== "}") fail(kind, `syntax error at character ${i + 1}`, value);
141
+ j += 1;
142
+ if (low === void 0 && high === void 0 && !sawComma) fail(kind, `syntax error at character ${i + 1}`, value);
143
+ if (low !== void 0 && high !== void 0 && low > high) fail(kind, "syntax error (quantifier low > high)", value);
144
+ return j;
145
+ }
146
+ /** Consume `@` / `*` / `%` modifiers that follow a non-star word. */
147
+ function consumeModifiers(value, i) {
148
+ while (i < value.length) {
149
+ const ch = value[i];
150
+ if (ch === "@" || ch === "*" || ch === "%") {
151
+ i += 1;
152
+ continue;
153
+ }
154
+ break;
155
+ }
156
+ return i;
157
+ }
158
+ function consumeWord(kind, value, i) {
159
+ if (i >= value.length || !isWordChar(value[i])) fail(kind, `syntax error at character ${i + 1}`, value);
160
+ let j = i;
161
+ while (j < value.length && isWordChar(value[j])) j += 1;
162
+ return j;
163
+ }
164
+ /**
165
+ * One lquery level: either `*` + optional quantifier, or an optional `!`
166
+ * followed by `word mods? (| word mods?)*` and an optional trailing quantifier.
167
+ */
168
+ function consumeLqueryLevel(value, i) {
169
+ if (value[i] === "*") return consumeQuantifier("lquery", value, i + 1, true);
170
+ let j = i;
171
+ if (value[j] === "!") j += 1;
172
+ j = consumeWord("lquery", value, j);
173
+ j = consumeModifiers(value, j);
174
+ while (j < value.length && value[j] === "|") {
175
+ j += 1;
176
+ j = consumeWord("lquery", value, j);
177
+ j = consumeModifiers(value, j);
64
178
  }
179
+ return consumeQuantifier("lquery", value, j, true);
65
180
  }
181
+ function assertValidLquery(value) {
182
+ if (typeof value !== "string") throw new Error("lquery pattern must be a string");
183
+ if (value.length === 0) throw new Error("lquery pattern must not be empty: \"\"");
184
+ let i = 0;
185
+ i = consumeLqueryLevel(value, i);
186
+ while (i < value.length) {
187
+ if (value[i] !== ".") fail("lquery", `syntax error at character ${i + 1}`, value);
188
+ i += 1;
189
+ if (i >= value.length) fail("lquery", "syntax error (trailing '.' / empty label)", value);
190
+ i = consumeLqueryLevel(value, i);
191
+ }
192
+ }
193
+ function assertValidLqueryArray(value) {
194
+ if (!Array.isArray(value)) throw new Error("lquery[] patterns must be a string array");
195
+ for (let index = 0; index < value.length; index += 1) {
196
+ const entry = value[index];
197
+ try {
198
+ assertValidLquery(entry);
199
+ } catch (error) {
200
+ const message = error instanceof Error ? error.message : String(error);
201
+ throw new Error(`lquery[] patterns[${index}]: ${message}`);
202
+ }
203
+ }
204
+ }
205
+ function tokenizeLtxtquery(value) {
206
+ const tokens = [];
207
+ let i = 0;
208
+ while (i < value.length) {
209
+ const ch = value[i];
210
+ if (ch === " " || ch === " " || ch === "\n" || ch === "\r") {
211
+ i += 1;
212
+ continue;
213
+ }
214
+ if (ch === "&") {
215
+ tokens.push({ kind: "and" });
216
+ i += 1;
217
+ continue;
218
+ }
219
+ if (ch === "|") {
220
+ tokens.push({ kind: "or" });
221
+ i += 1;
222
+ continue;
223
+ }
224
+ if (ch === "!") {
225
+ tokens.push({ kind: "not" });
226
+ i += 1;
227
+ continue;
228
+ }
229
+ if (ch === "(") {
230
+ tokens.push({ kind: "lparen" });
231
+ i += 1;
232
+ continue;
233
+ }
234
+ if (ch === ")") {
235
+ tokens.push({ kind: "rparen" });
236
+ i += 1;
237
+ continue;
238
+ }
239
+ if (isWordChar(ch)) {
240
+ const start = i;
241
+ i = consumeWord("ltxtquery", value, i);
242
+ i = consumeModifiers(value, i);
243
+ tokens.push({
244
+ kind: "word",
245
+ text: value.slice(start, i)
246
+ });
247
+ continue;
248
+ }
249
+ fail("ltxtquery", `syntax error at character ${i + 1}`, value);
250
+ }
251
+ return tokens;
252
+ }
253
+ /**
254
+ * Recursive-descent check mirroring Postgres ltxtquery operator precedence:
255
+ * OR < AND < NOT < primary (word / parenthesized expr).
256
+ */
257
+ function parseLtxtExpr(tokens, value) {
258
+ let pos = 0;
259
+ const peek = () => tokens[pos];
260
+ const take = () => {
261
+ const tok = tokens[pos];
262
+ if (!tok) fail("ltxtquery", "syntax error (unexpected end)", value);
263
+ pos += 1;
264
+ return tok;
265
+ };
266
+ const parsePrimary = () => {
267
+ const tok = peek();
268
+ if (!tok) fail("ltxtquery", "syntax error (missing operand)", value);
269
+ if (tok.kind === "word") {
270
+ take();
271
+ return;
272
+ }
273
+ if (tok.kind === "lparen") {
274
+ take();
275
+ parseOr();
276
+ if (take().kind !== "rparen") fail("ltxtquery", "syntax error (expected ')')", value);
277
+ return;
278
+ }
279
+ fail("ltxtquery", "syntax error (missing operand)", value);
280
+ };
281
+ const parseFactor = () => {
282
+ while (peek()?.kind === "not") take();
283
+ parsePrimary();
284
+ };
285
+ const parseAnd = () => {
286
+ parseFactor();
287
+ while (peek()?.kind === "and") {
288
+ take();
289
+ parseFactor();
290
+ }
291
+ };
292
+ const parseOr = () => {
293
+ parseAnd();
294
+ while (peek()?.kind === "or") {
295
+ take();
296
+ parseAnd();
297
+ }
298
+ };
299
+ parseOr();
300
+ if (pos !== tokens.length) fail("ltxtquery", "syntax error (unexpected token)", value);
301
+ }
302
+ function assertValidLtxtquery(value) {
303
+ if (typeof value !== "string") throw new Error("ltxtquery query must be a string");
304
+ if (value.length === 0) throw new Error("ltxtquery query must not be empty: \"\"");
305
+ const tokens = tokenizeLtxtquery(value);
306
+ if (tokens.length === 0) fail("ltxtquery", "syntax error (missing operand)", value);
307
+ parseLtxtExpr(tokens, value);
308
+ }
309
+ /**
310
+ * Validate a pattern argument when the caller passed a raw JS value. Expression
311
+ * / ParamRef objects are left alone so dynamic binds still round-trip to
312
+ * Postgres (which remains the authority for those).
313
+ */
314
+ function assertPatternArg(castType, arg) {
315
+ if (arg !== null && typeof arg === "object" && !Array.isArray(arg)) return;
316
+ switch (castType) {
317
+ case "lquery":
318
+ assertValidLquery(arg);
319
+ return;
320
+ case "ltxtquery":
321
+ assertValidLtxtquery(arg);
322
+ return;
323
+ case "lquery[]":
324
+ assertValidLqueryArray(arg);
325
+ return;
326
+ }
327
+ }
328
+ //#endregion
329
+ //#region src/core/codecs.ts
66
330
  var LtreeCodec = class extends CodecImpl {
67
- async encode(value, _ctx) {
331
+ constructor(descriptor) {
332
+ super(descriptor, ltreeDataType);
333
+ }
334
+ async toWire(value, _ctx) {
68
335
  assertValidLtree(value);
69
336
  return value;
70
337
  }
71
- async decode(wire, _ctx) {
338
+ async fromWire(wire, _ctx) {
72
339
  return wire;
73
340
  }
74
- encodeJson(value) {
341
+ toDataTypeValue(value) {
75
342
  assertValidLtree(value);
76
- return value;
343
+ return this.dataTypeValueOf(value);
77
344
  }
78
- decodeJson(json) {
79
- assertValidLtree(json);
80
- return json;
345
+ fromDataTypeValue(value) {
346
+ return value.value;
81
347
  }
82
348
  };
83
349
  var LtreeDescriptor = class extends PostgresCodecDescriptor {
350
+ jsonType = "string";
84
351
  jsonProjection(expression) {
85
- return expression;
352
+ return CastExpr.as(expression, "text");
86
353
  }
87
354
  dataType = ltreeDataType.id;
88
355
  codecId = LTREE_CODEC_ID;
@@ -98,26 +365,28 @@ var LtreeDescriptor = class extends PostgresCodecDescriptor {
98
365
  };
99
366
  const ltreeDescriptor = new LtreeDescriptor();
100
367
  var LtreeArrayCodec = class extends CodecImpl {
101
- async encode(value, _ctx) {
368
+ constructor(descriptor) {
369
+ super(descriptor, ltreeArrayDataType);
370
+ }
371
+ async toWire(value, _ctx) {
102
372
  for (const entry of value) assertValidLtree(entry);
103
373
  return value;
104
374
  }
105
- async decode(wire, _ctx) {
375
+ async fromWire(wire, _ctx) {
106
376
  return wire;
107
377
  }
108
- encodeJson(value) {
378
+ toDataTypeValue(value) {
109
379
  for (const entry of value) assertValidLtree(entry);
110
- return [...value];
380
+ return this.dataTypeValueOf([...value]);
111
381
  }
112
- decodeJson(json) {
382
+ fromDataTypeValue(value) {
383
+ const json = value.value;
113
384
  if (!Array.isArray(json)) return [];
114
- return json.map((entry) => {
115
- assertValidLtree(entry);
116
- return String(entry);
117
- });
385
+ return json.map((entry) => String(entry));
118
386
  }
119
387
  };
120
388
  var LtreeArrayDescriptor = class extends PostgresCodecDescriptor {
389
+ jsonType = "array";
121
390
  jsonProjection(expression) {
122
391
  return expression;
123
392
  }
@@ -193,6 +462,7 @@ function ltreeQueryOperations() {
193
462
  });
194
463
  };
195
464
  const patternOp = (method, operator, castType, self, arg, many = false) => {
465
+ assertPatternArg(castType, arg);
196
466
  return buildOperation({
197
467
  method,
198
468
  args: [toExpr(self, codecOf(self)), toExpr(arg, many ? {
@@ -215,7 +485,24 @@ function ltreeQueryOperations() {
215
485
  template
216
486
  }
217
487
  });
488
+ const arrayBoolOp = (method, operator, self, arg, argCodecId, castType, many = false) => {
489
+ if (castType) assertPatternArg(castType, arg);
490
+ const template = castType ? `{{self}} ${operator} ({{arg0}})::${castType}` : `{{self}} ${operator} {{arg0}}`;
491
+ return buildOperation({
492
+ method,
493
+ args: [toExpr(self, codecOf(self)), toExpr(arg, many ? {
494
+ codecId: argCodecId,
495
+ many: true
496
+ } : { codecId: argCodecId })],
497
+ returns: BOOL_RETURN,
498
+ lowering: {
499
+ targetFamily: "sql",
500
+ template
501
+ }
502
+ });
503
+ };
218
504
  const firstMatchOp = (method, operator, self, arg, argCodecId, castType) => {
505
+ if (castType) assertPatternArg(castType, arg);
219
506
  const selfCodec = codecOf(self);
220
507
  const template = castType ? `{{self}} ${operator} ({{arg0}})::${castType}` : `{{self}} ${operator} {{arg0}}`;
221
508
  return buildOperation({
@@ -326,6 +613,26 @@ function ltreeQueryOperations() {
326
613
  self: { codecId: LTREE_ARRAY_CODEC_ID },
327
614
  impl: (self, query) => firstMatchOp("firstMatchLtxtquery", "?@", self, query, TEXT_CODEC_ID, "ltxtquery")
328
615
  },
616
+ containsAncestorOf: {
617
+ self: { codecId: LTREE_ARRAY_CODEC_ID },
618
+ impl: (self, other) => arrayBoolOp("containsAncestorOf", "@>", self, other, LTREE_CODEC_ID)
619
+ },
620
+ containsDescendantOf: {
621
+ self: { codecId: LTREE_ARRAY_CODEC_ID },
622
+ impl: (self, other) => arrayBoolOp("containsDescendantOf", "<@", self, other, LTREE_CODEC_ID)
623
+ },
624
+ matchesAnyLquery: {
625
+ self: { codecId: LTREE_ARRAY_CODEC_ID },
626
+ impl: (self, pattern) => arrayBoolOp("matchesAnyLquery", "~", self, pattern, TEXT_CODEC_ID, "lquery")
627
+ },
628
+ matchesAnyLqueryArray: {
629
+ self: { codecId: LTREE_ARRAY_CODEC_ID },
630
+ impl: (self, patterns) => arrayBoolOp("matchesAnyLqueryArray", "?", self, patterns, TEXT_CODEC_ID, "lquery[]", true)
631
+ },
632
+ matchesAnyLtxtquery: {
633
+ self: { codecId: LTREE_ARRAY_CODEC_ID },
634
+ impl: (self, query) => arrayBoolOp("matchesAnyLtxtquery", "@", self, query, TEXT_CODEC_ID, "ltxtquery")
635
+ },
329
636
  lcaAll: {
330
637
  self: { codecId: LTREE_ARRAY_CODEC_ID },
331
638
  impl: (self) => funcOp("lcaAll", "lca", LTREE_RETURN, [toExpr(self, codecOf(self))])
@@ -365,4 +672,4 @@ const ltreePackMeta = {
365
672
  //#endregion
366
673
  export { ltreeQueryOperations as n, ltreeCodecRegistry as r, ltreePackMeta as t };
367
674
 
368
- //# sourceMappingURL=descriptor-meta-2In8FI1I.mjs.map
675
+ //# sourceMappingURL=descriptor-meta-DwbFei9y.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor-meta-DwbFei9y.mjs","names":[],"sources":["../src/core/authoring.ts","../src/core/codecs-validation.ts","../src/core/data-types.ts","../src/core/pattern-validation.ts","../src/core/codecs.ts","../src/core/registry.ts","../src/core/descriptor-meta.ts"],"sourcesContent":["import type { AuthoringTypeNamespace } from \"@prisma/orm-framework/components/authoring\";\nimport { LTREE_ARRAY_CODEC_ID, LTREE_CODEC_ID } from \"./constants\";\n\nexport const ltreeAuthoringTypes = {\n ltree: {\n Ltree: {\n kind: \"typeConstructor\",\n inferred: true,\n output: {\n codecId: LTREE_CODEC_ID,\n },\n },\n LtreeArray: {\n kind: \"typeConstructor\",\n inferred: true,\n output: {\n codecId: LTREE_ARRAY_CODEC_ID,\n },\n },\n },\n} as const satisfies AuthoringTypeNamespace;\n","import { LTREE_MAX_LABEL_LENGTH, LTREE_MAX_LABELS } from \"./constants\";\n\nconst LABEL_PATTERN = /^[A-Za-z0-9_-]+$/;\n\nexport function assertValidLtree(value: unknown): asserts value is string {\n if (typeof value !== \"string\") {\n throw new Error(\"ltree value must be a string\");\n }\n if (value.length === 0) {\n throw new Error(\"ltree value must not be empty\");\n }\n const labels = value.split(\".\");\n if (labels.length > LTREE_MAX_LABELS) {\n throw new Error(`ltree path exceeds max labels: got ${labels.length}, max ${LTREE_MAX_LABELS}`);\n }\n for (const label of labels) {\n if (label.length === 0) {\n throw new Error(`ltree label must not be empty in path \"${value}\"`);\n }\n if (label.length > LTREE_MAX_LABEL_LENGTH) {\n throw new Error(\n `ltree label exceeds max length: got ${label.length}, max ${LTREE_MAX_LABEL_LENGTH}`,\n );\n }\n if (!LABEL_PATTERN.test(label)) {\n throw new Error(\n `ltree label \"${label}\" contains invalid characters; allowed: alphanumeric, underscore, hyphen`,\n );\n }\n }\n}\n","/**\n * Data types this extension owns.\n *\n * `ltree` and `ltree[]` are PostgreSQL types the target does not register.\n * A path's stored form is its label text. An array's stored form is a\n * JSON array of those texts. Both accept text the contract can already write.\n * The texts are what a migration writes and what the catalog reports.\n */\n\nimport type { DataType, DataTypeReader } from \"@prisma/orm-framework/components/codec\";\nimport { refuseJsonValue } from \"@prisma/orm-framework/components/codec\";\nimport { sqlDataType } from \"@prisma/orm-family-sql/contract/data-type\";\nimport { pgText } from \"@prisma/orm-target-postgres/target/data-types\";\nimport { assertValidLtree } from \"./codecs-validation\";\n\nconst readLtree: DataTypeReader = (json) => {\n if (typeof json !== \"string\") {\n return refuseJsonValue(\"ltree/ltree\", \"an ltree path string\", json);\n }\n try {\n assertValidLtree(json);\n } catch {\n return refuseJsonValue(\"ltree/ltree\", \"a valid ltree path string\", json);\n }\n return json;\n};\n\nexport const ltreeDataType = sqlDataType(\"ltree/ltree\", {\n read: readLtree,\n texts: [{ text: \"ltree\", written: true, catalog: true }],\n casts: {\n [pgText.id]: (value) => value,\n },\n});\n\nconst readLtreeArray: DataTypeReader = (json) => {\n const expected = \"an array of ltree path strings\";\n if (!Array.isArray(json)) {\n return refuseJsonValue(\"ltree/ltree-array\", expected, json);\n }\n for (const entry of json) {\n if (typeof entry !== \"string\") {\n return refuseJsonValue(\"ltree/ltree-array\", expected, entry);\n }\n try {\n assertValidLtree(entry);\n } catch {\n return refuseJsonValue(\"ltree/ltree-array\", expected, entry);\n }\n }\n return json;\n};\n\n/**\n * `sqlDataType` accepts parentheses in a type name and refuses square brackets.\n * PostgreSQL writes this type as `ltree[]`, and `format_type` reports `ltree[]`.\n * Declare the type first, then set that text so a migration and a catalog check use it.\n */\nconst ltreeArrayDeclared = sqlDataType(\"ltree/ltree-array\", {\n read: readLtreeArray,\n listCast: {\n of: [pgText.id],\n cast: (elements) => [...elements],\n },\n});\n\nexport const ltreeArrayDataType = {\n ...ltreeArrayDeclared,\n sql: {\n ...ltreeArrayDeclared.sql,\n texts: [{ text: \"ltree[]\", written: true as const, catalog: true as const }],\n },\n} as typeof ltreeArrayDeclared;\n\nexport const ltreeDataTypes: readonly DataType[] = [ltreeDataType, ltreeArrayDataType];\n","/**\n * Lightweight structural checks for PostgreSQL `lquery` / `ltxtquery` pattern\n * arguments. These catch empty values, empty path segments, unbalanced\n * operators/parentheses, and obviously illegal syntax before the value is cast\n * in SQL — without inventing framework PN-* error codes.\n *\n * Label bodies intentionally allow Unicode letters/numbers (`\\p{L}` / `\\p{N}`)\n * plus `_` / `-` so locale-dependent labels that Postgres accepts are not\n * rejected here. Full Postgres parsing still happens at the database.\n */\n\n/** Word body chars: locale letters/digits, underscore, hyphen. */\nconst WORD_CHAR = /[\\p{L}\\p{N}_-]/u;\n\nfunction isWordChar(ch: string): boolean {\n return WORD_CHAR.test(ch);\n}\n\nfunction isDigit(ch: string): boolean {\n return ch >= \"0\" && ch <= \"9\";\n}\n\nfunction fail(kind: \"lquery\" | \"ltxtquery\", message: string, value: string): never {\n throw new Error(`${kind} ${message}: \"${value}\"`);\n}\n\n/**\n * Parse an optional `{n}`, `{n,}`, `{,m}`, `{n,m}`, or `{,}` quantifier starting\n * at `i`. Returns the index after the closing `}`, or `i` when no quantifier\n * begins here. Throws on a malformed `{...}`.\n */\nfunction consumeQuantifier(\n kind: \"lquery\" | \"ltxtquery\",\n value: string,\n i: number,\n allow: boolean,\n): number {\n if (value[i] !== \"{\") return i;\n if (!allow) {\n fail(kind, `syntax error at character ${i + 1}`, value);\n }\n let j = i + 1;\n let low: number | undefined;\n let high: number | undefined;\n let sawComma = false;\n\n const readNumber = (): number | undefined => {\n if (j >= value.length || !isDigit(value[j]!)) return undefined;\n const start = j;\n while (j < value.length && isDigit(value[j]!)) j += 1;\n return Number(value.slice(start, j));\n };\n\n low = readNumber();\n if (j < value.length && value[j] === \",\") {\n sawComma = true;\n j += 1;\n high = readNumber();\n }\n if (j >= value.length || value[j] !== \"}\") {\n fail(kind, `syntax error at character ${i + 1}`, value);\n }\n j += 1;\n\n // `{}` is invalid; `{,}` (both ends open) is valid in Postgres.\n if (low === undefined && high === undefined && !sawComma) {\n fail(kind, `syntax error at character ${i + 1}`, value);\n }\n if (low !== undefined && high !== undefined && low > high) {\n fail(kind, \"syntax error (quantifier low > high)\", value);\n }\n return j;\n}\n\n/** Consume `@` / `*` / `%` modifiers that follow a non-star word. */\nfunction consumeModifiers(value: string, i: number): number {\n while (i < value.length) {\n const ch = value[i]!;\n if (ch === \"@\" || ch === \"*\" || ch === \"%\") {\n i += 1;\n continue;\n }\n break;\n }\n return i;\n}\n\nfunction consumeWord(kind: \"lquery\" | \"ltxtquery\", value: string, i: number): number {\n if (i >= value.length || !isWordChar(value[i]!)) {\n fail(kind, `syntax error at character ${i + 1}`, value);\n }\n let j = i;\n while (j < value.length && isWordChar(value[j]!)) j += 1;\n return j;\n}\n\n/**\n * One lquery level: either `*` + optional quantifier, or an optional `!`\n * followed by `word mods? (| word mods?)*` and an optional trailing quantifier.\n */\nfunction consumeLqueryLevel(value: string, i: number): number {\n if (value[i] === \"*\") {\n // Star wildcards cannot take `@`/`%` modifiers; only an optional quantifier.\n return consumeQuantifier(\"lquery\", value, i + 1, true);\n }\n\n let j = i;\n if (value[j] === \"!\") {\n j += 1;\n }\n\n j = consumeWord(\"lquery\", value, j);\n j = consumeModifiers(value, j);\n\n while (j < value.length && value[j] === \"|\") {\n j += 1;\n j = consumeWord(\"lquery\", value, j);\n j = consumeModifiers(value, j);\n }\n\n return consumeQuantifier(\"lquery\", value, j, true);\n}\n\nexport function assertValidLquery(value: unknown): asserts value is string {\n if (typeof value !== \"string\") {\n throw new Error(\"lquery pattern must be a string\");\n }\n if (value.length === 0) {\n throw new Error('lquery pattern must not be empty: \"\"');\n }\n\n let i = 0;\n i = consumeLqueryLevel(value, i);\n while (i < value.length) {\n if (value[i] !== \".\") {\n fail(\"lquery\", `syntax error at character ${i + 1}`, value);\n }\n i += 1;\n if (i >= value.length) {\n fail(\"lquery\", \"syntax error (trailing '.' / empty label)\", value);\n }\n i = consumeLqueryLevel(value, i);\n }\n}\n\nexport function assertValidLqueryArray(value: unknown): asserts value is readonly string[] {\n if (!Array.isArray(value)) {\n throw new Error(\"lquery[] patterns must be a string array\");\n }\n for (let index = 0; index < value.length; index += 1) {\n const entry = value[index];\n try {\n assertValidLquery(entry);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(`lquery[] patterns[${index}]: ${message}`);\n }\n }\n}\n\ntype LtxtToken =\n | { readonly kind: \"word\"; readonly text: string }\n | { readonly kind: \"and\" }\n | { readonly kind: \"or\" }\n | { readonly kind: \"not\" }\n | { readonly kind: \"lparen\" }\n | { readonly kind: \"rparen\" };\n\nfunction tokenizeLtxtquery(value: string): LtxtToken[] {\n const tokens: LtxtToken[] = [];\n let i = 0;\n while (i < value.length) {\n const ch = value[i]!;\n if (ch === \" \" || ch === \"\\t\" || ch === \"\\n\" || ch === \"\\r\") {\n i += 1;\n continue;\n }\n if (ch === \"&\") {\n tokens.push({ kind: \"and\" });\n i += 1;\n continue;\n }\n if (ch === \"|\") {\n tokens.push({ kind: \"or\" });\n i += 1;\n continue;\n }\n if (ch === \"!\") {\n tokens.push({ kind: \"not\" });\n i += 1;\n continue;\n }\n if (ch === \"(\") {\n tokens.push({ kind: \"lparen\" });\n i += 1;\n continue;\n }\n if (ch === \")\") {\n tokens.push({ kind: \"rparen\" });\n i += 1;\n continue;\n }\n if (isWordChar(ch)) {\n const start = i;\n i = consumeWord(\"ltxtquery\", value, i);\n i = consumeModifiers(value, i);\n tokens.push({ kind: \"word\", text: value.slice(start, i) });\n continue;\n }\n fail(\"ltxtquery\", `syntax error at character ${i + 1}`, value);\n }\n return tokens;\n}\n\n/**\n * Recursive-descent check mirroring Postgres ltxtquery operator precedence:\n * OR < AND < NOT < primary (word / parenthesized expr).\n */\nfunction parseLtxtExpr(tokens: readonly LtxtToken[], value: string): void {\n let pos = 0;\n\n const peek = (): LtxtToken | undefined => tokens[pos];\n const take = (): LtxtToken => {\n const tok = tokens[pos];\n if (!tok) fail(\"ltxtquery\", \"syntax error (unexpected end)\", value);\n pos += 1;\n return tok;\n };\n\n const parsePrimary = (): void => {\n const tok = peek();\n if (!tok) fail(\"ltxtquery\", \"syntax error (missing operand)\", value);\n if (tok.kind === \"word\") {\n take();\n return;\n }\n if (tok.kind === \"lparen\") {\n take();\n parseOr();\n const close = take();\n if (close.kind !== \"rparen\") {\n fail(\"ltxtquery\", \"syntax error (expected ')')\", value);\n }\n return;\n }\n fail(\"ltxtquery\", \"syntax error (missing operand)\", value);\n };\n\n const parseFactor = (): void => {\n while (peek()?.kind === \"not\") take();\n parsePrimary();\n };\n\n const parseAnd = (): void => {\n parseFactor();\n while (peek()?.kind === \"and\") {\n take();\n parseFactor();\n }\n };\n\n const parseOr = (): void => {\n parseAnd();\n while (peek()?.kind === \"or\") {\n take();\n parseAnd();\n }\n };\n\n parseOr();\n if (pos !== tokens.length) {\n fail(\"ltxtquery\", \"syntax error (unexpected token)\", value);\n }\n}\n\nexport function assertValidLtxtquery(value: unknown): asserts value is string {\n if (typeof value !== \"string\") {\n throw new Error(\"ltxtquery query must be a string\");\n }\n if (value.length === 0) {\n throw new Error('ltxtquery query must not be empty: \"\"');\n }\n const tokens = tokenizeLtxtquery(value);\n if (tokens.length === 0) {\n fail(\"ltxtquery\", \"syntax error (missing operand)\", value);\n }\n parseLtxtExpr(tokens, value);\n}\n\n/**\n * Validate a pattern argument when the caller passed a raw JS value. Expression\n * / ParamRef objects are left alone so dynamic binds still round-trip to\n * Postgres (which remains the authority for those).\n */\nexport function assertPatternArg(\n castType: \"lquery\" | \"ltxtquery\" | \"lquery[]\",\n arg: unknown,\n): void {\n if (arg !== null && typeof arg === \"object\" && !Array.isArray(arg)) {\n return;\n }\n switch (castType) {\n case \"lquery\":\n assertValidLquery(arg);\n return;\n case \"ltxtquery\":\n assertValidLtxtquery(arg);\n return;\n case \"lquery[]\":\n assertValidLqueryArray(arg);\n return;\n }\n}\n","import {\n type AnyCodecDescriptor,\n type CodecCallContext,\n CodecImpl,\n type CodecInstanceContext,\n type ColumnHelperFor,\n type ColumnHelperForStrict,\n column,\n type DataTypeValue,\n} from \"@prisma/orm-framework/components/codec\";\nimport type { ExtractCodecTypes, ProjectionExpr } from \"@prisma/orm-family-sql/relational-core/ast\";\nimport { CastExpr } from \"@prisma/orm-family-sql/relational-core/ast\";\nimport {\n definePostgresCodecs,\n PostgresCodecDescriptor,\n} from \"@prisma/orm-target-postgres/target/codec-descriptor\";\nimport { assertValidLtree } from \"./codecs-validation\";\nimport { LTREE_ARRAY_CODEC_ID, LTREE_CODEC_ID } from \"./constants\";\nimport { ltreeArrayDataType, ltreeDataType } from \"./data-types\";\n\nexport { assertValidLtree } from \"./codecs-validation\";\n\nexport class LtreeCodec extends CodecImpl<\n typeof LTREE_CODEC_ID,\n readonly [\"equality\", \"order\"],\n string,\n string\n> {\n constructor(descriptor: AnyCodecDescriptor) {\n super(descriptor, ltreeDataType);\n }\n\n async toWire(value: string, _ctx: CodecCallContext): Promise<string> {\n assertValidLtree(value);\n return value;\n }\n\n async fromWire(wire: string, _ctx: CodecCallContext): Promise<string> {\n return wire;\n }\n\n toDataTypeValue(value: string): DataTypeValue {\n assertValidLtree(value);\n return this.dataTypeValueOf(value);\n }\n\n fromDataTypeValue(value: DataTypeValue): string {\n return value.value as string;\n }\n}\n\nexport class LtreeDescriptor extends PostgresCodecDescriptor<void> {\n override readonly jsonType = \"string\" as const;\n protected override jsonProjection(expression: ProjectionExpr): ProjectionExpr {\n // JSON projections read through fromWire; cast so the wire value is text.\n return CastExpr.as(expression, \"text\");\n }\n override readonly dataType = ltreeDataType.id;\n override readonly codecId = LTREE_CODEC_ID;\n override readonly traits = [\"equality\", \"order\"] as const;\n override readonly paramsSchema = undefined;\n override renderOutputType(): string {\n return \"string\";\n }\n override factory(): (ctx: CodecInstanceContext) => LtreeCodec {\n const shared = new LtreeCodec(this);\n return () => shared;\n }\n}\n\nexport const ltreeDescriptor = new LtreeDescriptor();\n\nexport const ltree = () => column(ltreeDescriptor.factory(), ltreeDescriptor.codecId, undefined);\n\nltree satisfies ColumnHelperFor<LtreeDescriptor>;\nltree satisfies ColumnHelperForStrict<LtreeDescriptor>;\n\nexport class LtreeArrayCodec extends CodecImpl<\n typeof LTREE_ARRAY_CODEC_ID,\n readonly [\"equality\"],\n readonly string[],\n readonly string[]\n> {\n constructor(descriptor: AnyCodecDescriptor) {\n super(descriptor, ltreeArrayDataType);\n }\n\n async toWire(value: readonly string[], _ctx: CodecCallContext): Promise<readonly string[]> {\n for (const entry of value) {\n assertValidLtree(entry);\n }\n return value;\n }\n\n async fromWire(wire: readonly string[], _ctx: CodecCallContext): Promise<readonly string[]> {\n return wire;\n }\n\n toDataTypeValue(value: readonly string[]): DataTypeValue {\n for (const entry of value) {\n assertValidLtree(entry);\n }\n return this.dataTypeValueOf([...value]);\n }\n\n fromDataTypeValue(value: DataTypeValue): readonly string[] {\n const json = value.value;\n if (!Array.isArray(json)) {\n return [];\n }\n return json.map((entry) => String(entry));\n }\n}\n\nexport class LtreeArrayDescriptor extends PostgresCodecDescriptor<void> {\n override readonly jsonType = \"array\" as const;\n protected override jsonProjection(expression: ProjectionExpr): ProjectionExpr {\n // ltree[] already projects as a JSON string array for fromWire.\n return expression;\n }\n override readonly dataType = ltreeArrayDataType.id;\n override readonly codecId = LTREE_ARRAY_CODEC_ID;\n override readonly traits = [\"equality\"] as const;\n override readonly paramsSchema = undefined;\n override renderOutputType(): string {\n return \"readonly string[]\";\n }\n override factory(): (ctx: CodecInstanceContext) => LtreeArrayCodec {\n const shared = new LtreeArrayCodec(this);\n return () => shared;\n }\n}\n\nexport const ltreeArrayDescriptor = new LtreeArrayDescriptor();\n\nexport const ltreeArray = () =>\n column(ltreeArrayDescriptor.factory(), ltreeArrayDescriptor.codecId, undefined);\n\nltreeArray satisfies ColumnHelperFor<LtreeArrayDescriptor>;\nltreeArray satisfies ColumnHelperForStrict<LtreeArrayDescriptor>;\n\nconst codecDescriptorMap = {\n ltree: ltreeDescriptor,\n ltreeArray: ltreeArrayDescriptor,\n} as const;\n\nexport type CodecTypes = ExtractCodecTypes<typeof codecDescriptorMap>;\n\nexport const codecDescriptors = definePostgresCodecs(Object.values(codecDescriptorMap));\n","import { buildCodecDescriptorRegistry } from \"@prisma/orm-family-sql/relational-core/codec-descriptor-registry\";\nimport type { CodecDescriptorRegistry } from \"@prisma/orm-family-sql/relational-core/query-lane-context\";\nimport { codecDescriptors } from \"./codecs\";\n\nexport const ltreeCodecRegistry: CodecDescriptorRegistry =\n buildCodecDescriptorRegistry(codecDescriptors);\n","import type { AnyExpression } from \"@prisma/orm-family-sql/relational-core/ast\";\nimport {\n buildOperation,\n type CodecExpression,\n codecOf,\n type Expression,\n toExpr,\n} from \"@prisma/orm-family-sql/relational-core/expression\";\nimport type { CodecTypes } from \"../types/codec-types\";\nimport type { QueryOperationTypes } from \"../types/operation-types\";\nimport { ltreeAuthoringTypes } from \"./authoring\";\nimport { LTREE_ARRAY_CODEC_ID, LTREE_CODEC_ID } from \"./constants\";\nimport { ltreeDataTypes } from \"./data-types\";\nimport { assertPatternArg } from \"./pattern-validation\";\nimport { ltreeCodecRegistry } from \"./registry\";\n\ntype CodecTypesBase = Record<string, { readonly input: unknown; readonly output: unknown }>;\n\ntype BoolReturn = Expression<{ readonly codecId: \"pg/bool@1\"; readonly nullable: false }>;\ntype LtreeReturn = Expression<{ readonly codecId: \"pg/ltree@1\"; readonly nullable: false }>;\ntype IntReturn = Expression<{ readonly codecId: \"pg/int4@1\"; readonly nullable: false }>;\ntype TextReturn = Expression<{ readonly codecId: \"pg/text@1\"; readonly nullable: false }>;\n\nconst BOOL_RETURN = { codecId: \"pg/bool@1\", nullable: false } as const;\nconst LTREE_RETURN = { codecId: \"pg/ltree@1\", nullable: false } as const;\nconst INT_RETURN = { codecId: \"pg/int4@1\", nullable: false } as const;\nconst TEXT_RETURN = { codecId: \"pg/text@1\", nullable: false } as const;\nconst TEXT_CODEC_ID = \"pg/text@1\" as const;\nconst INT_CODEC_ID = \"pg/int4@1\" as const;\n\n/**\n * Build a function-style operation whose SQL is `fnName(self, arg0, arg1, ...)`.\n * The template's placeholder count is derived from the actual argument list, so\n * one helper covers fixed-arity functions (`nlevel`, `subltree`), optional-arg\n * overloads (`subpath`, `index`), and the variadic `lca` (see ADR-001). `args`\n * already carries each value through `toExpr` with its codec; `args[0]` is the\n * `self` receiver.\n */\nfunction funcOp<C extends string>(\n method: string,\n fnName: string,\n returns: { readonly codecId: C; readonly nullable: false },\n args: readonly [AnyExpression, ...AnyExpression[]],\n): Expression<{ readonly codecId: C; readonly nullable: false }> {\n const placeholders = args.map((_, i) => (i === 0 ? \"{{self}}\" : `{{arg${i - 1}}}`)).join(\", \");\n return buildOperation({\n method,\n args,\n returns,\n lowering: {\n targetFamily: \"sql\",\n template: `${fnName}(${placeholders})`,\n },\n });\n}\n\nexport function ltreeQueryOperations<CT extends CodecTypesBase>(): QueryOperationTypes<CT> {\n // Hierarchy operators compare two `ltree` values; the user argument shares the\n // column's `pg/ltree@1` codec. Pattern-match operators take a query/pattern\n // string (or `string[]`) that is NOT an ltree — it is bound as text and cast\n // in-template to `lquery` / `lquery[]` / `ltxtquery`. Literal string args get a\n // lightweight structural check first (see `pattern-validation.ts`) so empty /\n // obviously illegal patterns fail with a clear pack error instead of an opaque\n // Postgres cast failure; Expression / ParamRef binds still defer to Postgres.\n const hierarchyOp = (\n method: string,\n operator: string,\n self: CodecExpression<typeof LTREE_CODEC_ID, boolean, CT>,\n other: CodecExpression<typeof LTREE_CODEC_ID, boolean, CT>,\n ): BoolReturn => {\n const selfCodec = codecOf(self);\n return buildOperation({\n method,\n args: [toExpr(self, selfCodec), toExpr(other, selfCodec)],\n returns: BOOL_RETURN,\n lowering: {\n targetFamily: \"sql\",\n template: `{{self}} ${operator} {{arg0}}`,\n },\n });\n };\n\n const patternOp = (\n method: string,\n operator: string,\n castType: \"lquery\" | \"ltxtquery\" | \"lquery[]\",\n self: CodecExpression<typeof LTREE_CODEC_ID, boolean, CT>,\n arg: unknown,\n many = false,\n ): BoolReturn => {\n assertPatternArg(castType, arg);\n const selfCodec = codecOf(self);\n return buildOperation({\n method,\n args: [\n toExpr(self, selfCodec),\n toExpr(arg, many ? { codecId: TEXT_CODEC_ID, many: true } : { codecId: TEXT_CODEC_ID }),\n ],\n returns: BOOL_RETURN,\n lowering: {\n targetFamily: \"sql\",\n template: `{{self}} ${operator} ({{arg0}})::${castType}`,\n },\n });\n };\n\n // Concatenation operators produce a new ltree. `concat` joins two ltree paths\n // (`{{self}} || {{arg0}}`); `concatText`/`prependText` splice a text label onto\n // the right/left. The text operand binds as `pg/text@1` and is cast in-template\n // (PG resolves the `||` overload from the cast). `prependText` places `{{self}}`\n // second because the ltree receiver is the RIGHT operand of `text || ltree`;\n // `args[0]` is still `self` (the renderer binds by placeholder name, not order).\n const concatOp = (\n method: string,\n template: string,\n args: readonly [AnyExpression, ...AnyExpression[]],\n ): LtreeReturn =>\n buildOperation({\n method,\n args,\n returns: LTREE_RETURN,\n lowering: { targetFamily: \"sql\", template },\n });\n\n // Boolean operators on an `ltree[]` receiver (ADR-007). Same bind/cast rules as\n // `firstMatchOp`, but the result is `boolean`. These are the operators\n // `gist__ltree_ops` indexes (`<@`, `~`, `@`, `?`), plus `@>` which PostgreSQL\n // ships and the opclass does not index.\n const arrayBoolOp = (\n method: string,\n operator: string,\n self: CodecExpression<typeof LTREE_ARRAY_CODEC_ID, boolean, CT>,\n arg: unknown,\n argCodecId: typeof LTREE_CODEC_ID | typeof TEXT_CODEC_ID,\n castType?: \"lquery\" | \"ltxtquery\" | \"lquery[]\",\n many = false,\n ): BoolReturn => {\n if (castType) assertPatternArg(castType, arg);\n const template = castType\n ? `{{self}} ${operator} ({{arg0}})::${castType}`\n : `{{self}} ${operator} {{arg0}}`;\n return buildOperation({\n method,\n args: [\n toExpr(self, codecOf(self)),\n toExpr(arg, many ? { codecId: argCodecId, many: true } : { codecId: argCodecId }),\n ],\n returns: BOOL_RETURN,\n lowering: { targetFamily: \"sql\", template },\n });\n };\n\n // Tier 3 — first-match operators on an `ltree[]` receiver (ADR-003).\n const firstMatchOp = (\n method: string,\n operator: string,\n self: CodecExpression<typeof LTREE_ARRAY_CODEC_ID, boolean, CT>,\n arg: unknown,\n argCodecId: typeof LTREE_CODEC_ID | typeof TEXT_CODEC_ID,\n castType?: \"lquery\" | \"ltxtquery\",\n ): LtreeReturn => {\n if (castType) assertPatternArg(castType, arg);\n const selfCodec = codecOf(self);\n const template = castType\n ? `{{self}} ${operator} ({{arg0}})::${castType}`\n : `{{self}} ${operator} {{arg0}}`;\n return buildOperation({\n method,\n args: [toExpr(self, selfCodec), toExpr(arg, { codecId: argCodecId })],\n returns: LTREE_RETURN,\n lowering: { targetFamily: \"sql\", template },\n });\n };\n\n return {\n isAncestorOf: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, other) => hierarchyOp(\"isAncestorOf\", \"@>\", self, other),\n },\n isDescendantOf: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, other) => hierarchyOp(\"isDescendantOf\", \"<@\", self, other),\n },\n matchesLquery: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, pattern) => patternOp(\"matchesLquery\", \"~\", \"lquery\", self, pattern),\n },\n matchesLqueryArray: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, patterns) =>\n patternOp(\"matchesLqueryArray\", \"?\", \"lquery[]\", self, patterns, true),\n },\n matchesLtxtquery: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, query) => patternOp(\"matchesLtxtquery\", \"@\", \"ltxtquery\", self, query),\n },\n nlevel: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self): IntReturn =>\n funcOp(\"nlevel\", \"nlevel\", INT_RETURN, [toExpr(self, codecOf(self))]),\n },\n subltree: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, start, end): LtreeReturn =>\n funcOp(\"subltree\", \"subltree\", LTREE_RETURN, [\n toExpr(self, codecOf(self)),\n toExpr(start, { codecId: INT_CODEC_ID }),\n toExpr(end, { codecId: INT_CODEC_ID }),\n ]),\n },\n // `subpath(self, offset, len?)` — `len` omitted lowers to the 2-arg overload.\n subpath: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, offset, len): LtreeReturn => {\n const head: readonly [AnyExpression, AnyExpression] = [\n toExpr(self, codecOf(self)),\n toExpr(offset, { codecId: INT_CODEC_ID }),\n ];\n return funcOp(\n \"subpath\",\n \"subpath\",\n LTREE_RETURN,\n len === undefined ? head : [...head, toExpr(len, { codecId: INT_CODEC_ID })],\n );\n },\n },\n // `index(self, other, offset?)` — `offset` omitted lowers to the 2-arg overload.\n indexOf: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, other, offset): IntReturn => {\n const selfCodec = codecOf(self);\n const head: readonly [AnyExpression, AnyExpression] = [\n toExpr(self, selfCodec),\n toExpr(other, selfCodec),\n ];\n return funcOp(\n \"indexOf\",\n \"index\",\n INT_RETURN,\n offset === undefined ? head : [...head, toExpr(offset, { codecId: INT_CODEC_ID })],\n );\n },\n },\n // `lca(self, other, ...rest)` — variadic longest-common-ancestor (ADR-001).\n // PostgreSQL has no single-arg `lca`, so `other` is required (2–8 paths).\n lca: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, other, ...rest): LtreeReturn => {\n const selfCodec = codecOf(self);\n return funcOp(\"lca\", \"lca\", LTREE_RETURN, [\n toExpr(self, selfCodec),\n toExpr(other, selfCodec),\n ...rest.map((p) => toExpr(p, selfCodec)),\n ]);\n },\n },\n // Tier 2 — concatenation (`||`).\n concat: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, other): LtreeReturn => {\n const selfCodec = codecOf(self);\n return concatOp(\"concat\", \"{{self}} || {{arg0}}\", [\n toExpr(self, selfCodec),\n toExpr(other, selfCodec),\n ]);\n },\n },\n concatText: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, label): LtreeReturn =>\n concatOp(\"concatText\", \"{{self}} || ({{arg0}})::text\", [\n toExpr(self, codecOf(self)),\n toExpr(label, { codecId: TEXT_CODEC_ID }),\n ]),\n },\n // `text || ltree` — the ltree receiver is the right operand (ADR-002).\n prependText: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, prefix): LtreeReturn =>\n concatOp(\"prependText\", \"({{arg0}})::text || {{self}}\", [\n toExpr(self, codecOf(self)),\n toExpr(prefix, { codecId: TEXT_CODEC_ID }),\n ]),\n },\n // Tier 2 — conversion.\n toText: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self): TextReturn =>\n funcOp(\"toText\", \"ltree2text\", TEXT_RETURN, [toExpr(self, codecOf(self))]),\n },\n // `text2ltree(text)` — rooted on `pg/text@1` (the only reachable form of the\n // free-function `text2ltree`; see ADR-002). Surfaces as `.toLtree()` on text.\n toLtree: {\n self: { codecId: TEXT_CODEC_ID },\n impl: (self): LtreeReturn =>\n funcOp(\"toLtree\", \"text2ltree\", LTREE_RETURN, [toExpr(self, codecOf(self))]),\n },\n // Tier 3 — array first-match operators (ADR-003).\n firstAncestorOf: {\n self: { codecId: LTREE_ARRAY_CODEC_ID },\n impl: (self, other) => firstMatchOp(\"firstAncestorOf\", \"?@>\", self, other, LTREE_CODEC_ID),\n },\n firstDescendantOf: {\n self: { codecId: LTREE_ARRAY_CODEC_ID },\n impl: (self, other) => firstMatchOp(\"firstDescendantOf\", \"?<@\", self, other, LTREE_CODEC_ID),\n },\n firstMatchLquery: {\n self: { codecId: LTREE_ARRAY_CODEC_ID },\n impl: (self, pattern) =>\n firstMatchOp(\"firstMatchLquery\", \"?~\", self, pattern, TEXT_CODEC_ID, \"lquery\"),\n },\n firstMatchLtxtquery: {\n self: { codecId: LTREE_ARRAY_CODEC_ID },\n impl: (self, query) =>\n firstMatchOp(\"firstMatchLtxtquery\", \"?@\", self, query, TEXT_CODEC_ID, \"ltxtquery\"),\n },\n // Boolean array operators (ADR-007). Distinct names from scalar methods because\n // the operation registry keys by name only. `containsDescendantOf`,\n // `matchesAnyLquery`, `matchesAnyLtxtquery`, and `matchesAnyLqueryArray` are\n // in `gist__ltree_ops`; `containsAncestorOf` is not.\n containsAncestorOf: {\n self: { codecId: LTREE_ARRAY_CODEC_ID },\n impl: (self, other) => arrayBoolOp(\"containsAncestorOf\", \"@>\", self, other, LTREE_CODEC_ID),\n },\n containsDescendantOf: {\n self: { codecId: LTREE_ARRAY_CODEC_ID },\n impl: (self, other) => arrayBoolOp(\"containsDescendantOf\", \"<@\", self, other, LTREE_CODEC_ID),\n },\n matchesAnyLquery: {\n self: { codecId: LTREE_ARRAY_CODEC_ID },\n impl: (self, pattern) =>\n arrayBoolOp(\"matchesAnyLquery\", \"~\", self, pattern, TEXT_CODEC_ID, \"lquery\"),\n },\n matchesAnyLqueryArray: {\n self: { codecId: LTREE_ARRAY_CODEC_ID },\n impl: (self, patterns) =>\n arrayBoolOp(\"matchesAnyLqueryArray\", \"?\", self, patterns, TEXT_CODEC_ID, \"lquery[]\", true),\n },\n matchesAnyLtxtquery: {\n self: { codecId: LTREE_ARRAY_CODEC_ID },\n impl: (self, query) =>\n arrayBoolOp(\"matchesAnyLtxtquery\", \"@\", self, query, TEXT_CODEC_ID, \"ltxtquery\"),\n },\n // `lca(ltree[])` — array-receiver form (ADR-001, ADR-005). Named `lcaAll`\n // because prisma-next keys operations by name only (`createOperationRegistry`\n // throws on a duplicate); `lca` is already the variadic scalar method on\n // `pg/ltree@1`. Declares `nullable: false` for parity with the Tier 3\n // first-match ops even though PG returns NULL for an empty/NULL `ltree[]`\n // (see the empty-array integration test) — a family-wide gap, not specific\n // to `lcaAll`.\n lcaAll: {\n self: { codecId: LTREE_ARRAY_CODEC_ID },\n impl: (self): LtreeReturn =>\n funcOp(\"lcaAll\", \"lca\", LTREE_RETURN, [toExpr(self, codecOf(self))]),\n },\n };\n}\n\nconst ltreePackMetaBase = {\n kind: \"extension\",\n id: \"ltree\",\n familyId: \"sql\",\n targetId: \"postgres\",\n version: \"0.1.0\",\n capabilities: {\n postgres: {\n \"ltree.path\": true,\n },\n },\n authoring: {\n type: ltreeAuthoringTypes,\n },\n dataTypes: ltreeDataTypes,\n types: {\n codecTypes: {\n codecDescriptors: Array.from(ltreeCodecRegistry.values()),\n import: {\n package: \"prisma-ltree/codec-types\",\n named: \"CodecTypes\",\n alias: \"LtreeTypes\",\n },\n typeImports: [\n {\n package: \"prisma-ltree/codec-types\",\n named: \"Ltree\",\n alias: \"Ltree\",\n },\n ],\n },\n queryOperationTypes: {\n import: {\n package: \"prisma-ltree/operation-types\",\n named: \"QueryOperationTypes\",\n alias: \"LtreeQueryOperationTypes\",\n },\n },\n },\n} as const;\n\nexport const ltreePackMeta: typeof ltreePackMetaBase & {\n readonly __codecTypes?: CodecTypes;\n} = ltreePackMetaBase;\n"],"mappings":";;;;;;;;;AAGA,MAAa,sBAAsB,EACjC,OAAO;CACL,OAAO;EACL,MAAM;EACN,UAAU;EACV,QAAQ,EACN,SAAS,eACX;CACF;CACA,YAAY;EACV,MAAM;EACN,UAAU;EACV,QAAQ,EACN,SAAS,qBACX;CACF;AACF,EACF;;;AClBA,MAAM,gBAAgB;AAEtB,SAAgB,iBAAiB,OAAyC;CACxE,IAAI,OAAO,UAAU,UACnB,MAAM,IAAI,MAAM,8BAA8B;CAEhD,IAAI,MAAM,WAAW,GACnB,MAAM,IAAI,MAAM,+BAA+B;CAEjD,MAAM,SAAS,MAAM,MAAM,GAAG;CAC9B,IAAI,OAAO,SAAA,OACT,MAAM,IAAI,MAAM,sCAAsC,OAAO,OAAO,QAAQ,kBAAkB;CAEhG,KAAK,MAAM,SAAS,QAAQ;EAC1B,IAAI,MAAM,WAAW,GACnB,MAAM,IAAI,MAAM,0CAA0C,MAAM,EAAE;EAEpE,IAAI,MAAM,SAAA,KACR,MAAM,IAAI,MACR,uCAAuC,MAAM,OAAO,QAAQ,wBAC9D;EAEF,IAAI,CAAC,cAAc,KAAK,KAAK,GAC3B,MAAM,IAAI,MACR,gBAAgB,MAAM,yEACxB;CAEJ;AACF;;;ACfA,MAAM,aAA6B,SAAS;CAC1C,IAAI,OAAO,SAAS,UAClB,OAAO,gBAAgB,eAAe,wBAAwB,IAAI;CAEpE,IAAI;EACF,iBAAiB,IAAI;CACvB,QAAQ;EACN,OAAO,gBAAgB,eAAe,6BAA6B,IAAI;CACzE;CACA,OAAO;AACT;AAEA,MAAa,gBAAgB,YAAY,eAAe;CACtD,MAAM;CACN,OAAO,CAAC;EAAE,MAAM;EAAS,SAAS;EAAM,SAAS;CAAK,CAAC;CACvD,OAAO,GACJ,OAAO,MAAM,UAAU,MAC1B;AACF,CAAC;AAED,MAA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ueryOperationTypes<CT extends CodecTypesBase> = SqlQueryOperationTypes<CT,
178
178
  readonly nullable: false;
179
179
  }>;
180
180
  };
181
+ readonly containsAncestorOf: {
182
+ readonly self: {
183
+ readonly codecId: "pg/ltree-array@1";
184
+ };
185
+ readonly impl: (self: CodecExpression<"pg/ltree-array@1", boolean, CT>, other: CodecExpression<"pg/ltree@1", boolean, CT>) => Expression<{
186
+ readonly codecId: "pg/bool@1";
187
+ readonly nullable: false;
188
+ }>;
189
+ };
190
+ readonly containsDescendantOf: {
191
+ readonly self: {
192
+ readonly codecId: "pg/ltree-array@1";
193
+ };
194
+ readonly impl: (self: CodecExpression<"pg/ltree-array@1", boolean, CT>, other: CodecExpression<"pg/ltree@1", boolean, CT>) => Expression<{
195
+ readonly codecId: "pg/bool@1";
196
+ readonly nullable: false;
197
+ }>;
198
+ };
199
+ readonly matchesAnyLquery: {
200
+ readonly self: {
201
+ readonly codecId: "pg/ltree-array@1";
202
+ };
203
+ readonly impl: (self: CodecExpression<"pg/ltree-array@1", boolean, CT>, pattern: CodecExpression<"pg/text@1", boolean, CT>) => Expression<{
204
+ readonly codecId: "pg/bool@1";
205
+ readonly nullable: false;
206
+ }>;
207
+ };
208
+ readonly matchesAnyLqueryArray: {
209
+ readonly self: {
210
+ readonly codecId: "pg/ltree-array@1";
211
+ };
212
+ readonly impl: (self: CodecExpression<"pg/ltree-array@1", boolean, CT>, patterns: CodecExpression<"pg/text-array@1", boolean, CT>) => Expression<{
213
+ readonly codecId: "pg/bool@1";
214
+ readonly nullable: false;
215
+ }>;
216
+ };
217
+ readonly matchesAnyLtxtquery: {
218
+ readonly self: {
219
+ readonly codecId: "pg/ltree-array@1";
220
+ };
221
+ readonly impl: (self: CodecExpression<"pg/ltree-array@1", boolean, CT>, query: CodecExpression<"pg/text@1", boolean, CT>) => Expression<{
222
+ readonly codecId: "pg/bool@1";
223
+ readonly nullable: false;
224
+ }>;
225
+ };
181
226
  readonly lcaAll: {
182
227
  readonly self: {
183
228
  readonly codecId: "pg/ltree-array@1";
@@ -190,4 +235,4 @@ type QueryOperationTypes<CT extends CodecTypesBase> = SqlQueryOperationTypes<CT,
190
235
  }>;
191
236
  //#endregion
192
237
  export { QueryOperationTypes as t };
193
- //# sourceMappingURL=operation-types-8su4lbK-.d.mts.map
238
+ //# sourceMappingURL=operation-types-DD-KyBms.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operation-types-8su4lbK-.d.mts","names":[],"sources":["../src/types/operation-types.ts"],"mappings":";;;;KAMK,cAAA,GAAiB,MAAM;EAAA,SAAoB,KAAA;EAAA,SAAyB,MAAA;AAAA;AAAA,KAE7D,mBAAA,YAA+B,cAAA,IAAkB,sBAAA,CAC3D,EAAA;EAAA,SAEW,YAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,wBAAuC,EAAA,GAC7C,KAAA,EAAO,eAAA,wBAAuC,EAAA,MAC3C,UAAA;MAAA,SAAsB,OAAA;MAAA,SAA+B,QAAA;IAAA;EAAA;EAAA,SAEnD,cAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,wBAAuC,EAAA,GAC7C,KAAA,EAAO,eAAA,wBAAuC,EAAA,MAC3C,UAAA;MAAA,SAAsB,OAAA;MAAA,SAA+B,QAAA;IAAA;EAAA;EAAA,SAKnD,aAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,wBAAuC,EAAA,GAC7C,OAAA,EAAS,eAAA,uBAAsC,EAAA,MAC5C,UAAA;MAAA,SAAsB,OAAA;MAAA,SAA+B,QAAA;IAAA;EAAA;EAAA,SAEnD,kBAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,wBAAuC,EAAA,GAC7C,QA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