prisma-ltree 0.2.3 → 0.3.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 CHANGED
@@ -28,9 +28,15 @@ for what is supported, planned, or out of scope.
28
28
  pnpm add prisma-ltree
29
29
  ```
30
30
 
31
- Requires Node `>=24` and `@prisma-next/*@0.14.0` (exact pin — see
31
+ Requires Node `>=24` and Prisma Next **`8.0.0-rc.1`** (exact `@prisma/orm-*` pins — see
32
32
  [versioning & compatibility](https://github.com/slovakian/prisma-ltree/blob/main/docs/prisma-next/versioning-and-compatibility.md)).
33
33
 
34
+ Consumer apps typically depend on the Postgres facade at the same version:
35
+
36
+ ```bash
37
+ pnpm add @prisma/orm-postgres@8.0.0-rc.1 prisma-ltree
38
+ ```
39
+
34
40
  ### Agent skills (optional)
35
41
 
36
42
  Agent skills for adoption and query patterns ship in the repo under
@@ -55,17 +61,12 @@ CREATE EXTENSION IF NOT EXISTS ltree;
55
61
  Add the pack to your `prisma-next.config.ts`:
56
62
 
57
63
  ```typescript
58
- import { defineConfig } from "@prisma-next/cli/config-types";
59
- import postgresAdapter from "@prisma-next/adapter-postgres/control";
60
- import sql from "@prisma-next/family-sql/control";
61
- import postgres from "@prisma-next/target-postgres/control";
64
+ import { defineConfig } from "@prisma/orm-postgres/config";
62
65
  import ltree from "prisma-ltree/control";
63
66
 
64
67
  export default defineConfig({
65
- family: sql,
66
- target: postgres,
67
- adapter: postgresAdapter,
68
- extensionPacks: [ltree],
68
+ contract: "./src/prisma/contract.ts",
69
+ extensions: [ltree],
69
70
  });
70
71
  ```
71
72
 
@@ -99,62 +100,54 @@ model Page {
99
100
  **TypeScript lane**:
100
101
 
101
102
  ```typescript
102
- import { int4Column, textColumn } from "@prisma-next/adapter-postgres/column-types";
103
- import sqlFamily from "@prisma-next/family-sql/pack";
104
- import { defineContract, field, model } from "@prisma-next/sql-contract-ts/contract-builder";
103
+ import { defineContract } from "@prisma/orm-postgres/contract-builder";
105
104
  import { ltree } from "prisma-ltree/column-types";
106
105
  import ltreePack from "prisma-ltree/pack";
107
- import postgres from "@prisma-next/target-postgres/pack";
108
-
109
- export const contract = defineContract({
110
- family: sqlFamily,
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" }),
106
+
107
+ export const contract = defineContract(
108
+ {
109
+ extensions: { ltree: ltreePack },
121
110
  },
122
- });
111
+ ({ field, model }) => ({
112
+ models: {
113
+ Category: model("Category", {
114
+ fields: {
115
+ id: field.id.int(),
116
+ name: field.string(),
117
+ path: field.column(ltree()),
118
+ },
119
+ }).sql({ table: "category" }),
120
+ },
121
+ }),
122
+ );
123
123
  ```
124
124
 
125
125
  ### Runtime setup
126
126
 
127
127
  ```typescript
128
- import { instantiateExecutionStack } from "@prisma-next/framework-components/execution";
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";
128
+ import postgres from "@prisma/orm-postgres/runtime";
132
129
  import ltree from "prisma-ltree/runtime";
130
+ import type { Contract } from "./contract.d";
131
+ import contractJson from "./contract.json" with { type: "json" };
133
132
 
134
- const stack = createSqlExecutionStack({
135
- target: postgresTarget,
136
- adapter: postgresAdapter,
137
- extensionPacks: [ltree],
133
+ export const db = postgres<Contract>({
134
+ contractJson,
135
+ extensions: [ltree],
136
+ url: process.env.DATABASE_URL!,
138
137
  });
139
- const context = createExecutionContext({ contract, stack });
140
- const stackInstance = instantiateExecutionStack(stack);
141
138
  ```
142
139
 
143
140
  ### Query usage
144
141
 
145
142
  ```typescript
146
- import { sql, tables } from "../prisma/query";
147
- import { param } from "@prisma-next/sql-query/param";
143
+ import { db } from "../prisma/db";
148
144
 
149
145
  // Find every descendant of "Top.Science"
150
- const plan = sql
151
- .from(tables.category)
152
- .select({
153
- id: tables.category.columns.id,
154
- depth: tables.category.columns.path.nlevel(),
146
+ const rows = await db.orm.Category.where((c) => c.path.isDescendantOf("Top.Science"))
147
+ .select("id", {
148
+ depth: (c) => c.path.nlevel(),
155
149
  })
156
- .where(tables.category.columns.path.isDescendantOf(param("prefix")))
157
- .build({ params: { prefix: "Top.Science" } });
150
+ .all();
158
151
  ```
159
152
 
160
153
  ## Operations
@@ -1,6 +1,7 @@
1
- import { CodecCallContext, CodecDescriptorImpl, CodecImpl, CodecInstanceContext } from "@prisma-next/framework-components/codec";
2
- import { JsonValue } from "@prisma-next/contract/types";
3
- import { ExtractCodecTypes } from "@prisma-next/sql-relational-core/ast";
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 CodecDescriptorImpl<void> {
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 CodecDescriptorImpl<void> {
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-mZn-cIh9.d.mts.map
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,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAIpD,UAAA,CAAW,KAAA,WAAgB,SAAA;EAK3B,UAAA,CAAW,IAAA,EAAM,SAAA;AAAA;AAAA,cAMN,eAAA,SAAwB,uBAAA;EAAA,UAChB,UAAA;EAAA,UAGA,cAAA,CAAe,UAAA,EAAY,cAAA,GAAiB,cAAA;EAAA,SAI7C,OAAA;EAAA,SACA,MAAA;EAAA,SACA,WAAA;EAAA,SACA,YAAA,EAAc,gBAAA;EACvB,gBAAA;EAGA,OAAA,KAAY,GAAA,EAAK,oBAAA,KAAyB,UAAA;AAAA;AAAA,cAcxC,eAAA,SAAwB,SAAA,QAC5B,oBAAA;EAKD,MAAA,CAAO,KAAA,qBAA0B,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAO1D,MAAA,CAAO,IAAA,qBAAyB,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAI/D,UAAA,CAAW,KAAA,sBAA2B,SAAA;EAOtC,UAAA,CAAW,IAAA,EAAM,SAAA;AAAA;AAAA,cAWN,oBAAA,SAA6B,uBAAA;EAAA,UACrB,UAAA;EAAA,UAGA,cAAA,CAAe,UAAA,EAAY,cAAA,GAAiB,cAAA;EAAA,SAI7C,OAAA;EAAA,SACA,MAAA;EAAA,SACA,WAAA;EAAA,SACA,YAAA,EAAc,gBAAA;EACvB,gBAAA;EAGA,OAAA,KAAY,GAAA,EAAK,oBAAA,KAAyB,eAAA;AAAA;AAAA,cAmB/C,kBAAA;EAAA,SACJ,KAAA,EAAK,eAAA;EAAA,SACL,UAAA,EAAU,oBAAA;AAAA;AAAA,KAGA,YAAA,GAAa,iBAAiB,QAAQ,kBAAA;;;KCrLtC,KAAA;EAAA,SAA4B,OAAO;AAAA;AAAA,KAEnC,UAAA;EAAA,SAA4C,YAAY;AAAA;AAAA,KAExD,UAAA,GAAa,YAAc"}
@@ -1,2 +1,2 @@
1
- import { n as Ltree, r as LtreeArray, t as CodecTypes } from "./codec-types-mZn-cIh9.mjs";
1
+ import { n as Ltree, r as LtreeArray, t as CodecTypes } from "./codec-types-ECy3aUGO.mjs";
2
2
  export type { CodecTypes, Ltree, LtreeArray };
@@ -1,4 +1,4 @@
1
- import { ColumnTypeDescriptor } from "@prisma-next/framework-components/codec";
1
+ import { ColumnTypeDescriptor } from "@prisma/orm-framework/components/codec";
2
2
 
3
3
  //#region src/exports/column-types.d.ts
4
4
  declare function ltree(): ColumnTypeDescriptor;
@@ -1 +1 @@
1
- {"version":3,"file":"column-types.mjs","names":[],"sources":["../src/exports/column-types.ts"],"sourcesContent":["import type { ColumnTypeDescriptor } from \"@prisma-next/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"}
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"}
@@ -1,4 +1,4 @@
1
- import { SqlControlExtensionDescriptor } from "@prisma-next/family-sql/control";
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-Ch66mRPL.mjs";
3
- import { contractSpaceFromJson } from "@prisma-next/migration-tools/spaces";
4
- //#region migrations/app/20260619T2142_install_ltree/migration.json
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: "sha256:81cc0a29674d926c9089886b1941ba66d6ce26ec5644fc8a0b7c92a5e9e9876e",
7
+ to: "ca70941530ea2af306b38e95be66ab1deac79357bcfafb48302d07c8f2c9aa92",
8
8
  providedInvariants: ["ltree:install-ltree-v1"],
9
9
  createdAt: "2026-06-19T21:42:51.612Z",
10
- migrationHash: "sha256:12135607df23ecea31aaf9e402703096cfcb236abf9e48a6797de2e74208700a"
10
+ migrationHash: "0a6e80c4164bc12d4e386a96b50e930db6332d220327dd771a63f2aa2e57c76b"
11
11
  };
12
12
  //#endregion
13
- //#region migrations/app/20260619T2142_install_ltree/ops.json
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/app/refs/head.json
43
+ //#region migrations/refs/head.json
44
44
  var head_default = {
45
- hash: "sha256:81cc0a29674d926c9089886b1941ba66d6ce26ec5644fc8a0b7c92a5e9e9876e",
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: "sha256:9c8aa3114e84ed3b7ea2bd57526d9c2e1bf7c5292be694e9d3801f566fda7ccb",
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": "sha256:81cc0a29674d926c9089886b1941ba66d6ce26ec5644fc8a0b7c92a5e9e9876e",
63
+ "storageHash": "ca70941530ea2af306b38e95be66ab1deac79357bcfafb48302d07c8f2c9aa92",
64
64
  "types": {
65
65
  "ltree": {
66
66
  "codecId": "pg/ltree@1",
@@ -91,7 +91,7 @@ var contract_default = {
91
91
  "scalarList": true
92
92
  }
93
93
  },
94
- extensionPacks: {},
94
+ extensions: {},
95
95
  meta: {},
96
96
  _generated: {
97
97
  "warning": "⚠️ GENERATED FILE - DO NOT EDIT",
@@ -1 +1 @@
1
- {"version":3,"file":"control.mjs","names":["baselineMetadata","baselineOps"],"sources":["../migrations/app/20260619T2142_install_ltree/migration.json","../migrations/app/20260619T2142_install_ltree/ops.json","../migrations/app/refs/head.json","../src/contract.json","../src/exports/control.ts"],"sourcesContent":["","","","","import type { Contract } from \"@prisma-next/contract/types\";\nimport type {\n CodecControlHooks,\n SqlControlExtensionDescriptor,\n} from \"@prisma-next/family-sql/control\";\nimport { contractSpaceFromJson } from \"@prisma-next/migration-tools/spaces\";\nimport type { SqlStorage } from \"@prisma-next/sql-contract/types\";\nimport baselineMetadata from \"../../migrations/app/20260619T2142_install_ltree/migration.json\" with { type: \"json\" };\nimport baselineOps from \"../../migrations/app/20260619T2142_install_ltree/ops.json\" with { type: \"json\" };\nimport headRef from \"../../migrations/app/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
+ {"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-next/sql-relational-core/expression";
3
- import { buildCodecDescriptorRegistry } from "@prisma-next/sql-relational-core/codec-descriptor-registry";
4
- import { CodecDescriptorImpl, CodecImpl, voidParamsSchema } from "@prisma-next/framework-components/codec";
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
- const LTREE_META = { db: { sql: { postgres: { nativeType: LTREE_NATIVE_TYPE } } } };
54
- var LtreeDescriptor = class extends CodecDescriptorImpl {
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 CodecDescriptorImpl {
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-Ch66mRPL.mjs.map
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,OAAO;EACL,MAAM;EACN,QAAQ;GACN,SAAS;GACT,YAAY;EACd;CACF;CACA,YAAY;EACV,MAAM;EACN,QAAQ;GACN,SAAS;GACT,YAAY;EACd;CACF;AACF,EACF;;;ACGA,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;AAEA,IAAa,aAAb,cAAgC,UAK9B;CACA,MAAM,OAAO,OAAe,MAAyC;EACnE,iBAAiB,KAAK;EACtB,OAAO;CACT;CAEA,MAAM,OAAO,MAAc,MAAyC;EAClE,OAAO;CACT;CAEA,WAAW,OAA0B;EACnC,iBAAiB,KAAK;EACtB,OAA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EACZ,UAAU,EACR,cAAc,KAChB,EACF;CACA,WAAW,EACT,MAAM,oBACR;CACA,OAAO;EACL,YAAY;GACV,kBAAkB,MAAM,KAAK,mBAAmB,OAAO,CAAC;GACxD,QAAQ;IACN,SAAS;IACT,OAAO;IACP,OAAO;GACT;GACA,aAAa,CACX;IACE,SAAS;IACT,OAAO;IACP,OAAO;GACT,CACF;EACF;EACA,qBAAqB,EACnB,QAAQ;GACN,SAAS;GACT,OAAO;GACP,OAAO;EACT,EACF;EACA,SAAS,CACP;GACE,QAAQ;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-next/sql-relational-core/expression";
2
- import { SqlQueryOperationTypes } from "@prisma-next/sql-contract/types";
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-BFxNrlNL.d.mts.map
193
+ //# sourceMappingURL=operation-types-8su4lbK-.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operation-types-BFxNrlNL.d.mts","names":[],"sources":["../src/types/operation-types.ts"],"mappings":";;;;KAGK,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,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A,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-BFxNrlNL.mjs";
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-mZn-cIh9.mjs";
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-next/framework-components/codec").CodecDescriptor<unknown>[];
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";
@@ -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;;;;;;;;;;;;;;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A;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"}
package/dist/pack.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as ltreePackMeta } from "./descriptor-meta-Ch66mRPL.mjs";
1
+ import { t as ltreePackMeta } from "./descriptor-meta-D2gu1NKP.mjs";
2
2
  export { ltreePackMeta as default };
@@ -1,5 +1,5 @@
1
- import { SqlRuntimeExtensionDescriptor } from "@prisma-next/sql-runtime";
2
- import { CodecDescriptorRegistry } from "@prisma-next/sql-relational-core/query-lane-context";
1
+ import { SqlRuntimeExtensionDescriptor } from "@prisma/orm-family-sql/runtime";
2
+ import { CodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/query-lane-context";
3
3
 
4
4
  //#region src/core/registry.d.ts
5
5
  declare const ltreeCodecRegistry: CodecDescriptorRegistry;
package/dist/runtime.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ltreeQueryOperations, r as ltreeCodecRegistry, t as ltreePackMeta } from "./descriptor-meta-Ch66mRPL.mjs";
1
+ import { n as ltreeQueryOperations, r as ltreeCodecRegistry, t as ltreePackMeta } from "./descriptor-meta-D2gu1NKP.mjs";
2
2
  //#region src/exports/runtime.ts
3
3
  const ltreeRuntimeDescriptor = {
4
4
  kind: "extension",
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.mjs","names":[],"sources":["../src/exports/runtime.ts"],"sourcesContent":["import type { SqlRuntimeExtensionDescriptor } from \"@prisma-next/sql-runtime\";\nimport { ltreePackMeta, ltreeQueryOperations } from \"../core/descriptor-meta\";\nimport { ltreeCodecRegistry } from \"../core/registry\";\n\nconst ltreeRuntimeDescriptor: SqlRuntimeExtensionDescriptor<\"postgres\"> = {\n kind: \"extension\" as const,\n id: ltreePackMeta.id,\n version: ltreePackMeta.version,\n familyId: \"sql\" as const,\n targetId: \"postgres\" as const,\n types: {\n codecTypes: {\n codecDescriptors: Array.from(ltreeCodecRegistry.values()),\n },\n },\n codecs: () => Array.from(ltreeCodecRegistry.values()),\n queryOperations: () => ltreeQueryOperations(),\n create() {\n return {\n familyId: \"sql\" as const,\n targetId: \"postgres\" as const,\n };\n },\n};\n\nexport { ltreeCodecRegistry };\nexport default ltreeRuntimeDescriptor;\n"],"mappings":";;AAIA,MAAM,yBAAoE;CACxE,MAAM;CACN,IAAI,cAAc;CAClB,SAAS,cAAc;CACvB,UAAU;CACV,UAAU;CACV,OAAO,EACL,YAAY,EACV,kBAAkB,MAAM,KAAK,mBAAmB,OAAO,CAAC,EAC1D,EACF;CACA,cAAc,MAAM,KAAK,mBAAmB,OAAO,CAAC;CACpD,uBAAuB,qBAAqB;CAC5C,SAAS;EACP,OAAO;GACL,UAAU;GACV,UAAU;EACZ;CACF;AACF"}
1
+ {"version":3,"file":"runtime.mjs","names":[],"sources":["../src/exports/runtime.ts"],"sourcesContent":["import type { SqlRuntimeExtensionDescriptor } from \"@prisma/orm-family-sql/runtime\";\nimport { ltreePackMeta, ltreeQueryOperations } from \"../core/descriptor-meta\";\nimport { ltreeCodecRegistry } from \"../core/registry\";\n\nconst ltreeRuntimeDescriptor: SqlRuntimeExtensionDescriptor<\"postgres\"> = {\n kind: \"extension\" as const,\n id: ltreePackMeta.id,\n version: ltreePackMeta.version,\n familyId: \"sql\" as const,\n targetId: \"postgres\" as const,\n types: {\n codecTypes: {\n codecDescriptors: Array.from(ltreeCodecRegistry.values()),\n },\n },\n codecs: () => Array.from(ltreeCodecRegistry.values()),\n queryOperations: () => ltreeQueryOperations(),\n create() {\n return {\n familyId: \"sql\" as const,\n targetId: \"postgres\" as const,\n };\n },\n};\n\nexport { ltreeCodecRegistry };\nexport default ltreeRuntimeDescriptor;\n"],"mappings":";;AAIA,MAAM,yBAAoE;CACxE,MAAM;CACN,IAAI,cAAc;CAClB,SAAS,cAAc;CACvB,UAAU;CACV,UAAU;CACV,OAAO,EACL,YAAY,EACV,kBAAkB,MAAM,KAAK,mBAAmB,OAAO,CAAC,EAC1D,EACF;CACA,cAAc,MAAM,KAAK,mBAAmB,OAAO,CAAC;CACpD,uBAAuB,qBAAqB;CAC5C,SAAS;EACP,OAAO;GACL,UAAU;GACV,UAAU;EACZ;CACF;AACF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prisma-ltree",
3
- "version": "0.2.3",
4
- "description": "Prisma Next extension pack for PostgreSQL's ltree hierarchical tree data type.",
3
+ "version": "0.3.0",
4
+ "description": "Prisma Next (8.0.0-rc) extension pack for PostgreSQL's ltree hierarchical tree data type.",
5
5
  "homepage": "https://prisma-ltree.procka.org",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -28,40 +28,29 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@prisma-next/contract": "0.15.0",
32
- "@prisma-next/contract-authoring": "0.15.0",
33
- "@prisma-next/family-sql": "0.15.0",
34
- "@prisma-next/framework-components": "0.15.0",
35
- "@prisma-next/migration-tools": "0.15.0",
36
- "@prisma-next/sql-contract": "0.15.0",
37
- "@prisma-next/sql-operations": "0.15.0",
38
- "@prisma-next/sql-relational-core": "0.15.0",
39
- "@prisma-next/sql-runtime": "0.15.0",
40
- "@prisma-next/sql-schema-ir": "0.15.0",
31
+ "@prisma/orm-family-sql": "8.0.0-rc.1",
32
+ "@prisma/orm-framework": "8.0.0-rc.1",
33
+ "@prisma/orm-toolchain": "8.0.0-rc.1",
41
34
  "@standard-schema/spec": "^1.1.0",
42
35
  "arktype": "^2.2.0"
43
36
  },
44
37
  "devDependencies": {
45
38
  "@electric-sql/pglite": "^0.5.3",
46
- "@prisma-next/adapter-postgres": "0.15.0",
47
- "@prisma-next/cli": "0.15.0",
48
- "@prisma-next/extension-author-tools": "0.15.0",
49
- "@prisma-next/operations": "0.15.0",
50
- "@prisma-next/postgres": "0.15.0",
51
- "@prisma-next/sql-contract-ts": "0.15.0",
52
- "@prisma-next/target-postgres": "0.15.0",
39
+ "@prisma/orm-postgres": "8.0.0-rc.1",
40
+ "@prisma/orm-target-postgres": "8.0.0-rc.1",
53
41
  "@types/node": "^24",
54
42
  "@typescript/native-preview": "7.0.0-dev.20260509.2",
55
43
  "@vitest/coverage-v8": "4.1.8",
44
+ "prisma-next": "8.0.0-rc.1",
56
45
  "typescript": "^5",
57
46
  "vite-plus": "0.1.24"
58
47
  },
59
48
  "peerDependencies": {
60
- "@prisma-next/adapter-postgres": "0.15.0",
49
+ "@prisma/orm-target-postgres": "8.0.0-rc.1",
61
50
  "typescript": ">=5.9"
62
51
  },
63
52
  "peerDependenciesMeta": {
64
- "@prisma-next/adapter-postgres": {
53
+ "@prisma/orm-target-postgres": {
65
54
  "optional": true
66
55
  },
67
56
  "typescript": {
@@ -84,6 +73,6 @@
84
73
  "test": "vp test",
85
74
  "check": "vp check",
86
75
  "build:contract-space": "prisma-next contract emit",
87
- "check-pins": "prisma-next-check-pins"
76
+ "check-pins": "node ./scripts/check-pins.mjs"
88
77
  }
89
78
  }
package/src/contract.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // ⚠️ GENERATED FILE - DO NOT EDIT
2
2
  // This file is automatically generated by 'prisma-next contract emit'.
3
3
  // To regenerate, run: prisma-next contract emit
4
- import type { QueryOperationTypes as PgAdapterQueryOps } from '@prisma-next/adapter-postgres/operation-types';
4
+ import type { QueryOperationTypes as PgAdapterQueryOps } from '@prisma/orm-postgres/adapter/operation-types';
5
5
  import type {
6
6
  Bit,
7
7
  Char,
@@ -15,32 +15,133 @@ import type {
15
15
  Timetz,
16
16
  VarBit,
17
17
  Varchar,
18
- } from '@prisma-next/target-postgres/codec-types';
18
+ } from '@prisma/orm-postgres/target/codec-types';
19
19
 
20
20
  import type {
21
21
  ContractWithTypeMaps,
22
22
  TypeMaps as TypeMapsType,
23
- } from '@prisma-next/sql-contract/types';
23
+ } from '@prisma/orm-postgres/family-contract/types';
24
24
  import type {
25
25
  Contract as ContractType,
26
26
  ExecutionHashBase,
27
27
  NamespaceId,
28
28
  ProfileHashBase,
29
29
  StorageHashBase,
30
- } from '@prisma-next/contract/types';
30
+ } from '@prisma/orm-postgres/contract/types';
31
31
 
32
32
  export type StorageHash =
33
- StorageHashBase<'sha256:81cc0a29674d926c9089886b1941ba66d6ce26ec5644fc8a0b7c92a5e9e9876e'>;
33
+ StorageHashBase<'ca70941530ea2af306b38e95be66ab1deac79357bcfafb48302d07c8f2c9aa92'>;
34
34
  export type ExecutionHash = ExecutionHashBase<string>;
35
35
  export type ProfileHash =
36
- ProfileHashBase<'sha256:9c8aa3114e84ed3b7ea2bd57526d9c2e1bf7c5292be694e9d3801f566fda7ccb'>;
36
+ ProfileHashBase<'3916f444a8a17ad749191acf9e08dad97d1a327b88c2f1d45d12f240296aa8b2'>;
37
37
 
38
38
  export type CodecTypes = PgTypes;
39
39
  export type LaneCodecTypes = CodecTypes;
40
40
  export type QueryOperationTypes = PgAdapterQueryOps<CodecTypes>;
41
- type DefaultLiteralValue<CodecId extends string, _Encoded> = CodecId extends keyof CodecTypes
42
- ? CodecTypes[CodecId]['output']
43
- : _Encoded;
41
+ export type AggregateTypes = {
42
+ readonly avg: {
43
+ readonly byCodec: {
44
+ readonly 'pg/float@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
45
+ readonly 'pg/float4@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
46
+ readonly 'pg/float8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
47
+ readonly 'pg/int@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
48
+ readonly 'pg/int2@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
49
+ readonly 'pg/int4@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
50
+ readonly 'pg/int8@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
51
+ readonly 'pg/interval@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
52
+ readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
53
+ readonly 'pg/time@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
54
+ readonly 'sql/float@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
55
+ readonly 'sql/int@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
56
+ };
57
+ };
58
+ readonly count: {
59
+ readonly byCodec: {};
60
+ readonly withoutInput: { readonly output: 'pg/int8@1'; readonly nullable: false };
61
+ readonly anyInput: { readonly output: 'pg/int8@1'; readonly nullable: false };
62
+ };
63
+ readonly max: {
64
+ readonly byCodec: {
65
+ readonly 'pg/char@1': { readonly output: 'pg/char@1'; readonly nullable: true };
66
+ readonly 'pg/date@1': { readonly output: 'pg/date@1'; readonly nullable: true };
67
+ readonly 'pg/enum@1': { readonly output: 'pg/enum@1'; readonly nullable: true };
68
+ readonly 'pg/float@1': { readonly output: 'pg/float@1'; readonly nullable: true };
69
+ readonly 'pg/float4@1': { readonly output: 'pg/float4@1'; readonly nullable: true };
70
+ readonly 'pg/float8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
71
+ readonly 'pg/inet@1': { readonly output: 'pg/inet@1'; readonly nullable: true };
72
+ readonly 'pg/int@1': { readonly output: 'pg/int@1'; readonly nullable: true };
73
+ readonly 'pg/int2@1': { readonly output: 'pg/int2@1'; readonly nullable: true };
74
+ readonly 'pg/int4@1': { readonly output: 'pg/int4@1'; readonly nullable: true };
75
+ readonly 'pg/int8@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
76
+ readonly 'pg/interval@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
77
+ readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
78
+ readonly 'pg/text-array@1': { readonly output: 'pg/text-array@1'; readonly nullable: true };
79
+ readonly 'pg/text@1': { readonly output: 'pg/text@1'; readonly nullable: true };
80
+ readonly 'pg/time@1': { readonly output: 'pg/time@1'; readonly nullable: true };
81
+ readonly 'pg/timestamp@1': { readonly output: 'pg/timestamp@1'; readonly nullable: true };
82
+ readonly 'pg/timestamptz@1': { readonly output: 'pg/timestamptz@1'; readonly nullable: true };
83
+ readonly 'pg/timetz@1': { readonly output: 'pg/timetz@1'; readonly nullable: true };
84
+ readonly 'pg/varchar@1': { readonly output: 'pg/text@1'; readonly nullable: true };
85
+ readonly 'sql/char@1': { readonly output: 'sql/char@1'; readonly nullable: true };
86
+ readonly 'sql/float@1': { readonly output: 'sql/float@1'; readonly nullable: true };
87
+ readonly 'sql/int@1': { readonly output: 'sql/int@1'; readonly nullable: true };
88
+ readonly 'sql/text@1': { readonly output: 'sql/text@1'; readonly nullable: true };
89
+ readonly 'sql/timestamp@1': { readonly output: 'sql/timestamp@1'; readonly nullable: true };
90
+ readonly 'sql/varchar@1': { readonly output: 'pg/text@1'; readonly nullable: true };
91
+ };
92
+ };
93
+ readonly min: {
94
+ readonly byCodec: {
95
+ readonly 'pg/char@1': { readonly output: 'pg/char@1'; readonly nullable: true };
96
+ readonly 'pg/date@1': { readonly output: 'pg/date@1'; readonly nullable: true };
97
+ readonly 'pg/enum@1': { readonly output: 'pg/enum@1'; readonly nullable: true };
98
+ readonly 'pg/float@1': { readonly output: 'pg/float@1'; readonly nullable: true };
99
+ readonly 'pg/float4@1': { readonly output: 'pg/float4@1'; readonly nullable: true };
100
+ readonly 'pg/float8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
101
+ readonly 'pg/inet@1': { readonly output: 'pg/inet@1'; readonly nullable: true };
102
+ readonly 'pg/int@1': { readonly output: 'pg/int@1'; readonly nullable: true };
103
+ readonly 'pg/int2@1': { readonly output: 'pg/int2@1'; readonly nullable: true };
104
+ readonly 'pg/int4@1': { readonly output: 'pg/int4@1'; readonly nullable: true };
105
+ readonly 'pg/int8@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
106
+ readonly 'pg/interval@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
107
+ readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
108
+ readonly 'pg/text-array@1': { readonly output: 'pg/text-array@1'; readonly nullable: true };
109
+ readonly 'pg/text@1': { readonly output: 'pg/text@1'; readonly nullable: true };
110
+ readonly 'pg/time@1': { readonly output: 'pg/time@1'; readonly nullable: true };
111
+ readonly 'pg/timestamp@1': { readonly output: 'pg/timestamp@1'; readonly nullable: true };
112
+ readonly 'pg/timestamptz@1': { readonly output: 'pg/timestamptz@1'; readonly nullable: true };
113
+ readonly 'pg/timetz@1': { readonly output: 'pg/timetz@1'; readonly nullable: true };
114
+ readonly 'pg/varchar@1': { readonly output: 'pg/text@1'; readonly nullable: true };
115
+ readonly 'sql/char@1': { readonly output: 'sql/char@1'; readonly nullable: true };
116
+ readonly 'sql/float@1': { readonly output: 'sql/float@1'; readonly nullable: true };
117
+ readonly 'sql/int@1': { readonly output: 'sql/int@1'; readonly nullable: true };
118
+ readonly 'sql/text@1': { readonly output: 'sql/text@1'; readonly nullable: true };
119
+ readonly 'sql/timestamp@1': { readonly output: 'sql/timestamp@1'; readonly nullable: true };
120
+ readonly 'sql/varchar@1': { readonly output: 'pg/text@1'; readonly nullable: true };
121
+ };
122
+ };
123
+ readonly sum: {
124
+ readonly byCodec: {
125
+ readonly 'pg/float@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
126
+ readonly 'pg/float4@1': { readonly output: 'pg/float4@1'; readonly nullable: true };
127
+ readonly 'pg/float8@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
128
+ readonly 'pg/int@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
129
+ readonly 'pg/int2@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
130
+ readonly 'pg/int4@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
131
+ readonly 'pg/int8@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
132
+ readonly 'pg/interval@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
133
+ readonly 'pg/numeric@1': { readonly output: 'pg/numeric@1'; readonly nullable: true };
134
+ readonly 'pg/time@1': { readonly output: 'pg/interval@1'; readonly nullable: true };
135
+ readonly 'sql/float@1': { readonly output: 'pg/float8@1'; readonly nullable: true };
136
+ readonly 'sql/int@1': { readonly output: 'pg/int8@1'; readonly nullable: true };
137
+ };
138
+ };
139
+ };
140
+ type DefaultLiteralValue<CodecId extends string, Encoded> = CodecId extends keyof CodecTypes
141
+ ? Encoded extends CodecTypes[CodecId]['json']
142
+ ? Encoded
143
+ : CodecTypes[CodecId]['json']
144
+ : Encoded;
44
145
 
45
146
  export type FieldOutputTypes = { readonly public: Record<string, never> };
46
147
  export type FieldInputTypes = { readonly public: Record<string, never> };
@@ -52,7 +153,8 @@ export type TypeMaps = TypeMapsType<
52
153
  FieldOutputTypes,
53
154
  FieldInputTypes,
54
155
  StorageColumnTypes,
55
- StorageColumnInputTypes
156
+ StorageColumnInputTypes,
157
+ AggregateTypes
56
158
  >;
57
159
 
58
160
  type ContractBase = Omit<
@@ -109,7 +211,7 @@ type ContractBase = Omit<
109
211
  readonly scalarList: true;
110
212
  };
111
213
  };
112
- readonly extensionPacks: {};
214
+ readonly extensions: {};
113
215
  readonly meta: {};
114
216
 
115
217
  readonly profileHash: ProfileHash;
package/src/contract.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": "1",
3
3
  "targetFamily": "sql",
4
4
  "target": "postgres",
5
- "profileHash": "sha256:9c8aa3114e84ed3b7ea2bd57526d9c2e1bf7c5292be694e9d3801f566fda7ccb",
5
+ "profileHash": "3916f444a8a17ad749191acf9e08dad97d1a327b88c2f1d45d12f240296aa8b2",
6
6
  "roots": {},
7
7
  "domain": {
8
8
  "namespaces": {
@@ -21,7 +21,7 @@
21
21
  "kind": "postgres-schema"
22
22
  }
23
23
  },
24
- "storageHash": "sha256:81cc0a29674d926c9089886b1941ba66d6ce26ec5644fc8a0b7c92a5e9e9876e",
24
+ "storageHash": "ca70941530ea2af306b38e95be66ab1deac79357bcfafb48302d07c8f2c9aa92",
25
25
  "types": {
26
26
  "ltree": {
27
27
  "codecId": "pg/ltree@1",
@@ -52,7 +52,7 @@
52
52
  "scalarList": true
53
53
  }
54
54
  },
55
- "extensionPacks": {},
55
+ "extensions": {},
56
56
  "meta": {},
57
57
  "_generated": {
58
58
  "warning": "⚠️ GENERATED FILE - DO NOT EDIT",
package/src/contract.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { defineContract } from "@prisma-next/postgres/contract-builder";
1
+ import { defineContract } from "@prisma/orm-postgres/contract-builder";
2
2
  import { LTREE_ARRAY_CODEC_ID, LTREE_CODEC_ID } from "./core/constants";
3
3
  import {
4
4
  LTREE_ARRAY_STORAGE_TYPE,
@@ -1,4 +1,4 @@
1
- import type { AuthoringTypeNamespace } from "@prisma-next/framework-components/authoring";
1
+ import type { AuthoringTypeNamespace } from "@prisma/orm-framework/components/authoring";
2
2
  import { LTREE_ARRAY_CODEC_ID, LTREE_CODEC_ID } from "./constants";
3
3
  import { LTREE_ARRAY_NATIVE_TYPE, LTREE_NATIVE_TYPE } from "./contract-space-constants";
4
4
 
@@ -1,16 +1,18 @@
1
- import type { JsonValue } from "@prisma-next/contract/types";
1
+ import type { JsonValue } from "@prisma/orm-framework/contract/types";
2
2
  import {
3
- type AnyCodecDescriptor,
4
3
  type CodecCallContext,
5
- CodecDescriptorImpl,
6
4
  CodecImpl,
7
5
  type CodecInstanceContext,
8
6
  type ColumnHelperFor,
9
7
  type ColumnHelperForStrict,
10
8
  column,
11
9
  voidParamsSchema,
12
- } from "@prisma-next/framework-components/codec";
13
- import type { ExtractCodecTypes } from "@prisma-next/sql-relational-core/ast";
10
+ } from "@prisma/orm-framework/components/codec";
11
+ import type { ExtractCodecTypes, ProjectionExpr } from "@prisma/orm-family-sql/relational-core/ast";
12
+ import {
13
+ definePostgresCodecs,
14
+ PostgresCodecDescriptor,
15
+ } from "@prisma/orm-target-postgres/target/codec-descriptor";
14
16
  import type { StandardSchemaV1 } from "@standard-schema/spec";
15
17
  import {
16
18
  LTREE_ARRAY_CODEC_ID,
@@ -76,13 +78,17 @@ export class LtreeCodec extends CodecImpl<
76
78
  }
77
79
  }
78
80
 
79
- const LTREE_META = { db: { sql: { postgres: { nativeType: LTREE_NATIVE_TYPE } } } } as const;
80
-
81
- export class LtreeDescriptor extends CodecDescriptorImpl<void> {
81
+ export class LtreeDescriptor extends PostgresCodecDescriptor<void> {
82
+ protected override nativeType(): string {
83
+ return LTREE_NATIVE_TYPE;
84
+ }
85
+ protected override jsonProjection(expression: ProjectionExpr): ProjectionExpr {
86
+ // ltree's text form is already its canonical JSON string.
87
+ return expression;
88
+ }
82
89
  override readonly codecId = LTREE_CODEC_ID;
83
90
  override readonly traits = ["equality", "order"] as const;
84
91
  override readonly targetTypes = [LTREE_NATIVE_TYPE] as const;
85
- override readonly meta = LTREE_META;
86
92
  override readonly paramsSchema: StandardSchemaV1<void> = voidParamsSchema;
87
93
  override renderOutputType(): string {
88
94
  return "string";
@@ -101,10 +107,6 @@ export const ltree = () =>
101
107
  ltree satisfies ColumnHelperFor<LtreeDescriptor>;
102
108
  ltree satisfies ColumnHelperForStrict<LtreeDescriptor>;
103
109
 
104
- const LTREE_ARRAY_META = {
105
- db: { sql: { postgres: { nativeType: LTREE_ARRAY_NATIVE_TYPE } } },
106
- } as const;
107
-
108
110
  export class LtreeArrayCodec extends CodecImpl<
109
111
  typeof LTREE_ARRAY_CODEC_ID,
110
112
  readonly ["equality"],
@@ -140,11 +142,17 @@ export class LtreeArrayCodec extends CodecImpl<
140
142
  }
141
143
  }
142
144
 
143
- export class LtreeArrayDescriptor extends CodecDescriptorImpl<void> {
145
+ export class LtreeArrayDescriptor extends PostgresCodecDescriptor<void> {
146
+ protected override nativeType(): string {
147
+ return LTREE_ARRAY_NATIVE_TYPE;
148
+ }
149
+ protected override jsonProjection(expression: ProjectionExpr): ProjectionExpr {
150
+ // ltree[] text form projects as a JSON string array already.
151
+ return expression;
152
+ }
144
153
  override readonly codecId = LTREE_ARRAY_CODEC_ID;
145
154
  override readonly traits = ["equality"] as const;
146
155
  override readonly targetTypes = [LTREE_ARRAY_NATIVE_TYPE] as const;
147
- override readonly meta = LTREE_ARRAY_META;
148
156
  override readonly paramsSchema: StandardSchemaV1<void> = voidParamsSchema;
149
157
  override renderOutputType(): string {
150
158
  return "readonly string[]";
@@ -175,4 +183,4 @@ const codecDescriptorMap = {
175
183
 
176
184
  export type CodecTypes = ExtractCodecTypes<typeof codecDescriptorMap>;
177
185
 
178
- export const codecDescriptors: readonly AnyCodecDescriptor[] = Object.values(codecDescriptorMap);
186
+ export const codecDescriptors = definePostgresCodecs(Object.values(codecDescriptorMap));
@@ -1,11 +1,11 @@
1
- import type { AnyExpression } from "@prisma-next/sql-relational-core/ast";
1
+ import type { AnyExpression } from "@prisma/orm-family-sql/relational-core/ast";
2
2
  import {
3
3
  buildOperation,
4
4
  type CodecExpression,
5
5
  codecOf,
6
6
  type Expression,
7
7
  toExpr,
8
- } from "@prisma-next/sql-relational-core/expression";
8
+ } from "@prisma/orm-family-sql/relational-core/expression";
9
9
  import type { CodecTypes } from "../types/codec-types";
10
10
  import type { QueryOperationTypes } from "../types/operation-types";
11
11
  import { ltreeAuthoringTypes } from "./authoring";
@@ -1,5 +1,5 @@
1
- import { buildCodecDescriptorRegistry } from "@prisma-next/sql-relational-core/codec-descriptor-registry";
2
- import type { CodecDescriptorRegistry } from "@prisma-next/sql-relational-core/query-lane-context";
1
+ import { buildCodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/codec-descriptor-registry";
2
+ import type { CodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/query-lane-context";
3
3
  import { codecDescriptors } from "./codecs";
4
4
 
5
5
  export const ltreeCodecRegistry: CodecDescriptorRegistry =
@@ -1,4 +1,4 @@
1
- import type { ColumnTypeDescriptor } from "@prisma-next/framework-components/codec";
1
+ import type { ColumnTypeDescriptor } from "@prisma/orm-framework/components/codec";
2
2
  import { LTREE_ARRAY_CODEC_ID, LTREE_CODEC_ID } from "../core/constants";
3
3
  import { LTREE_ARRAY_NATIVE_TYPE, LTREE_NATIVE_TYPE } from "../core/contract-space-constants";
4
4
 
@@ -1,13 +1,13 @@
1
- import type { Contract } from "@prisma-next/contract/types";
1
+ import type { Contract } from "@prisma/orm-framework/contract/types";
2
2
  import type {
3
3
  CodecControlHooks,
4
4
  SqlControlExtensionDescriptor,
5
- } from "@prisma-next/family-sql/control";
6
- import { contractSpaceFromJson } from "@prisma-next/migration-tools/spaces";
7
- import type { SqlStorage } from "@prisma-next/sql-contract/types";
8
- import baselineMetadata from "../../migrations/app/20260619T2142_install_ltree/migration.json" with { type: "json" };
9
- import baselineOps from "../../migrations/app/20260619T2142_install_ltree/ops.json" with { type: "json" };
10
- import headRef from "../../migrations/app/refs/head.json" with { type: "json" };
5
+ } from "@prisma/orm-family-sql/family/control";
6
+ import { contractSpaceFromJson } from "@prisma/orm-toolchain/migration-tools/spaces";
7
+ import type { SqlStorage } from "@prisma/orm-family-sql/contract/types";
8
+ import baselineMetadata from "../../migrations/20260619T2142_install_ltree/migration.json" with { type: "json" };
9
+ import baselineOps from "../../migrations/20260619T2142_install_ltree/ops.json" with { type: "json" };
10
+ import headRef from "../../migrations/refs/head.json" with { type: "json" };
11
11
  import contractJson from "../contract.json" with { type: "json" };
12
12
  import { LTREE_ARRAY_CODEC_ID, LTREE_CODEC_ID } from "../core/constants";
13
13
  import { LTREE_SPACE_ID, LTREE_BASELINE_MIGRATION_NAME } from "../core/contract-space-constants";
@@ -1,4 +1,4 @@
1
- import type { SqlRuntimeExtensionDescriptor } from "@prisma-next/sql-runtime";
1
+ import type { SqlRuntimeExtensionDescriptor } from "@prisma/orm-family-sql/runtime";
2
2
  import { ltreePackMeta, ltreeQueryOperations } from "../core/descriptor-meta";
3
3
  import { ltreeCodecRegistry } from "../core/registry";
4
4
 
@@ -1,5 +1,8 @@
1
- import type { SqlQueryOperationTypes } from "@prisma-next/sql-contract/types";
2
- import type { CodecExpression, Expression } from "@prisma-next/sql-relational-core/expression";
1
+ import type { SqlQueryOperationTypes } from "@prisma/orm-family-sql/contract/types";
2
+ import type {
3
+ CodecExpression,
4
+ Expression,
5
+ } from "@prisma/orm-family-sql/relational-core/expression";
3
6
 
4
7
  type CodecTypesBase = Record<string, { readonly input: unknown; readonly output: unknown }>;
5
8
 
@@ -1 +0,0 @@
1
- {"version":3,"file":"codec-types-mZn-cIh9.d.mts","names":[],"sources":["../src/core/constants.ts","../src/core/codecs.ts","../src/types/codec-types.ts"],"mappings":";;;;;;cAAa,cAAA;AAAA,cAEA,oBAAA;;;cCkDA,UAAA,SAAmB,SAAA,QACvB,cAAA;EAKD,MAAA,CAAO,KAAA,UAAe,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAK/C,MAAA,CAAO,IAAA,UAAc,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAIpD,UAAA,CAAW,KAAA,WAAgB,SAAA;EAK3B,UAAA,CAAW,IAAA,EAAM,SAAA;AAAA;AAAA,cAQN,eAAA,SAAwB,mBAAA;EAAA,SACjB,OAAA;EAAA,SACA,MAAA;EAAA,SACA,WAAA;EAAA,SACA,IAAA;IAAA;eANO,GAAA;QAAA,SAAO,QAAA;UAAA,SAAY,UAAA;QAAA;MAAA;IAAA;EAAA;EAAA,SAO1B,YAAA,EAAc,gBAAA;EACvB,gBAAA;EAGA,OAAA,KAAY,GAAA,EAAK,oBAAA,KAAyB,UAAA;AAAA;AAAA,cAkBxC,eAAA,SAAwB,SAAA,QAC5B,oBAAA;EAKD,MAAA,CAAO,KAAA,qBAA0B,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAO1D,MAAA,CAAO,IAAA,qBAAyB,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAI/D,UAAA,CAAW,KAAA,sBAA2B,SAAA;EAOtC,UAAA,CAAW,IAAA,EAAM,SAAA;AAAA;AAAA,cAWN,oBAAA,SAA6B,mBAAA;EAAA,SACtB,OAAA;EAAA,SACA,MAAA;EAAA,SACA,WAAA;EAAA,SACA,IAAA;IAAA;eA1CZ,GAAA;QAAA,SAAO,QAAA;UAAA,SAAY,UAAA;QAAA;MAAA;IAAA;EAAA;EAAA,SA2CP,YAAA,EAAc,gBAAA;EACvB,gBAAA;EAGA,OAAA,KAAY,GAAA,EAAK,oBAAA,KAAyB,eAAA;AAAA;AAAA,cAmB/C,kBAAA;EAAA,SACJ,KAAA,EAAK,eAAA;EAAA,SACL,UAAA,EAAU,oBAAA;AAAA;AAAA,KAGA,YAAA,GAAa,iBAAiB,QAAQ,kBAAA;;;KC7KtC,KAAA;EAAA,SAA4B,OAAO;AAAA;AAAA,KAEnC,UAAA;EAAA,SAA4C,YAAY;AAAA;AAAA,KAExD,UAAA,GAAa,YAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"descriptor-meta-Ch66mRPL.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-next/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-next/contract/types\";\nimport {\n type AnyCodecDescriptor,\n type CodecCallContext,\n CodecDescriptorImpl,\n CodecImpl,\n type CodecInstanceContext,\n type ColumnHelperFor,\n type ColumnHelperForStrict,\n column,\n voidParamsSchema,\n} from \"@prisma-next/framework-components/codec\";\nimport type { ExtractCodecTypes } from \"@prisma-next/sql-relational-core/ast\";\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\nconst LTREE_META = { db: { sql: { postgres: { nativeType: LTREE_NATIVE_TYPE } } } } as const;\n\nexport class LtreeDescriptor extends CodecDescriptorImpl<void> {\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 meta = LTREE_META;\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\nconst LTREE_ARRAY_META = {\n db: { sql: { postgres: { nativeType: LTREE_ARRAY_NATIVE_TYPE } } },\n} as const;\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 CodecDescriptorImpl<void> {\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 meta = LTREE_ARRAY_META;\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: readonly AnyCodecDescriptor[] = Object.values(codecDescriptorMap);\n","import { buildCodecDescriptorRegistry } from \"@prisma-next/sql-relational-core/codec-descriptor-registry\";\nimport type { CodecDescriptorRegistry } from \"@prisma-next/sql-relational-core/query-lane-context\";\nimport { codecDescriptors } from \"./codecs\";\n\nexport const ltreeCodecRegistry: CodecDescriptorRegistry =\n buildCodecDescriptorRegistry(codecDescriptors);\n","import type { AnyExpression } from \"@prisma-next/sql-relational-core/ast\";\nimport {\n buildOperation,\n type CodecExpression,\n codecOf,\n type Expression,\n toExpr,\n} from \"@prisma-next/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,OAAO;EACL,MAAM;EACN,QAAQ;GACN,SAAS;GACT,YAAY;EACd;CACF;CACA,YAAY;EACV,MAAM;EACN,QAAQ;GACN,SAAS;GACT,YAAY;EACd;CACF;AACF,EACF;;;ACCA,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,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