prisma-ltree 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +25 -0
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -73,6 +73,31 @@ export default defineConfig({
73
73
 
74
74
  ### Contract definition
75
75
 
76
+ Author ltree columns in either lane — `contract.prisma` (PSL) or `contract.ts`
77
+ (TypeScript). Both emit a byte-identical compiled contract.
78
+
79
+ **PSL lane** — reference the `ltree` namespace constructors (parens required) and compose
80
+ `ltree` into `extensions` in `prisma-next.config.ts`:
81
+
82
+ ```prisma
83
+ // contract.prisma — use prisma-next
84
+
85
+ types {
86
+ Path = ltree.Ltree() // → pg/ltree@1 / ltree
87
+ Paths = ltree.LtreeArray() // → pg/ltree-array@1 / ltree[]
88
+ }
89
+
90
+ model Page {
91
+ id String @id @default(uuid())
92
+ path Path
93
+ breadcrumbs Paths
94
+
95
+ @@map("page")
96
+ }
97
+ ```
98
+
99
+ **TypeScript lane**:
100
+
76
101
  ```typescript
77
102
  import { int4Column, textColumn } from "@prisma-next/adapter-postgres/column-types";
78
103
  import sqlFamily from "@prisma-next/family-sql/pack";
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "prisma-ltree",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "Prisma Next extension pack for PostgreSQL's ltree hierarchical tree data type.",
5
+ "homepage": "https://prisma-ltree.procka.org",
5
6
  "license": "Apache-2.0",
6
7
  "repository": {
7
8
  "type": "git",