prisma-ltree 0.2.3 → 0.4.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.
- package/README.md +85 -66
- package/dist/{codec-types-mZn-cIh9.d.mts → codec-types-ECy3aUGO.d.mts} +11 -24
- package/dist/codec-types-ECy3aUGO.d.mts.map +1 -0
- package/dist/codec-types.d.mts +1 -1
- package/dist/column-types.d.mts +1 -1
- package/dist/column-types.mjs.map +1 -1
- package/dist/control.d.mts +1 -1
- package/dist/control.mjs +14 -13
- package/dist/control.mjs.map +1 -1
- package/dist/{descriptor-meta-Ch66mRPL.mjs → descriptor-meta-D2gu1NKP.mjs} +20 -11
- package/dist/descriptor-meta-D2gu1NKP.mjs.map +1 -0
- package/dist/{operation-types-BFxNrlNL.d.mts → operation-types-8su4lbK-.d.mts} +3 -3
- package/dist/{operation-types-BFxNrlNL.d.mts.map → operation-types-8su4lbK-.d.mts.map} +1 -1
- package/dist/operation-types.d.mts +1 -1
- package/dist/pack.d.mts +2 -2
- package/dist/pack.d.mts.map +1 -1
- package/dist/pack.mjs +1 -1
- package/dist/runtime.d.mts +2 -2
- package/dist/runtime.mjs +1 -1
- package/dist/runtime.mjs.map +1 -1
- package/package.json +13 -23
- package/src/contract.d.ts +211 -13
- package/src/contract.json +6 -5
- package/src/contract.ts +1 -1
- package/src/core/authoring.ts +1 -1
- package/src/core/codecs.ts +24 -16
- package/src/core/descriptor-meta.ts +2 -2
- package/src/core/registry.ts +2 -2
- package/src/exports/column-types.ts +1 -1
- package/src/exports/control.ts +7 -7
- package/src/exports/runtime.ts +1 -1
- package/src/types/operation-types.ts +5 -2
- package/dist/codec-types-mZn-cIh9.d.mts.map +0 -1
- package/dist/descriptor-meta-Ch66mRPL.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
# prisma-ltree
|
|
2
2
|
|
|
3
|
-
A [Prisma
|
|
3
|
+
A [Prisma 8](https://www.prisma.io/docs/orm) extension pack for PostgreSQL’s
|
|
4
4
|
[`ltree`](https://www.postgresql.org/docs/current/ltree.html) hierarchical-tree data type.
|
|
5
5
|
|
|
6
6
|
Model category trees, org charts, taxonomies, and filesystem-like paths in Postgres and query
|
|
7
|
-
them with type-safe
|
|
8
|
-
pattern matching, path manipulation, and lowest-common-ancestor computation
|
|
7
|
+
them with type-safe operators: ancestor/descendant checks, `lquery`/`ltxtquery`
|
|
8
|
+
pattern matching, path manipulation, and lowest-common-ancestor computation, without dropping to
|
|
9
9
|
raw SQL.
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
13
|
-
- **`ltree` and `ltree[]` columns
|
|
14
|
-
- **Hierarchy operators
|
|
15
|
-
- **Pattern matching
|
|
16
|
-
- **Scalar functions
|
|
17
|
-
- **Concatenation & conversion
|
|
18
|
-
- **Array first-match
|
|
19
|
-
- **Baseline migration
|
|
13
|
+
- **`ltree` and `ltree[]` columns**: `ltree()` / `ltreeArray()` column helpers
|
|
14
|
+
- **Hierarchy operators**: ancestor and descendant checks
|
|
15
|
+
- **Pattern matching**: `lquery`, `lquery[]`, and `ltxtquery`
|
|
16
|
+
- **Scalar functions**: depth, subpaths, label index, lowest common ancestor
|
|
17
|
+
- **Concatenation & conversion**: path building and `ltree` ↔ `text` conversion
|
|
18
|
+
- **Array first-match**: find the first matching path in an `ltree[]` column
|
|
19
|
+
- **Baseline migration**: installs the Postgres extension via
|
|
20
20
|
`CREATE EXTENSION IF NOT EXISTS ltree` when the pack is composed
|
|
21
|
+
- **GiST indexes**: author `@@index([path], type: "gist")` (Prisma 8
|
|
22
|
+
postgres target; default `gist_ltree_ops`)
|
|
21
23
|
|
|
22
24
|
See the [feature support matrix](https://github.com/slovakian/prisma-ltree/blob/main/docs/feature-support.md)
|
|
23
25
|
for what is supported, planned, or out of scope.
|
|
@@ -28,8 +30,18 @@ for what is supported, planned, or out of scope.
|
|
|
28
30
|
pnpm add prisma-ltree
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
Requires Node `>=24
|
|
32
|
-
|
|
33
|
+
Requires Node `>=24`. This pack exact-pins `@prisma/orm-*` to **`8.0.0-rc.8`**.
|
|
34
|
+
`prisma-ltree` itself stays on independent `0.x` semver: install it with a caret.
|
|
35
|
+
You do not need `prisma-ltree@8.0.0-rc.8`. See
|
|
36
|
+
[versioning and compatibility](https://github.com/slovakian/prisma-ltree/blob/main/docs/prisma-next/versioning-and-compatibility.md).
|
|
37
|
+
|
|
38
|
+
Consumer apps also depend on the Postgres facade at the same SPI version, plus the
|
|
39
|
+
`prisma` CLI:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pnpm add @prisma/orm-postgres@8.0.0-rc.8 prisma-ltree
|
|
43
|
+
pnpm add -D prisma
|
|
44
|
+
```
|
|
33
45
|
|
|
34
46
|
### Agent skills (optional)
|
|
35
47
|
|
|
@@ -43,7 +55,7 @@ pnpm dlx skills add slovakian/prisma-ltree --all
|
|
|
43
55
|
## Database setup
|
|
44
56
|
|
|
45
57
|
The extension ships an on-disk baseline migration that installs `ltree` when the pack is composed
|
|
46
|
-
into an application. `prisma
|
|
58
|
+
into an application. `prisma db init` / `db update` apply it automatically. The equivalent
|
|
47
59
|
manual DDL is:
|
|
48
60
|
|
|
49
61
|
```sql
|
|
@@ -52,20 +64,18 @@ CREATE EXTENSION IF NOT EXISTS ltree;
|
|
|
52
64
|
|
|
53
65
|
## Configuration
|
|
54
66
|
|
|
55
|
-
Add the pack to your `prisma
|
|
67
|
+
Add the pack to your `prisma.config.ts`:
|
|
56
68
|
|
|
57
69
|
```typescript
|
|
58
|
-
import {
|
|
59
|
-
import
|
|
60
|
-
import sql from "@prisma-next/family-sql/control";
|
|
61
|
-
import postgres from "@prisma-next/target-postgres/control";
|
|
70
|
+
import { definePrismaConfig } from "prisma/config";
|
|
71
|
+
import { defineConfig as ormConfig } from "@prisma/orm-postgres/config";
|
|
62
72
|
import ltree from "prisma-ltree/control";
|
|
63
73
|
|
|
64
|
-
export default
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
74
|
+
export default definePrismaConfig({
|
|
75
|
+
orm: ormConfig({
|
|
76
|
+
contract: "./src/prisma/contract.ts",
|
|
77
|
+
extensions: [ltree],
|
|
78
|
+
}),
|
|
69
79
|
});
|
|
70
80
|
```
|
|
71
81
|
|
|
@@ -73,14 +83,14 @@ export default defineConfig({
|
|
|
73
83
|
|
|
74
84
|
### Contract definition
|
|
75
85
|
|
|
76
|
-
Author ltree columns in either lane
|
|
86
|
+
Author ltree columns in either lane: `contract.prisma` (PSL) or `contract.ts`
|
|
77
87
|
(TypeScript). Both emit a byte-identical compiled contract.
|
|
78
88
|
|
|
79
|
-
**PSL lane
|
|
80
|
-
`ltree` into `extensions` in `prisma
|
|
89
|
+
**PSL lane.** Reference the `ltree` namespace constructors (parens required) and compose
|
|
90
|
+
`ltree` into `extensions` in `prisma.config.ts`:
|
|
81
91
|
|
|
82
92
|
```prisma
|
|
83
|
-
// contract.prisma
|
|
93
|
+
// contract.prisma: use prisma
|
|
84
94
|
|
|
85
95
|
types {
|
|
86
96
|
Path = ltree.Ltree() // → pg/ltree@1 / ltree
|
|
@@ -96,65 +106,74 @@ model Page {
|
|
|
96
106
|
}
|
|
97
107
|
```
|
|
98
108
|
|
|
109
|
+
**GiST index** (recommended for ancestor / descendant / `lquery` queries):
|
|
110
|
+
|
|
111
|
+
```prisma
|
|
112
|
+
model Page {
|
|
113
|
+
id String @id @default(uuid())
|
|
114
|
+
path Path
|
|
115
|
+
|
|
116
|
+
@@index([path], type: "gist")
|
|
117
|
+
@@map("page")
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Prisma 8 registers `gist` on the postgres target. `prisma-ltree`
|
|
122
|
+
does not add a second index type. See the
|
|
123
|
+
[indexes guide](https://prisma-ltree.procka.org/docs/indexes) for TypeScript
|
|
124
|
+
authoring, `ltree[]`, and operator-class limits (`siglen` is not expressible).
|
|
125
|
+
|
|
99
126
|
**TypeScript lane**:
|
|
100
127
|
|
|
101
128
|
```typescript
|
|
102
|
-
import {
|
|
103
|
-
import sqlFamily from "@prisma-next/family-sql/pack";
|
|
104
|
-
import { defineContract, field, model } from "@prisma-next/sql-contract-ts/contract-builder";
|
|
129
|
+
import { defineContract } from "@prisma/orm-postgres/contract-builder";
|
|
105
130
|
import { ltree } from "prisma-ltree/column-types";
|
|
106
131
|
import ltreePack from "prisma-ltree/pack";
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
target: postgres,
|
|
112
|
-
extensionPacks: { ltree: ltreePack },
|
|
113
|
-
models: {
|
|
114
|
-
Category: model("Category", {
|
|
115
|
-
fields: {
|
|
116
|
-
id: field.column(int4Column).id(),
|
|
117
|
-
name: field.column(textColumn),
|
|
118
|
-
path: field.column(ltree()),
|
|
119
|
-
},
|
|
120
|
-
}).sql({ table: "category" }),
|
|
132
|
+
|
|
133
|
+
export const contract = defineContract(
|
|
134
|
+
{
|
|
135
|
+
extensions: { ltree: ltreePack },
|
|
121
136
|
},
|
|
122
|
-
})
|
|
137
|
+
({ field, model }) => ({
|
|
138
|
+
models: {
|
|
139
|
+
Category: model("Category", {
|
|
140
|
+
fields: {
|
|
141
|
+
id: field.id.int(),
|
|
142
|
+
name: field.string(),
|
|
143
|
+
path: field.column(ltree()),
|
|
144
|
+
},
|
|
145
|
+
}).sql({ table: "category" }),
|
|
146
|
+
},
|
|
147
|
+
}),
|
|
148
|
+
);
|
|
123
149
|
```
|
|
124
150
|
|
|
125
151
|
### Runtime setup
|
|
126
152
|
|
|
127
153
|
```typescript
|
|
128
|
-
import
|
|
129
|
-
import { createExecutionContext, createSqlExecutionStack } from "@prisma-next/sql-runtime";
|
|
130
|
-
import postgresAdapter from "@prisma-next/adapter-postgres/runtime";
|
|
131
|
-
import postgresTarget from "@prisma-next/target-postgres/runtime";
|
|
154
|
+
import postgres from "@prisma/orm-postgres/runtime";
|
|
132
155
|
import ltree from "prisma-ltree/runtime";
|
|
156
|
+
import type { Contract } from "./contract.d";
|
|
157
|
+
import contractJson from "./contract.json" with { type: "json" };
|
|
133
158
|
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
159
|
+
export const db = postgres<Contract>({
|
|
160
|
+
contractJson,
|
|
161
|
+
extensions: [ltree],
|
|
162
|
+
url: process.env.DATABASE_URL!,
|
|
138
163
|
});
|
|
139
|
-
const context = createExecutionContext({ contract, stack });
|
|
140
|
-
const stackInstance = instantiateExecutionStack(stack);
|
|
141
164
|
```
|
|
142
165
|
|
|
143
166
|
### Query usage
|
|
144
167
|
|
|
145
168
|
```typescript
|
|
146
|
-
import {
|
|
147
|
-
import { param } from "@prisma-next/sql-query/param";
|
|
169
|
+
import { db } from "../prisma/db";
|
|
148
170
|
|
|
149
171
|
// Find every descendant of "Top.Science"
|
|
150
|
-
const
|
|
151
|
-
.
|
|
152
|
-
|
|
153
|
-
id: tables.category.columns.id,
|
|
154
|
-
depth: tables.category.columns.path.nlevel(),
|
|
172
|
+
const rows = await db.orm.Category.where((c) => c.path.isDescendantOf("Top.Science"))
|
|
173
|
+
.select("id", {
|
|
174
|
+
depth: (c) => c.path.nlevel(),
|
|
155
175
|
})
|
|
156
|
-
.
|
|
157
|
-
.build({ params: { prefix: "Top.Science" } });
|
|
176
|
+
.all();
|
|
158
177
|
```
|
|
159
178
|
|
|
160
179
|
## Operations
|
|
@@ -211,10 +230,10 @@ const plan = sql
|
|
|
211
230
|
|
|
212
231
|
Use `ltreeArray()` for `ltree[]` columns that expose these methods.
|
|
213
232
|
|
|
214
|
-
`lcaAll` is the array form of `lca`. It is not named `lca` because
|
|
233
|
+
`lcaAll` is the array form of `lca`. It is not named `lca` because Prisma 8
|
|
215
234
|
keys operations by name only and rejects duplicates; scalar columns already
|
|
216
235
|
expose `path.lca(other, ...)` (see ADR-005). Note it returns SQL NULL for an
|
|
217
|
-
empty `ltree[]`, matching the first-match ops
|
|
236
|
+
empty `ltree[]`, matching the first-match ops’ `nullable: false` convention.
|
|
218
237
|
|
|
219
238
|
## Types
|
|
220
239
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { CodecCallContext,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { CodecCallContext, CodecImpl, CodecInstanceContext } from "@prisma/orm-framework/components/codec";
|
|
2
|
+
import { PostgresCodecDescriptor } from "@prisma/orm-target-postgres/target/codec-descriptor";
|
|
3
|
+
import { JsonValue } from "@prisma/orm-framework/contract/types";
|
|
4
|
+
import { ExtractCodecTypes, ProjectionExpr } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
6
|
|
|
6
7
|
//#region src/core/constants.d.ts
|
|
@@ -14,19 +15,12 @@ declare class LtreeCodec extends CodecImpl<typeof LTREE_CODEC_ID, readonly ["equ
|
|
|
14
15
|
encodeJson(value: string): JsonValue;
|
|
15
16
|
decodeJson(json: JsonValue): string;
|
|
16
17
|
}
|
|
17
|
-
declare class LtreeDescriptor extends
|
|
18
|
+
declare class LtreeDescriptor extends PostgresCodecDescriptor<void> {
|
|
19
|
+
protected nativeType(): string;
|
|
20
|
+
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
18
21
|
readonly codecId: "pg/ltree@1";
|
|
19
22
|
readonly traits: readonly ["equality", "order"];
|
|
20
23
|
readonly targetTypes: readonly ["ltree"];
|
|
21
|
-
readonly meta: {
|
|
22
|
-
readonly db: {
|
|
23
|
-
readonly sql: {
|
|
24
|
-
readonly postgres: {
|
|
25
|
-
readonly nativeType: "ltree";
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
24
|
readonly paramsSchema: StandardSchemaV1<void>;
|
|
31
25
|
renderOutputType(): string;
|
|
32
26
|
factory(): (ctx: CodecInstanceContext) => LtreeCodec;
|
|
@@ -37,19 +31,12 @@ declare class LtreeArrayCodec extends CodecImpl<typeof LTREE_ARRAY_CODEC_ID, rea
|
|
|
37
31
|
encodeJson(value: readonly string[]): JsonValue;
|
|
38
32
|
decodeJson(json: JsonValue): readonly string[];
|
|
39
33
|
}
|
|
40
|
-
declare class LtreeArrayDescriptor extends
|
|
34
|
+
declare class LtreeArrayDescriptor extends PostgresCodecDescriptor<void> {
|
|
35
|
+
protected nativeType(): string;
|
|
36
|
+
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
41
37
|
readonly codecId: "pg/ltree-array@1";
|
|
42
38
|
readonly traits: readonly ["equality"];
|
|
43
39
|
readonly targetTypes: readonly ["ltree[]"];
|
|
44
|
-
readonly meta: {
|
|
45
|
-
readonly db: {
|
|
46
|
-
readonly sql: {
|
|
47
|
-
readonly postgres: {
|
|
48
|
-
readonly nativeType: "ltree[]";
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
40
|
readonly paramsSchema: StandardSchemaV1<void>;
|
|
54
41
|
renderOutputType(): string;
|
|
55
42
|
factory(): (ctx: CodecInstanceContext) => LtreeArrayCodec;
|
|
@@ -70,4 +57,4 @@ type LtreeArray = readonly string[] & {
|
|
|
70
57
|
type CodecTypes = CodecTypes$1;
|
|
71
58
|
//#endregion
|
|
72
59
|
export { Ltree as n, LtreeArray as r, CodecTypes as t };
|
|
73
|
-
//# sourceMappingURL=codec-types-
|
|
60
|
+
//# sourceMappingURL=codec-types-ECy3aUGO.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-types-ECy3aUGO.d.mts","names":[],"sources":["../src/core/constants.ts","../src/core/codecs.ts","../src/types/codec-types.ts"],"mappings":";;;;;;;cAAa,cAAA;AAAA,cAEA,oBAAA;;;cCoDA,UAAA,SAAmB,SAAA,QACvB,cAAA;EAKD,MAAA,CAAO,KAAA,UAAe,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAK/C,MAAA,CAAO,IAAA,UAAc,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, t as CodecTypes } from "./codec-types-
|
|
1
|
+
import { n as Ltree, r as LtreeArray, t as CodecTypes } from "./codec-types-ECy3aUGO.mjs";
|
|
2
2
|
export type { CodecTypes, Ltree, LtreeArray };
|
package/dist/column-types.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-types.mjs","names":[],"sources":["../src/exports/column-types.ts"],"sourcesContent":["import type { ColumnTypeDescriptor } from \"@prisma-
|
|
1
|
+
{"version":3,"file":"column-types.mjs","names":[],"sources":["../src/exports/column-types.ts"],"sourcesContent":["import type { ColumnTypeDescriptor } from \"@prisma/orm-framework/components/codec\";\nimport { LTREE_ARRAY_CODEC_ID, LTREE_CODEC_ID } from \"../core/constants\";\nimport { LTREE_ARRAY_NATIVE_TYPE, LTREE_NATIVE_TYPE } from \"../core/contract-space-constants\";\n\nexport function ltree(): ColumnTypeDescriptor {\n return {\n codecId: LTREE_CODEC_ID,\n nativeType: LTREE_NATIVE_TYPE,\n } as const;\n}\n\nexport function ltreeArray(): ColumnTypeDescriptor {\n return {\n codecId: LTREE_ARRAY_CODEC_ID,\n nativeType: LTREE_ARRAY_NATIVE_TYPE,\n } as const;\n}\n"],"mappings":";;AAIA,SAAgB,QAA8B;CAC5C,OAAO;EACL,SAAS;EACT,YAAY;CACd;AACF;AAEA,SAAgB,aAAmC;CACjD,OAAO;EACL,SAAS;EACT,YAAY;CACd;AACF"}
|
package/dist/control.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SqlControlExtensionDescriptor } from "@prisma-
|
|
1
|
+
import { SqlControlExtensionDescriptor } from "@prisma/orm-family-sql/family/control";
|
|
2
2
|
|
|
3
3
|
//#region src/exports/control.d.ts
|
|
4
4
|
declare const ltreeExtensionDescriptor: SqlControlExtensionDescriptor<"postgres">;
|
package/dist/control.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { a as LTREE_ARRAY_CODEC_ID, i as LTREE_SPACE_ID, n as LTREE_BASELINE_MIGRATION_NAME, o as LTREE_CODEC_ID } from "./contract-space-constants-Da9EC668.mjs";
|
|
2
|
-
import { n as ltreeQueryOperations, t as ltreePackMeta } from "./descriptor-meta-
|
|
3
|
-
import { contractSpaceFromJson } from "@prisma-
|
|
4
|
-
//#region migrations/
|
|
2
|
+
import { n as ltreeQueryOperations, t as ltreePackMeta } from "./descriptor-meta-D2gu1NKP.mjs";
|
|
3
|
+
import { contractSpaceFromJson } from "@prisma/orm-toolchain/migration-tools/spaces";
|
|
4
|
+
//#region migrations/20260619T2142_install_ltree/migration.json
|
|
5
5
|
var migration_default = {
|
|
6
6
|
from: null,
|
|
7
|
-
to: "
|
|
7
|
+
to: "ca70941530ea2af306b38e95be66ab1deac79357bcfafb48302d07c8f2c9aa92",
|
|
8
8
|
providedInvariants: ["ltree:install-ltree-v1"],
|
|
9
9
|
createdAt: "2026-06-19T21:42:51.612Z",
|
|
10
|
-
migrationHash: "
|
|
10
|
+
migrationHash: "0a6e80c4164bc12d4e386a96b50e930db6332d220327dd771a63f2aa2e57c76b"
|
|
11
11
|
};
|
|
12
12
|
//#endregion
|
|
13
|
-
//#region migrations/
|
|
13
|
+
//#region migrations/20260619T2142_install_ltree/ops.json
|
|
14
14
|
var ops_default = [{
|
|
15
15
|
"id": "ltree.install-ltree-extension",
|
|
16
16
|
"label": "Enable extension \"ltree\"",
|
|
@@ -40,9 +40,9 @@ var ops_default = [{
|
|
|
40
40
|
}]
|
|
41
41
|
}];
|
|
42
42
|
//#endregion
|
|
43
|
-
//#region migrations/
|
|
43
|
+
//#region migrations/refs/head.json
|
|
44
44
|
var head_default = {
|
|
45
|
-
hash: "
|
|
45
|
+
hash: "ca70941530ea2af306b38e95be66ab1deac79357bcfafb48302d07c8f2c9aa92",
|
|
46
46
|
invariants: ["ltree:install-ltree-v1"]
|
|
47
47
|
};
|
|
48
48
|
//#endregion
|
|
@@ -51,7 +51,7 @@ var contract_default = {
|
|
|
51
51
|
schemaVersion: "1",
|
|
52
52
|
targetFamily: "sql",
|
|
53
53
|
target: "postgres",
|
|
54
|
-
profileHash: "
|
|
54
|
+
profileHash: "3916f444a8a17ad749191acf9e08dad97d1a327b88c2f1d45d12f240296aa8b2",
|
|
55
55
|
roots: {},
|
|
56
56
|
domain: { "namespaces": { "public": { "models": {} } } },
|
|
57
57
|
storage: {
|
|
@@ -60,7 +60,7 @@ var contract_default = {
|
|
|
60
60
|
"id": "public",
|
|
61
61
|
"kind": "postgres-schema"
|
|
62
62
|
} },
|
|
63
|
-
"storageHash": "
|
|
63
|
+
"storageHash": "ca70941530ea2af306b38e95be66ab1deac79357bcfafb48302d07c8f2c9aa92",
|
|
64
64
|
"types": {
|
|
65
65
|
"ltree": {
|
|
66
66
|
"codecId": "pg/ltree@1",
|
|
@@ -84,6 +84,7 @@ var contract_default = {
|
|
|
84
84
|
"returning": true
|
|
85
85
|
},
|
|
86
86
|
"sql": {
|
|
87
|
+
"checkConstraint": true,
|
|
87
88
|
"defaultInInsert": true,
|
|
88
89
|
"enums": true,
|
|
89
90
|
"lateral": true,
|
|
@@ -91,12 +92,12 @@ var contract_default = {
|
|
|
91
92
|
"scalarList": true
|
|
92
93
|
}
|
|
93
94
|
},
|
|
94
|
-
|
|
95
|
+
extensions: {},
|
|
95
96
|
meta: {},
|
|
96
97
|
_generated: {
|
|
97
98
|
"warning": "⚠️ GENERATED FILE - DO NOT EDIT",
|
|
98
|
-
"message": "This file is automatically generated by \"prisma
|
|
99
|
-
"regenerate": "To regenerate, run: prisma
|
|
99
|
+
"message": "This file is automatically generated by \"prisma contract emit\".",
|
|
100
|
+
"regenerate": "To regenerate, run: prisma contract emit"
|
|
100
101
|
}
|
|
101
102
|
};
|
|
102
103
|
//#endregion
|
package/dist/control.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.mjs","names":["baselineMetadata","baselineOps"],"sources":["../migrations/
|
|
1
|
+
{"version":3,"file":"control.mjs","names":["baselineMetadata","baselineOps"],"sources":["../migrations/20260619T2142_install_ltree/migration.json","../migrations/20260619T2142_install_ltree/ops.json","../migrations/refs/head.json","../src/contract.json","../src/exports/control.ts"],"sourcesContent":["","","","","import type { Contract } from \"@prisma/orm-framework/contract/types\";\nimport type {\n CodecControlHooks,\n SqlControlExtensionDescriptor,\n} from \"@prisma/orm-family-sql/family/control\";\nimport { contractSpaceFromJson } from \"@prisma/orm-toolchain/migration-tools/spaces\";\nimport type { SqlStorage } from \"@prisma/orm-family-sql/contract/types\";\nimport baselineMetadata from \"../../migrations/20260619T2142_install_ltree/migration.json\" with { type: \"json\" };\nimport baselineOps from \"../../migrations/20260619T2142_install_ltree/ops.json\" with { type: \"json\" };\nimport headRef from \"../../migrations/refs/head.json\" with { type: \"json\" };\nimport contractJson from \"../contract.json\" with { type: \"json\" };\nimport { LTREE_ARRAY_CODEC_ID, LTREE_CODEC_ID } from \"../core/constants\";\nimport { LTREE_SPACE_ID, LTREE_BASELINE_MIGRATION_NAME } from \"../core/contract-space-constants\";\nimport { ltreePackMeta, ltreeQueryOperations } from \"../core/descriptor-meta\";\n\nconst ltreeControlPlaneHooks: CodecControlHooks = {\n expandNativeType: ({ nativeType }) => nativeType,\n resolveIdentityValue: () => null,\n};\n\nconst ltreeContractSpace = contractSpaceFromJson<Contract<SqlStorage>>({\n contractJson,\n migrations: [\n {\n dirName: LTREE_BASELINE_MIGRATION_NAME,\n metadata: baselineMetadata,\n ops: baselineOps,\n },\n ],\n headRef,\n});\n\nconst ltreeExtensionDescriptor: SqlControlExtensionDescriptor<\"postgres\"> = {\n ...ltreePackMeta,\n id: LTREE_SPACE_ID,\n contractSpace: ltreeContractSpace,\n types: {\n ...ltreePackMeta.types,\n codecTypes: {\n ...ltreePackMeta.types.codecTypes,\n controlPlaneHooks: {\n [LTREE_CODEC_ID]: ltreeControlPlaneHooks,\n [LTREE_ARRAY_CODEC_ID]: ltreeControlPlaneHooks,\n },\n },\n },\n queryOperations: () => ltreeQueryOperations(),\n create: () => ({\n familyId: \"sql\" as const,\n targetId: \"postgres\" as const,\n }),\n};\n\nexport { ltreeExtensionDescriptor };\nexport default ltreeExtensionDescriptor;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AIeA,MAAM,yBAA4C;CAChD,mBAAmB,EAAE,iBAAiB;CACtC,4BAA4B;AAC9B;AAEA,MAAM,qBAAqB,sBAA4C;CACrE,cAAA;CACA,YAAY,CACV;EACE,SAAS;EACT,UAAUA;EACV,KAAKC;CACP,CACF;CACA,SAAA;AACF,CAAC;AAED,MAAM,2BAAsE;CAC1E,GAAG;CACH,IAAI;CACJ,eAAe;CACf,OAAO;EACL,GAAG,cAAc;EACjB,YAAY;GACV,GAAG,cAAc,MAAM;GACvB,mBAAmB;KAChB,iBAAiB;KACjB,uBAAuB;GAC1B;EACF;CACF;CACA,uBAAuB,qBAAqB;CAC5C,eAAe;EACb,UAAU;EACV,UAAU;CACZ;AACF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { a as LTREE_ARRAY_CODEC_ID, c as LTREE_MAX_LABEL_LENGTH, o as LTREE_CODEC_ID, r as LTREE_NATIVE_TYPE, s as LTREE_MAX_LABELS, t as LTREE_ARRAY_NATIVE_TYPE } from "./contract-space-constants-Da9EC668.mjs";
|
|
2
|
-
import { buildOperation, codecOf, toExpr } from "@prisma-
|
|
3
|
-
import { buildCodecDescriptorRegistry } from "@prisma-
|
|
4
|
-
import {
|
|
2
|
+
import { buildOperation, codecOf, toExpr } from "@prisma/orm-family-sql/relational-core/expression";
|
|
3
|
+
import { buildCodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/codec-descriptor-registry";
|
|
4
|
+
import { CodecImpl, voidParamsSchema } from "@prisma/orm-framework/components/codec";
|
|
5
|
+
import { PostgresCodecDescriptor, definePostgresCodecs } from "@prisma/orm-target-postgres/target/codec-descriptor";
|
|
5
6
|
//#region src/core/authoring.ts
|
|
6
7
|
const ltreeAuthoringTypes = { ltree: {
|
|
7
8
|
Ltree: {
|
|
@@ -50,12 +51,16 @@ var LtreeCodec = class extends CodecImpl {
|
|
|
50
51
|
return json;
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
var LtreeDescriptor = class extends PostgresCodecDescriptor {
|
|
55
|
+
nativeType() {
|
|
56
|
+
return LTREE_NATIVE_TYPE;
|
|
57
|
+
}
|
|
58
|
+
jsonProjection(expression) {
|
|
59
|
+
return expression;
|
|
60
|
+
}
|
|
55
61
|
codecId = LTREE_CODEC_ID;
|
|
56
62
|
traits = ["equality", "order"];
|
|
57
63
|
targetTypes = [LTREE_NATIVE_TYPE];
|
|
58
|
-
meta = LTREE_META;
|
|
59
64
|
paramsSchema = voidParamsSchema;
|
|
60
65
|
renderOutputType() {
|
|
61
66
|
return "string";
|
|
@@ -66,7 +71,6 @@ var LtreeDescriptor = class extends CodecDescriptorImpl {
|
|
|
66
71
|
}
|
|
67
72
|
};
|
|
68
73
|
const ltreeDescriptor = new LtreeDescriptor();
|
|
69
|
-
const LTREE_ARRAY_META = { db: { sql: { postgres: { nativeType: LTREE_ARRAY_NATIVE_TYPE } } } };
|
|
70
74
|
var LtreeArrayCodec = class extends CodecImpl {
|
|
71
75
|
async encode(value, _ctx) {
|
|
72
76
|
for (const entry of value) assertValidLtree(entry);
|
|
@@ -87,11 +91,16 @@ var LtreeArrayCodec = class extends CodecImpl {
|
|
|
87
91
|
});
|
|
88
92
|
}
|
|
89
93
|
};
|
|
90
|
-
var LtreeArrayDescriptor = class extends
|
|
94
|
+
var LtreeArrayDescriptor = class extends PostgresCodecDescriptor {
|
|
95
|
+
nativeType() {
|
|
96
|
+
return LTREE_ARRAY_NATIVE_TYPE;
|
|
97
|
+
}
|
|
98
|
+
jsonProjection(expression) {
|
|
99
|
+
return expression;
|
|
100
|
+
}
|
|
91
101
|
codecId = LTREE_ARRAY_CODEC_ID;
|
|
92
102
|
traits = ["equality"];
|
|
93
103
|
targetTypes = [LTREE_ARRAY_NATIVE_TYPE];
|
|
94
|
-
meta = LTREE_ARRAY_META;
|
|
95
104
|
paramsSchema = voidParamsSchema;
|
|
96
105
|
renderOutputType() {
|
|
97
106
|
return "readonly string[]";
|
|
@@ -107,7 +116,7 @@ const codecDescriptorMap = {
|
|
|
107
116
|
};
|
|
108
117
|
//#endregion
|
|
109
118
|
//#region src/core/registry.ts
|
|
110
|
-
const ltreeCodecRegistry = buildCodecDescriptorRegistry(Object.values(codecDescriptorMap));
|
|
119
|
+
const ltreeCodecRegistry = buildCodecDescriptorRegistry(definePostgresCodecs(Object.values(codecDescriptorMap)));
|
|
111
120
|
//#endregion
|
|
112
121
|
//#region src/core/descriptor-meta.ts
|
|
113
122
|
const BOOL_RETURN = {
|
|
@@ -346,4 +355,4 @@ const ltreePackMeta = {
|
|
|
346
355
|
//#endregion
|
|
347
356
|
export { ltreeQueryOperations as n, ltreeCodecRegistry as r, ltreePackMeta as t };
|
|
348
357
|
|
|
349
|
-
//# sourceMappingURL=descriptor-meta-
|
|
358
|
+
//# sourceMappingURL=descriptor-meta-D2gu1NKP.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor-meta-D2gu1NKP.mjs","names":[],"sources":["../src/core/authoring.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\";\nimport { LTREE_ARRAY_NATIVE_TYPE, LTREE_NATIVE_TYPE } from \"./contract-space-constants\";\n\nexport const ltreeAuthoringTypes = {\n ltree: {\n Ltree: {\n kind: \"typeConstructor\",\n output: {\n codecId: LTREE_CODEC_ID,\n nativeType: LTREE_NATIVE_TYPE,\n },\n },\n LtreeArray: {\n kind: \"typeConstructor\",\n output: {\n codecId: LTREE_ARRAY_CODEC_ID,\n nativeType: LTREE_ARRAY_NATIVE_TYPE,\n },\n },\n },\n} as const satisfies AuthoringTypeNamespace;\n","import type { JsonValue } from \"@prisma/orm-framework/contract/types\";\nimport {\n type CodecCallContext,\n CodecImpl,\n type CodecInstanceContext,\n type ColumnHelperFor,\n type ColumnHelperForStrict,\n column,\n voidParamsSchema,\n} from \"@prisma/orm-framework/components/codec\";\nimport type { ExtractCodecTypes, ProjectionExpr } from \"@prisma/orm-family-sql/relational-core/ast\";\nimport {\n definePostgresCodecs,\n PostgresCodecDescriptor,\n} from \"@prisma/orm-target-postgres/target/codec-descriptor\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport {\n LTREE_ARRAY_CODEC_ID,\n LTREE_CODEC_ID,\n LTREE_MAX_LABEL_LENGTH,\n LTREE_MAX_LABELS,\n} from \"./constants\";\nimport { LTREE_ARRAY_NATIVE_TYPE, LTREE_NATIVE_TYPE } from \"./contract-space-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\nexport class LtreeCodec extends CodecImpl<\n typeof LTREE_CODEC_ID,\n readonly [\"equality\", \"order\"],\n string,\n string\n> {\n async encode(value: string, _ctx: CodecCallContext): Promise<string> {\n assertValidLtree(value);\n return value;\n }\n\n async decode(wire: string, _ctx: CodecCallContext): Promise<string> {\n return wire;\n }\n\n encodeJson(value: string): JsonValue {\n assertValidLtree(value);\n return value;\n }\n\n decodeJson(json: JsonValue): string {\n assertValidLtree(json);\n return json;\n }\n}\n\nexport class LtreeDescriptor extends PostgresCodecDescriptor<void> {\n protected override nativeType(): string {\n return LTREE_NATIVE_TYPE;\n }\n protected override jsonProjection(expression: ProjectionExpr): ProjectionExpr {\n // ltree's text form is already its canonical JSON string.\n return expression;\n }\n override readonly codecId = LTREE_CODEC_ID;\n override readonly traits = [\"equality\", \"order\"] as const;\n override readonly targetTypes = [LTREE_NATIVE_TYPE] as const;\n override readonly paramsSchema: StandardSchemaV1<void> = voidParamsSchema;\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 = () =>\n column(ltreeDescriptor.factory(), ltreeDescriptor.codecId, undefined, LTREE_NATIVE_TYPE);\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 async encode(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 decode(wire: readonly string[], _ctx: CodecCallContext): Promise<readonly string[]> {\n return wire;\n }\n\n encodeJson(value: readonly string[]): JsonValue {\n for (const entry of value) {\n assertValidLtree(entry);\n }\n return [...value];\n }\n\n decodeJson(json: JsonValue): readonly string[] {\n if (!Array.isArray(json)) {\n return [];\n }\n return json.map((entry) => {\n assertValidLtree(entry);\n return String(entry);\n });\n }\n}\n\nexport class LtreeArrayDescriptor extends PostgresCodecDescriptor<void> {\n protected override nativeType(): string {\n return LTREE_ARRAY_NATIVE_TYPE;\n }\n protected override jsonProjection(expression: ProjectionExpr): ProjectionExpr {\n // ltree[] text form projects as a JSON string array already.\n return expression;\n }\n override readonly codecId = LTREE_ARRAY_CODEC_ID;\n override readonly traits = [\"equality\"] as const;\n override readonly targetTypes = [LTREE_ARRAY_NATIVE_TYPE] as const;\n override readonly paramsSchema: StandardSchemaV1<void> = voidParamsSchema;\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(\n ltreeArrayDescriptor.factory(),\n ltreeArrayDescriptor.codecId,\n undefined,\n LTREE_ARRAY_NATIVE_TYPE,\n );\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 { LTREE_ARRAY_NATIVE_TYPE, LTREE_NATIVE_TYPE } from \"./contract-space-constants\";\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 TEXT_ARRAY_CODEC_ID = \"pg/text-array@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 strategy: \"function\",\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` (the validated-string-param\n // approach; verified executable under PGlite).\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 strategy: \"function\",\n template: `{{self}} ${operator} {{arg0}}`,\n },\n });\n };\n\n const patternOp = (\n method: string,\n operator: string,\n castType: string,\n argCodecId: typeof TEXT_CODEC_ID | typeof TEXT_ARRAY_CODEC_ID,\n self: CodecExpression<typeof LTREE_CODEC_ID, boolean, CT>,\n arg: unknown,\n ): BoolReturn => {\n const selfCodec = codecOf(self);\n return buildOperation({\n method,\n args: [toExpr(self, selfCodec), toExpr(arg, { codecId: argCodecId })],\n returns: BOOL_RETURN,\n lowering: {\n targetFamily: \"sql\",\n strategy: \"function\",\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\", strategy: \"function\", template },\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?: string,\n ): LtreeReturn => {\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\", strategy: \"function\", 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) =>\n patternOp(\"matchesLquery\", \"~\", \"lquery\", TEXT_CODEC_ID, self, pattern),\n },\n matchesLqueryArray: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, patterns) =>\n patternOp(\"matchesLqueryArray\", \"?\", \"lquery[]\", TEXT_ARRAY_CODEC_ID, self, patterns),\n },\n matchesLtxtquery: {\n self: { codecId: LTREE_CODEC_ID },\n impl: (self, query) =>\n patternOp(\"matchesLtxtquery\", \"@\", \"ltxtquery\", TEXT_CODEC_ID, 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 // `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 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 storage: [\n {\n typeId: LTREE_CODEC_ID,\n familyId: \"sql\",\n targetId: \"postgres\",\n nativeType: LTREE_NATIVE_TYPE,\n },\n {\n typeId: LTREE_ARRAY_CODEC_ID,\n familyId: \"sql\",\n targetId: \"postgres\",\n nativeType: LTREE_ARRAY_NATIVE_TYPE,\n },\n ],\n },\n} as const;\n\nexport const ltreePackMeta: typeof ltreePackMetaBase & {\n readonly __codecTypes?: CodecTypes;\n} = ltreePackMetaBase;\n"],"mappings":";;;;;;AAIA,MAAa,sBAAsB,EACjC,OAAO;CACL,OAA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;GACR,UAAU;GACV,UAAU;GACV,YAAY;EACd,GACA;GACE,QAAQ;GACR,UAAU;GACV,UAAU;GACV,YAAY;EACd,CACF;CACF;AAKE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CodecExpression, Expression } from "@prisma-
|
|
2
|
-
import { SqlQueryOperationTypes } from "@prisma-
|
|
1
|
+
import { CodecExpression, Expression } from "@prisma/orm-family-sql/relational-core/expression";
|
|
2
|
+
import { SqlQueryOperationTypes } from "@prisma/orm-family-sql/contract/types";
|
|
3
3
|
|
|
4
4
|
//#region src/types/operation-types.d.ts
|
|
5
5
|
type CodecTypesBase = Record<string, {
|
|
@@ -190,4 +190,4 @@ type QueryOperationTypes<CT extends CodecTypesBase> = SqlQueryOperationTypes<CT,
|
|
|
190
190
|
}>;
|
|
191
191
|
//#endregion
|
|
192
192
|
export { QueryOperationTypes as t };
|
|
193
|
-
//# sourceMappingURL=operation-types-
|
|
193
|
+
//# sourceMappingURL=operation-types-8su4lbK-.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-types-
|
|
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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A;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,8BAA6C,EAAA,GACnD,KAAA,EAAO,eAAA,uBAAsC,EAAA,MAC1C,UAAA;MAAA,SAAsB,OAAA;MAAA,SAAgC,QAAA;IAAA;EAAA;EAAA,SAMpD,MAAA;IAAA,SACE,IAAA;MAAA,SAAiB,OAAA;IAAA;IAAA,SACjB,IAAA,GACP,IAAA,EAAM,eAAA,8BAA6C,EAAA,MAChD,UAAA;MAAA,SAAsB,OAAA;MAAA,SAAgC,QAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as QueryOperationTypes } from "./operation-types-
|
|
1
|
+
import { t as QueryOperationTypes } from "./operation-types-8su4lbK-.mjs";
|
|
2
2
|
export type { QueryOperationTypes };
|
package/dist/pack.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CodecTypes } from "./codec-types-
|
|
1
|
+
import { t as CodecTypes } from "./codec-types-ECy3aUGO.mjs";
|
|
2
2
|
//#region src/core/descriptor-meta.d.ts
|
|
3
3
|
declare const ltreePackMetaBase: {
|
|
4
4
|
readonly kind: "extension";
|
|
@@ -33,7 +33,7 @@ declare const ltreePackMetaBase: {
|
|
|
33
33
|
};
|
|
34
34
|
readonly types: {
|
|
35
35
|
readonly codecTypes: {
|
|
36
|
-
readonly codecDescriptors: import("@prisma-
|
|
36
|
+
readonly codecDescriptors: import("@prisma/orm-framework/components/codec").CodecDescriptor<unknown>[];
|
|
37
37
|
readonly import: {
|
|
38
38
|
readonly package: "prisma-ltree/codec-types";
|
|
39
39
|
readonly named: "CodecTypes";
|
package/dist/pack.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack.d.mts","names":[],"sources":["../src/core/descriptor-meta.ts"],"mappings":";;cA6SM,iBAAA;EAAA,SACJ,IAAA;EAAA,SACA,EAAA;EAAA,SACA,QAAA;EAAA,SACA,QAAA;EAAA,SACA,OAAA;EAAA,SACA,YAAA;IAAA,SACE,QAAA;MAAA,SACE,YAAA;IAAA;EAAA;EAAA,SAGJ,SAAA;IAAA,SACE,IAAA;MAAA;;;;;;;;;;;;;;;;;;WAEF,KAAA;IAAA,SACE,UAAA;MAAA,SACE,gBAAA,
|
|
1
|
+
{"version":3,"file":"pack.d.mts","names":[],"sources":["../src/core/descriptor-meta.ts"],"mappings":";;cA6SM,iBAAA;EAAA,SACJ,IAAA;EAAA,SACA,EAAA;EAAA,SACA,QAAA;EAAA,SACA,QAAA;EAAA,SACA,OAAA;EAAA,SACA,YAAA;IAAA,SACE,QAAA;MAAA,SACE,YAAA;IAAA;EAAA;EAAA,SAGJ,SAAA;IAAA,SACE,IAAA;MAAA;;;;;;;;;;;;;;;;;;WAEF,KAAA;IAAA,SACE,UAAA;MAAA,SACE,gBAAA,mDAAgB,eAAA;MAAA,SAChB,MAAA;QAAA,SACE,OAAA;QAAA,SACA,KAAA;QAAA,SACA,KAAA;MAAA;MAAA,SAEF,WAAA;QAAA,SAEI,OAAA;QAAA,SACA,KAAA;QAAA,SACA,KAAA;MAAA;IAAA;IAAA,SAIN,mBAAA;MAAA,SACE,MAAA;QAAA,SACE,OAAA;QAAA,SACA,KAAA;QAAA,SACA,KAAA;MAAA;IAAA;IAAA,SAGJ,OAAA;MAAA,SAEI,MAAA;MAAA,SACA,QAAA;MAAA,SACA,QAAA;MAAA,SACA,UAAA;IAAA;MAAA,SAGA,MAAA;MAAA,SACA,QAAA;MAAA,SACA,QAAA;MAAA,SACA,UAAA;IAAA;EAAA;AAAA;AAAA,cAMK,aAAA,SAAsB,iBAAA;EAAA,SACxB,YAAA,GAAe,UAAU;AAAA"}
|