prisma-ltree 0.4.0 → 0.6.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 +11 -11
- package/dist/{codec-types-ECy3aUGO.d.mts → codec-types-Ba5cQ3bc.d.mts} +19 -19
- package/dist/codec-types-Ba5cQ3bc.d.mts.map +1 -0
- package/dist/codec-types.d.mts +1 -1
- package/dist/column-types.d.mts.map +1 -1
- package/dist/column-types.mjs +3 -9
- package/dist/column-types.mjs.map +1 -1
- package/dist/constants-Dfknw-h5.mjs +9 -0
- package/dist/constants-Dfknw-h5.mjs.map +1 -0
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +250 -27
- package/dist/control.mjs.map +1 -1
- package/dist/{descriptor-meta-D2gu1NKP.mjs → descriptor-meta-Cc6tmP54.mjs} +106 -62
- package/dist/descriptor-meta-Cc6tmP54.mjs.map +1 -0
- package/dist/pack.d.mts +4 -14
- package/dist/pack.d.mts.map +1 -1
- package/dist/pack.mjs +1 -1
- package/dist/runtime.mjs +2 -1
- package/dist/runtime.mjs.map +1 -1
- package/package.json +11 -10
- package/src/contract.d.ts +109 -24
- package/src/contract.json +28 -5
- package/src/contract.ts +22 -10
- package/src/core/authoring.ts +2 -3
- package/src/core/codecs-validation.ts +31 -0
- package/src/core/codecs.ts +39 -76
- package/src/core/contract-space-constants.ts +11 -2
- package/src/core/data-types.ts +75 -0
- package/src/core/descriptor-meta.ts +12 -28
- package/src/exports/column-types.ts +0 -3
- package/src/exports/control.ts +36 -2
- package/src/exports/runtime.ts +1 -0
- package/dist/codec-types-ECy3aUGO.d.mts.map +0 -1
- package/dist/contract-space-constants-Da9EC668.mjs +0 -15
- package/dist/contract-space-constants-Da9EC668.mjs.map +0 -1
- package/dist/descriptor-meta-D2gu1NKP.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -30,16 +30,16 @@ for what is supported, planned, or out of scope.
|
|
|
30
30
|
pnpm add prisma-ltree
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
Requires Node `>=24`. This pack exact-pins `@prisma/orm-*` to **`8.0.0-rc.
|
|
33
|
+
Requires Node `>=24`. This pack exact-pins `@prisma/orm-*` to **`8.0.0-rc.23`**.
|
|
34
34
|
`prisma-ltree` itself stays on independent `0.x` semver: install it with a caret.
|
|
35
|
-
You do not need `prisma-ltree@8.0.0-rc.
|
|
35
|
+
You do not need `prisma-ltree@8.0.0-rc.23`. See
|
|
36
36
|
[versioning and compatibility](https://github.com/slovakian/prisma-ltree/blob/main/docs/prisma-next/versioning-and-compatibility.md).
|
|
37
37
|
|
|
38
38
|
Consumer apps also depend on the Postgres facade at the same SPI version, plus the
|
|
39
39
|
`prisma` CLI:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
pnpm add @prisma/orm-postgres@8.0.0-rc.
|
|
42
|
+
pnpm add @prisma/orm-postgres@8.0.0-rc.23 prisma-ltree
|
|
43
43
|
pnpm add -D prisma
|
|
44
44
|
```
|
|
45
45
|
|
|
@@ -90,15 +90,15 @@ Author ltree columns in either lane: `contract.prisma` (PSL) or `contract.ts`
|
|
|
90
90
|
`ltree` into `extensions` in `prisma.config.ts`:
|
|
91
91
|
|
|
92
92
|
```prisma
|
|
93
|
-
// contract.prisma: use prisma
|
|
93
|
+
// contract.prisma: use prisma-8
|
|
94
94
|
|
|
95
95
|
types {
|
|
96
|
-
Path = ltree.Ltree() // → pg/ltree@1 / ltree
|
|
97
|
-
Paths = ltree.LtreeArray() // → pg/ltree-array@1 / ltree
|
|
96
|
+
Path = ltree.Ltree() // → pg/ltree@1 / ltree/ltree
|
|
97
|
+
Paths = ltree.LtreeArray() // → pg/ltree-array@1 / ltree/ltree-array
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
model Page {
|
|
101
|
-
id String @id @
|
|
101
|
+
id String @id @onCreate(uuid())
|
|
102
102
|
path Path
|
|
103
103
|
breadcrumbs Paths
|
|
104
104
|
|
|
@@ -110,7 +110,7 @@ model Page {
|
|
|
110
110
|
|
|
111
111
|
```prisma
|
|
112
112
|
model Page {
|
|
113
|
-
id String @id @
|
|
113
|
+
id String @id @onCreate(uuid())
|
|
114
114
|
path Path
|
|
115
115
|
|
|
116
116
|
@@index([path], type: "gist")
|
|
@@ -134,12 +134,12 @@ export const contract = defineContract(
|
|
|
134
134
|
{
|
|
135
135
|
extensions: { ltree: ltreePack },
|
|
136
136
|
},
|
|
137
|
-
({ field, model }) => ({
|
|
137
|
+
({ field, model, type }) => ({
|
|
138
138
|
models: {
|
|
139
139
|
Category: model("Category", {
|
|
140
140
|
fields: {
|
|
141
|
-
id: field.
|
|
142
|
-
name: field.
|
|
141
|
+
id: field.column(type.Int()).id(),
|
|
142
|
+
name: field.column(type.String()),
|
|
143
143
|
path: field.column(ltree()),
|
|
144
144
|
},
|
|
145
145
|
}).sql({ table: "category" }),
|
|
@@ -1,8 +1,6 @@
|
|
|
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";
|
|
1
|
+
import { AnyCodecDescriptor, CodecCallContext, CodecImpl, CodecInstanceContext, DataTypeValue } from "@prisma/orm-framework/components/codec";
|
|
4
2
|
import { ExtractCodecTypes, ProjectionExpr } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
|
-
import {
|
|
3
|
+
import { PostgresCodecDescriptor } from "@prisma/orm-target-postgres/target/codec-descriptor";
|
|
6
4
|
|
|
7
5
|
//#region src/core/constants.d.ts
|
|
8
6
|
declare const LTREE_CODEC_ID: "pg/ltree@1";
|
|
@@ -10,34 +8,36 @@ declare const LTREE_ARRAY_CODEC_ID: "pg/ltree-array@1";
|
|
|
10
8
|
//#endregion
|
|
11
9
|
//#region src/core/codecs.d.ts
|
|
12
10
|
declare class LtreeCodec extends CodecImpl<typeof LTREE_CODEC_ID, readonly ["equality", "order"], string, string> {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
constructor(descriptor: AnyCodecDescriptor);
|
|
12
|
+
toWire(value: string, _ctx: CodecCallContext): Promise<string>;
|
|
13
|
+
fromWire(wire: string, _ctx: CodecCallContext): Promise<string>;
|
|
14
|
+
toDataTypeValue(value: string): DataTypeValue;
|
|
15
|
+
fromDataTypeValue(value: DataTypeValue): string;
|
|
17
16
|
}
|
|
18
17
|
declare class LtreeDescriptor extends PostgresCodecDescriptor<void> {
|
|
19
|
-
|
|
18
|
+
readonly jsonType: "string";
|
|
20
19
|
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
20
|
+
readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
|
|
21
21
|
readonly codecId: "pg/ltree@1";
|
|
22
22
|
readonly traits: readonly ["equality", "order"];
|
|
23
|
-
readonly
|
|
24
|
-
readonly paramsSchema: StandardSchemaV1<void>;
|
|
23
|
+
readonly paramsSchema: undefined;
|
|
25
24
|
renderOutputType(): string;
|
|
26
25
|
factory(): (ctx: CodecInstanceContext) => LtreeCodec;
|
|
27
26
|
}
|
|
28
27
|
declare class LtreeArrayCodec extends CodecImpl<typeof LTREE_ARRAY_CODEC_ID, readonly ["equality"], readonly string[], readonly string[]> {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
constructor(descriptor: AnyCodecDescriptor);
|
|
29
|
+
toWire(value: readonly string[], _ctx: CodecCallContext): Promise<readonly string[]>;
|
|
30
|
+
fromWire(wire: readonly string[], _ctx: CodecCallContext): Promise<readonly string[]>;
|
|
31
|
+
toDataTypeValue(value: readonly string[]): DataTypeValue;
|
|
32
|
+
fromDataTypeValue(value: DataTypeValue): readonly string[];
|
|
33
33
|
}
|
|
34
34
|
declare class LtreeArrayDescriptor extends PostgresCodecDescriptor<void> {
|
|
35
|
-
|
|
35
|
+
readonly jsonType: "array";
|
|
36
36
|
protected jsonProjection(expression: ProjectionExpr): ProjectionExpr;
|
|
37
|
+
readonly dataType: import("@prisma/orm-framework/components/codec").DataTypeId;
|
|
37
38
|
readonly codecId: "pg/ltree-array@1";
|
|
38
39
|
readonly traits: readonly ["equality"];
|
|
39
|
-
readonly
|
|
40
|
-
readonly paramsSchema: StandardSchemaV1<void>;
|
|
40
|
+
readonly paramsSchema: undefined;
|
|
41
41
|
renderOutputType(): string;
|
|
42
42
|
factory(): (ctx: CodecInstanceContext) => LtreeArrayCodec;
|
|
43
43
|
}
|
|
@@ -57,4 +57,4 @@ type LtreeArray = readonly string[] & {
|
|
|
57
57
|
type CodecTypes = CodecTypes$1;
|
|
58
58
|
//#endregion
|
|
59
59
|
export { Ltree as n, LtreeArray as r, CodecTypes as t };
|
|
60
|
-
//# sourceMappingURL=codec-types-
|
|
60
|
+
//# sourceMappingURL=codec-types-Ba5cQ3bc.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-types-Ba5cQ3bc.d.mts","names":[],"sources":["../src/core/constants.ts","../src/core/codecs.ts","../src/types/codec-types.ts"],"mappings":";;;;;cAAa,cAAA;AAAA,cAEA,oBAAA;;;cCoBA,UAAA,SAAmB,SAAA,QACvB,cAAA;EAKP,WAAA,CAAY,UAAA,EAAY,kBAAA;EAIlB,MAAA,CAAO,KAAA,UAAe,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAK/C,QAAA,CAAS,IAAA,UAAc,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAItD,eAAA,CAAgB,KAAA,WAAgB,aAAA;EAKhC,iBAAA,CAAkB,KAAA,EAAO,aAAA;AAAA;AAAA,cAKd,eAAA,SAAwB,uBAAA;EAAA,SACjB,QAAA;EAAA,UACC,cAAA,CAAe,UAAA,EAAY,cAAA,GAAiB,cAAA;EAAA,SAI7C,QAAA,mDAAQ,UAAA;EAAA,SACR,OAAA;EAAA,SACA,MAAA;EAAA,SACA,YAAA;EACT,gBAAA;EAGA,OAAA,KAAY,GAAA,EAAK,oBAAA,KAAyB,UAAA;AAAA;AAAA,cAaxC,eAAA,SAAwB,SAAA,QAC5B,oBAAA;EAKP,WAAA,CAAY,UAAA,EAAY,kBAAA;EAIlB,MAAA,CAAO,KAAA,qBAA0B,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAO1D,QAAA,CAAS,IAAA,qBAAyB,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAIjE,eAAA,CAAgB,KAAA,sBAA2B,aAAA;EAO3C,iBAAA,CAAkB,KAAA,EAAO,aAAA;AAAA;AAAA,cASd,oBAAA,SAA6B,uBAAA;EAAA,SACtB,QAAA;EAAA,UACC,cAAA,CAAe,UAAA,EAAY,cAAA,GAAiB,cAAA;EAAA,SAI7C,QAAA,mDAAQ,UAAA;EAAA,SACR,OAAA;EAAA,SACA,MAAA;EAAA,SACA,YAAA;EACT,gBAAA;EAGA,OAAA,KAAY,GAAA,EAAK,oBAAA,KAAyB,eAAA;AAAA;AAAA,cAc/C,kBAAA;EAAA,SACJ,KAAA,EAAK,eAAA;EAAA,SACL,UAAA,EAAU,oBAAA;AAAA;AAAA,KAGA,YAAA,GAAa,iBAAiB,QAAQ,kBAAA;;;KChJtC,KAAA;EAAA,SAA4B,OAAO;AAAA;AAAA,KAEnC,UAAA;EAAA,SAA4C,YAAY;AAAA;AAAA,KAExD,UAAA,GAAa,YAAc"}
|
package/dist/codec-types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as Ltree, r as LtreeArray, t as CodecTypes } from "./codec-types-
|
|
1
|
+
import { n as Ltree, r as LtreeArray, t as CodecTypes } from "./codec-types-Ba5cQ3bc.mjs";
|
|
2
2
|
export type { CodecTypes, Ltree, LtreeArray };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-types.d.mts","names":[],"sources":["../src/exports/column-types.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"column-types.d.mts","names":[],"sources":["../src/exports/column-types.ts"],"mappings":";;;iBAGgB,KAAA,IAAS,oBAAoB;AAAA,iBAM7B,UAAA,IAAc,oBAAoB"}
|
package/dist/column-types.mjs
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as LTREE_CODEC_ID, t as LTREE_ARRAY_CODEC_ID } from "./constants-Dfknw-h5.mjs";
|
|
2
2
|
//#region src/exports/column-types.ts
|
|
3
3
|
function ltree() {
|
|
4
|
-
return {
|
|
5
|
-
codecId: LTREE_CODEC_ID,
|
|
6
|
-
nativeType: LTREE_NATIVE_TYPE
|
|
7
|
-
};
|
|
4
|
+
return { codecId: LTREE_CODEC_ID };
|
|
8
5
|
}
|
|
9
6
|
function ltreeArray() {
|
|
10
|
-
return {
|
|
11
|
-
codecId: LTREE_ARRAY_CODEC_ID,
|
|
12
|
-
nativeType: LTREE_ARRAY_NATIVE_TYPE
|
|
13
|
-
};
|
|
7
|
+
return { codecId: LTREE_ARRAY_CODEC_ID };
|
|
14
8
|
}
|
|
15
9
|
//#endregion
|
|
16
10
|
export { ltree, ltreeArray };
|
|
@@ -1 +1 @@
|
|
|
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\";\
|
|
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\";\n\nexport function ltree(): ColumnTypeDescriptor {\n return {\n codecId: LTREE_CODEC_ID,\n } as const;\n}\n\nexport function ltreeArray(): ColumnTypeDescriptor {\n return {\n codecId: LTREE_ARRAY_CODEC_ID,\n } as const;\n}\n"],"mappings":";;AAGA,SAAgB,QAA8B;CAC5C,OAAO,EACL,SAAS,eACX;AACF;AAEA,SAAgB,aAAmC;CACjD,OAAO,EACL,SAAS,qBACX;AACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/core/constants.ts
|
|
2
|
+
const LTREE_CODEC_ID = "pg/ltree@1";
|
|
3
|
+
const LTREE_ARRAY_CODEC_ID = "pg/ltree-array@1";
|
|
4
|
+
const LTREE_MAX_LABEL_LENGTH = 1e3;
|
|
5
|
+
const LTREE_MAX_LABELS = 65535;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { LTREE_MAX_LABEL_LENGTH as i, LTREE_CODEC_ID as n, LTREE_MAX_LABELS as r, LTREE_ARRAY_CODEC_ID as t };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=constants-Dfknw-h5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-Dfknw-h5.mjs","names":[],"sources":["../src/core/constants.ts"],"sourcesContent":["export const LTREE_CODEC_ID = \"pg/ltree@1\" as const;\n\nexport const LTREE_ARRAY_CODEC_ID = \"pg/ltree-array@1\" as const;\n\nexport const LTREE_MAX_LABEL_LENGTH = 1000;\n\nexport const LTREE_MAX_LABELS = 65535;\n"],"mappings":";AAAA,MAAa,iBAAiB;AAE9B,MAAa,uBAAuB;AAEpC,MAAa,yBAAyB;AAEtC,MAAa,mBAAmB"}
|
package/dist/control.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/exports/control.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/exports/control.ts"],"mappings":";;;cAkEM,wBAAA,EAA0B,6BAA6B"}
|
package/dist/control.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as ltreeQueryOperations, t as ltreePackMeta } from "./descriptor-meta-
|
|
1
|
+
import { n as LTREE_CODEC_ID, t as LTREE_ARRAY_CODEC_ID } from "./constants-Dfknw-h5.mjs";
|
|
2
|
+
import { n as ltreeQueryOperations, t as ltreePackMeta } from "./descriptor-meta-Cc6tmP54.mjs";
|
|
3
3
|
import { contractSpaceFromJson } from "@prisma/orm-toolchain/migration-tools/spaces";
|
|
4
4
|
//#region migrations/20260619T2142_install_ltree/migration.json
|
|
5
|
-
var migration_default = {
|
|
5
|
+
var migration_default$4 = {
|
|
6
6
|
from: null,
|
|
7
|
-
to: "
|
|
7
|
+
to: "5842622c2779cd02acd640ab4a5c8979fc94a2af8ed034222391fbd4f7cb3706",
|
|
8
8
|
providedInvariants: ["ltree:install-ltree-v1"],
|
|
9
9
|
createdAt: "2026-06-19T21:42:51.612Z",
|
|
10
|
-
migrationHash: "
|
|
10
|
+
migrationHash: "b6a76ceffc9e133502c15ed26100f9056aa259a6e330547a2490f765509b38d3"
|
|
11
11
|
};
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region migrations/20260619T2142_install_ltree/ops.json
|
|
14
|
-
var ops_default = [{
|
|
14
|
+
var ops_default$4 = [{
|
|
15
15
|
"id": "ltree.install-ltree-extension",
|
|
16
16
|
"label": "Enable extension \"ltree\"",
|
|
17
17
|
"operationClass": "additive",
|
|
@@ -40,10 +40,183 @@ var ops_default = [{
|
|
|
40
40
|
}]
|
|
41
41
|
}];
|
|
42
42
|
//#endregion
|
|
43
|
+
//#region migrations/20261111T1904_create_ltree_extension/migration.json
|
|
44
|
+
var migration_default$3 = {
|
|
45
|
+
from: null,
|
|
46
|
+
to: "150f76958e7b1802cb3fb17b2792759d19e6aedf01f5fffa5f77565a2afe4582",
|
|
47
|
+
providedInvariants: [],
|
|
48
|
+
createdAt: "2026-11-11T19:04:24.423Z",
|
|
49
|
+
migrationHash: "1be2450ab00d5969e0a9f0fdb50daabcbf62f6768ea3a6ee92ef3a4dd6982d1c"
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region migrations/20261111T1904_create_ltree_extension/ops.json
|
|
53
|
+
var ops_default$3 = [{
|
|
54
|
+
"id": "schema.public",
|
|
55
|
+
"label": "Create schema \"public\"",
|
|
56
|
+
"operationClass": "additive",
|
|
57
|
+
"target": { "id": "postgres" },
|
|
58
|
+
"precheck": [],
|
|
59
|
+
"execute": [{
|
|
60
|
+
"description": "Create schema \"public\"",
|
|
61
|
+
"sql": "CREATE SCHEMA IF NOT EXISTS \"public\"",
|
|
62
|
+
"params": []
|
|
63
|
+
}],
|
|
64
|
+
"postcheck": []
|
|
65
|
+
}, {
|
|
66
|
+
"id": "extension.ltree",
|
|
67
|
+
"label": "Create extension \"ltree\"",
|
|
68
|
+
"operationClass": "additive",
|
|
69
|
+
"target": {
|
|
70
|
+
"id": "postgres",
|
|
71
|
+
"details": {
|
|
72
|
+
"schema": "public",
|
|
73
|
+
"objectType": "dependency",
|
|
74
|
+
"name": "ltree"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"precheck": [{
|
|
78
|
+
"description": "verify extension \"ltree\" is not installed",
|
|
79
|
+
"sql": "SELECT NOT EXISTS (SELECT 1 AS \"one\" FROM \"pg_extension\" WHERE \"extname\" = $1) AS \"result\"",
|
|
80
|
+
"params": ["ltree"],
|
|
81
|
+
"expectation": {
|
|
82
|
+
"expects": "absent",
|
|
83
|
+
"object": "extension \"ltree\""
|
|
84
|
+
}
|
|
85
|
+
}],
|
|
86
|
+
"execute": [{
|
|
87
|
+
"description": "create extension \"ltree\"",
|
|
88
|
+
"sql": "CREATE EXTENSION IF NOT EXISTS \"ltree\" WITH SCHEMA \"public\""
|
|
89
|
+
}],
|
|
90
|
+
"postcheck": [{
|
|
91
|
+
"description": "confirm extension \"ltree\" is installed",
|
|
92
|
+
"sql": "SELECT EXISTS (SELECT 1 AS \"one\" FROM \"pg_extension\" WHERE \"extname\" = $1) AS \"result\"",
|
|
93
|
+
"params": ["ltree"],
|
|
94
|
+
"expectation": {
|
|
95
|
+
"expects": "present",
|
|
96
|
+
"object": "extension \"ltree\""
|
|
97
|
+
}
|
|
98
|
+
}]
|
|
99
|
+
}];
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region migrations/20261111T1905_declare_ltree_extension/migration.json
|
|
102
|
+
var migration_default$2 = {
|
|
103
|
+
from: "5842622c2779cd02acd640ab4a5c8979fc94a2af8ed034222391fbd4f7cb3706",
|
|
104
|
+
to: "150f76958e7b1802cb3fb17b2792759d19e6aedf01f5fffa5f77565a2afe4582",
|
|
105
|
+
providedInvariants: [],
|
|
106
|
+
createdAt: "2026-11-11T19:05:51.283Z",
|
|
107
|
+
migrationHash: "28790448876216e19e6aa7b6648ec0f101686dfdc604c377f3584f1f1588c874"
|
|
108
|
+
};
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region migrations/20261111T1905_declare_ltree_extension/ops.json
|
|
111
|
+
var ops_default$2 = [{
|
|
112
|
+
"id": "extension.ltree",
|
|
113
|
+
"label": "Create extension \"ltree\"",
|
|
114
|
+
"operationClass": "additive",
|
|
115
|
+
"target": {
|
|
116
|
+
"id": "postgres",
|
|
117
|
+
"details": {
|
|
118
|
+
"schema": "public",
|
|
119
|
+
"objectType": "dependency",
|
|
120
|
+
"name": "ltree"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"precheck": [{
|
|
124
|
+
"description": "verify extension \"ltree\" is not installed",
|
|
125
|
+
"sql": "SELECT NOT EXISTS (SELECT 1 AS \"one\" FROM \"pg_extension\" WHERE \"extname\" = $1) AS \"result\"",
|
|
126
|
+
"params": ["ltree"],
|
|
127
|
+
"expectation": {
|
|
128
|
+
"expects": "absent",
|
|
129
|
+
"object": "extension \"ltree\""
|
|
130
|
+
}
|
|
131
|
+
}],
|
|
132
|
+
"execute": [{
|
|
133
|
+
"description": "create extension \"ltree\"",
|
|
134
|
+
"sql": "CREATE EXTENSION IF NOT EXISTS \"ltree\" WITH SCHEMA \"public\""
|
|
135
|
+
}],
|
|
136
|
+
"postcheck": [{
|
|
137
|
+
"description": "confirm extension \"ltree\" is installed",
|
|
138
|
+
"sql": "SELECT EXISTS (SELECT 1 AS \"one\" FROM \"pg_extension\" WHERE \"extname\" = $1) AS \"result\"",
|
|
139
|
+
"params": ["ltree"],
|
|
140
|
+
"expectation": {
|
|
141
|
+
"expects": "present",
|
|
142
|
+
"object": "extension \"ltree\""
|
|
143
|
+
}
|
|
144
|
+
}]
|
|
145
|
+
}];
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region migrations/20261111T1908_find_ltree_on_search_path/migration.json
|
|
148
|
+
var migration_default$1 = {
|
|
149
|
+
from: "150f76958e7b1802cb3fb17b2792759d19e6aedf01f5fffa5f77565a2afe4582",
|
|
150
|
+
to: "6db18d99f118ef4e7fd359cf8bc472b9335bf3edeeefa8a15ee11eaf7742f9fb",
|
|
151
|
+
providedInvariants: [],
|
|
152
|
+
createdAt: "2026-11-11T19:08:52.615Z",
|
|
153
|
+
migrationHash: "3ee496921e534f39e639e5d3745d87f003a238809eda1453afc798f404f71d8d"
|
|
154
|
+
};
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region migrations/20261111T1908_find_ltree_on_search_path/ops.json
|
|
157
|
+
var ops_default$1 = [];
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region migrations/20261111T1908_install_ltree_on_search_path/migration.json
|
|
160
|
+
var migration_default = {
|
|
161
|
+
from: null,
|
|
162
|
+
to: "6db18d99f118ef4e7fd359cf8bc472b9335bf3edeeefa8a15ee11eaf7742f9fb",
|
|
163
|
+
providedInvariants: [],
|
|
164
|
+
createdAt: "2026-11-11T19:08:53.983Z",
|
|
165
|
+
migrationHash: "29296a0599924fcb56de5a181f441206320676249c7d2cb4db1b3a1e6c160555"
|
|
166
|
+
};
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region migrations/20261111T1908_install_ltree_on_search_path/ops.json
|
|
169
|
+
var ops_default = [{
|
|
170
|
+
"id": "schema.public",
|
|
171
|
+
"label": "Create schema \"public\"",
|
|
172
|
+
"operationClass": "additive",
|
|
173
|
+
"target": { "id": "postgres" },
|
|
174
|
+
"precheck": [],
|
|
175
|
+
"execute": [{
|
|
176
|
+
"description": "Create schema \"public\"",
|
|
177
|
+
"sql": "CREATE SCHEMA IF NOT EXISTS \"public\"",
|
|
178
|
+
"params": []
|
|
179
|
+
}],
|
|
180
|
+
"postcheck": []
|
|
181
|
+
}, {
|
|
182
|
+
"id": "extension.ltree",
|
|
183
|
+
"label": "Create extension \"ltree\"",
|
|
184
|
+
"operationClass": "additive",
|
|
185
|
+
"target": {
|
|
186
|
+
"id": "postgres",
|
|
187
|
+
"details": {
|
|
188
|
+
"objectType": "dependency",
|
|
189
|
+
"name": "ltree"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"precheck": [{
|
|
193
|
+
"description": "verify extension \"ltree\" is not installed",
|
|
194
|
+
"sql": "SELECT NOT EXISTS (SELECT 1 AS \"one\" FROM \"pg_extension\" WHERE \"extname\" = $1) AS \"result\"",
|
|
195
|
+
"params": ["ltree"],
|
|
196
|
+
"expectation": {
|
|
197
|
+
"expects": "absent",
|
|
198
|
+
"object": "extension \"ltree\""
|
|
199
|
+
}
|
|
200
|
+
}],
|
|
201
|
+
"execute": [{
|
|
202
|
+
"description": "create extension \"ltree\"",
|
|
203
|
+
"sql": "CREATE EXTENSION IF NOT EXISTS \"ltree\""
|
|
204
|
+
}],
|
|
205
|
+
"postcheck": [{
|
|
206
|
+
"description": "confirm extension \"ltree\" is installed",
|
|
207
|
+
"sql": "SELECT EXISTS (SELECT 1 AS \"one\" FROM \"pg_extension\" WHERE \"extname\" = $1) AS \"result\"",
|
|
208
|
+
"params": ["ltree"],
|
|
209
|
+
"expectation": {
|
|
210
|
+
"expects": "present",
|
|
211
|
+
"object": "extension \"ltree\""
|
|
212
|
+
}
|
|
213
|
+
}]
|
|
214
|
+
}];
|
|
215
|
+
//#endregion
|
|
43
216
|
//#region migrations/refs/head.json
|
|
44
217
|
var head_default = {
|
|
45
|
-
hash: "
|
|
46
|
-
invariants: [
|
|
218
|
+
hash: "6db18d99f118ef4e7fd359cf8bc472b9335bf3edeeefa8a15ee11eaf7742f9fb",
|
|
219
|
+
invariants: []
|
|
47
220
|
};
|
|
48
221
|
//#endregion
|
|
49
222
|
//#region src/contract.json
|
|
@@ -55,28 +228,43 @@ var contract_default = {
|
|
|
55
228
|
roots: {},
|
|
56
229
|
domain: { "namespaces": { "public": { "models": {} } } },
|
|
57
230
|
storage: {
|
|
58
|
-
"namespaces": {
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
231
|
+
"namespaces": {
|
|
232
|
+
"__unbound__": {
|
|
233
|
+
"entries": {
|
|
234
|
+
"extension": { "ltree": {
|
|
235
|
+
"kind": "extension",
|
|
236
|
+
"name": "ltree"
|
|
237
|
+
} },
|
|
238
|
+
"table": {}
|
|
239
|
+
},
|
|
240
|
+
"id": "__unbound__",
|
|
241
|
+
"kind": "postgres-unbound-schema"
|
|
242
|
+
},
|
|
243
|
+
"public": {
|
|
244
|
+
"entries": { "table": {} },
|
|
245
|
+
"id": "public",
|
|
246
|
+
"kind": "postgres-schema"
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"storageHash": "6db18d99f118ef4e7fd359cf8bc472b9335bf3edeeefa8a15ee11eaf7742f9fb",
|
|
64
250
|
"types": {
|
|
65
251
|
"ltree": {
|
|
66
252
|
"codecId": "pg/ltree@1",
|
|
67
|
-
"
|
|
68
|
-
"
|
|
253
|
+
"dataType": "ltree/ltree",
|
|
254
|
+
"kind": "codec-instance"
|
|
69
255
|
},
|
|
70
256
|
"ltreeArray": {
|
|
71
257
|
"codecId": "pg/ltree-array@1",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
258
|
+
"dataType": "ltree/ltree-array",
|
|
259
|
+
"kind": "codec-instance"
|
|
74
260
|
}
|
|
75
261
|
}
|
|
76
262
|
},
|
|
77
263
|
capabilities: {
|
|
78
264
|
"postgres": {
|
|
79
265
|
"distinctOn": true,
|
|
266
|
+
"forKeyShare": true,
|
|
267
|
+
"forNoKeyUpdate": true,
|
|
80
268
|
"jsonAgg": true,
|
|
81
269
|
"lateral": true,
|
|
82
270
|
"limit": true,
|
|
@@ -87,7 +275,15 @@ var contract_default = {
|
|
|
87
275
|
"checkConstraint": true,
|
|
88
276
|
"defaultInInsert": true,
|
|
89
277
|
"enums": true,
|
|
278
|
+
"forShare": true,
|
|
279
|
+
"forUpdate": true,
|
|
280
|
+
"insertOnConflictSkip": true,
|
|
281
|
+
"insertOnConflictTarget": true,
|
|
282
|
+
"insertOnConflictWithoutTarget": true,
|
|
90
283
|
"lateral": true,
|
|
284
|
+
"lockNowait": true,
|
|
285
|
+
"lockOf": true,
|
|
286
|
+
"lockSkipLocked": true,
|
|
91
287
|
"returning": true,
|
|
92
288
|
"scalarList": true
|
|
93
289
|
}
|
|
@@ -101,18 +297,45 @@ var contract_default = {
|
|
|
101
297
|
}
|
|
102
298
|
};
|
|
103
299
|
//#endregion
|
|
300
|
+
//#region src/core/contract-space-constants.ts
|
|
301
|
+
const LTREE_SPACE_ID = "ltree";
|
|
302
|
+
const LTREE_BASELINE_MIGRATION_NAME = "20260619T2142_install_ltree";
|
|
303
|
+
const LTREE_DECLARE_EXTENSION_MIGRATION_NAME = "20261111T1905_declare_ltree_extension";
|
|
304
|
+
const LTREE_CREATE_EXTENSION_MIGRATION_NAME = "20261111T1904_create_ltree_extension";
|
|
305
|
+
const LTREE_SEARCH_PATH_MIGRATION_NAME = "20261111T1908_find_ltree_on_search_path";
|
|
306
|
+
const LTREE_SEARCH_PATH_INSTALL_MIGRATION_NAME = "20261111T1908_install_ltree_on_search_path";
|
|
307
|
+
//#endregion
|
|
104
308
|
//#region src/exports/control.ts
|
|
105
|
-
const ltreeControlPlaneHooks = {
|
|
106
|
-
expandNativeType: ({ nativeType }) => nativeType,
|
|
107
|
-
resolveIdentityValue: () => null
|
|
108
|
-
};
|
|
309
|
+
const ltreeControlPlaneHooks = { resolveIdentityValue: () => null };
|
|
109
310
|
const ltreeContractSpace = contractSpaceFromJson({
|
|
110
311
|
contractJson: contract_default,
|
|
111
|
-
migrations: [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
312
|
+
migrations: [
|
|
313
|
+
{
|
|
314
|
+
dirName: LTREE_BASELINE_MIGRATION_NAME,
|
|
315
|
+
metadata: migration_default$4,
|
|
316
|
+
ops: ops_default$4
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
dirName: LTREE_DECLARE_EXTENSION_MIGRATION_NAME,
|
|
320
|
+
metadata: migration_default$2,
|
|
321
|
+
ops: ops_default$2
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
dirName: LTREE_CREATE_EXTENSION_MIGRATION_NAME,
|
|
325
|
+
metadata: migration_default$3,
|
|
326
|
+
ops: ops_default$3
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
dirName: LTREE_SEARCH_PATH_MIGRATION_NAME,
|
|
330
|
+
metadata: migration_default$1,
|
|
331
|
+
ops: ops_default$1
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
dirName: LTREE_SEARCH_PATH_INSTALL_MIGRATION_NAME,
|
|
335
|
+
metadata: migration_default,
|
|
336
|
+
ops: ops_default
|
|
337
|
+
}
|
|
338
|
+
],
|
|
116
339
|
headRef: head_default
|
|
117
340
|
});
|
|
118
341
|
const ltreeExtensionDescriptor = {
|
package/dist/control.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 {
|
|
1
|
+
{"version":3,"file":"control.mjs","names":["baselineMetadata","baselineOps","declareMetadata","declareOps","createMetadata","createOps","searchPathMetadata","searchPathOps","searchPathInstallMetadata","searchPathInstallOps"],"sources":["../migrations/20260619T2142_install_ltree/migration.json","../migrations/20260619T2142_install_ltree/ops.json","../migrations/20261111T1904_create_ltree_extension/migration.json","../migrations/20261111T1904_create_ltree_extension/ops.json","../migrations/20261111T1905_declare_ltree_extension/migration.json","../migrations/20261111T1905_declare_ltree_extension/ops.json","../migrations/20261111T1908_find_ltree_on_search_path/migration.json","../migrations/20261111T1908_find_ltree_on_search_path/ops.json","../migrations/20261111T1908_install_ltree_on_search_path/migration.json","../migrations/20261111T1908_install_ltree_on_search_path/ops.json","../migrations/refs/head.json","../src/contract.json","../src/core/contract-space-constants.ts","../src/exports/control.ts"],"sourcesContent":["","","","","","","","","","","","","export const LTREE_SPACE_ID = \"ltree\" as const;\n\nexport const LTREE_NATIVE_TYPE = \"ltree\" as const;\n\n/** Contract storage.types key — must be a valid identifier for contract emit. */\nexport const LTREE_ARRAY_STORAGE_TYPE = \"ltreeArray\" as const;\n\nexport const LTREE_BASELINE_MIGRATION_NAME = \"20260619T2142_install_ltree\" as const;\n\nexport const LTREE_DECLARE_EXTENSION_MIGRATION_NAME =\n \"20261111T1905_declare_ltree_extension\" as const;\n\nexport const LTREE_CREATE_EXTENSION_MIGRATION_NAME =\n \"20261111T1904_create_ltree_extension\" as const;\n\nexport const LTREE_SEARCH_PATH_MIGRATION_NAME = \"20261111T1908_find_ltree_on_search_path\" as const;\n\nexport const LTREE_SEARCH_PATH_INSTALL_MIGRATION_NAME =\n \"20261111T1908_install_ltree_on_search_path\" as const;\n\nexport const LTREE_INVARIANTS = {\n installLtree: \"ltree:install-ltree-v1\",\n} as const;\n","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 createMetadata from \"../../migrations/20261111T1904_create_ltree_extension/migration.json\" with { type: \"json\" };\nimport createOps from \"../../migrations/20261111T1904_create_ltree_extension/ops.json\" with { type: \"json\" };\nimport declareMetadata from \"../../migrations/20261111T1905_declare_ltree_extension/migration.json\" with { type: \"json\" };\nimport declareOps from \"../../migrations/20261111T1905_declare_ltree_extension/ops.json\" with { type: \"json\" };\nimport searchPathMetadata from \"../../migrations/20261111T1908_find_ltree_on_search_path/migration.json\" with { type: \"json\" };\nimport searchPathOps from \"../../migrations/20261111T1908_find_ltree_on_search_path/ops.json\" with { type: \"json\" };\nimport searchPathInstallMetadata from \"../../migrations/20261111T1908_install_ltree_on_search_path/migration.json\" with { type: \"json\" };\nimport searchPathInstallOps from \"../../migrations/20261111T1908_install_ltree_on_search_path/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 {\n LTREE_BASELINE_MIGRATION_NAME,\n LTREE_CREATE_EXTENSION_MIGRATION_NAME,\n LTREE_DECLARE_EXTENSION_MIGRATION_NAME,\n LTREE_SEARCH_PATH_INSTALL_MIGRATION_NAME,\n LTREE_SEARCH_PATH_MIGRATION_NAME,\n LTREE_SPACE_ID,\n} from \"../core/contract-space-constants\";\nimport { ltreePackMeta, ltreeQueryOperations } from \"../core/descriptor-meta\";\n\nconst ltreeControlPlaneHooks: CodecControlHooks = {\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 dirName: LTREE_DECLARE_EXTENSION_MIGRATION_NAME,\n metadata: declareMetadata,\n ops: declareOps,\n },\n {\n dirName: LTREE_CREATE_EXTENSION_MIGRATION_NAME,\n metadata: createMetadata,\n ops: createOps,\n },\n {\n dirName: LTREE_SEARCH_PATH_MIGRATION_NAME,\n metadata: searchPathMetadata,\n ops: searchPathOps,\n },\n {\n dirName: LTREE_SEARCH_PATH_INSTALL_MIGRATION_NAME,\n metadata: searchPathInstallMetadata,\n ops: searchPathInstallOps,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AYAA,MAAa,iBAAiB;AAO9B,MAAa,gCAAgC;AAE7C,MAAa,yCACX;AAEF,MAAa,wCACX;AAEF,MAAa,mCAAmC;AAEhD,MAAa,2CACX;;;ACYF,MAAM,yBAA4C,EAChD,4BAA4B,KAC9B;AAEA,MAAM,qBAAqB,sBAA4C;CACrE,cAAA;CACA,YAAY;EACV;GACE,SAAS;GACT,UAAUA;GACV,KAAKC;EACP;EACA;GACE,SAAS;GACT,UAAUC;GACV,KAAKC;EACP;EACA;GACE,SAAS;GACT,UAAUC;GACV,KAAKC;EACP;EACA;GACE,SAAS;GACT,UAAUC;GACV,KAAKC;EACP;EACA;GACE,SAAS;GACT,UAAUC;GACV,KAAKC;EACP;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"}
|