@prisma-next/sql-contract-ts 0.13.0-dev.19 → 0.13.0-dev.20
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 +5 -5
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ This package is part of the SQL family namespace (`packages/2-sql/2-authoring/co
|
|
|
16
16
|
|
|
17
17
|
- the SQL contract DSL centered on `defineContract(...)`
|
|
18
18
|
- the base structural helpers exported from `./contract-builder`: `field.column(...)`, `field.generated(...)`, `field.namedType(...)`, plus `model(...)` and `rel.*`
|
|
19
|
-
- an optional callback overload that exposes pack-composed helpers — namespaced helpers like `field.id.
|
|
19
|
+
- an optional callback overload that exposes pack-composed helpers — namespaced helpers like `field.id.uuidv7String()`, `field.text()`, `field.temporal.createdAt()`, `field.temporal.updatedAt()`, plus pack-contributed entity-type helpers at top level alongside the built-in `model` / `rel` (e.g. `enum({ name, values })`)
|
|
20
20
|
- lowering from authored model definitions into the canonical SQL `Contract`
|
|
21
21
|
|
|
22
22
|
## Responsibilities
|
|
@@ -132,7 +132,7 @@ export const contract = defineContract(
|
|
|
132
132
|
|
|
133
133
|
const User = model('User', {
|
|
134
134
|
fields: {
|
|
135
|
-
id: field.id.
|
|
135
|
+
id: field.id.uuidv7String().sql({ id: { name: 'user_pkey' } }),
|
|
136
136
|
shortName: field.namedType(types.ShortName),
|
|
137
137
|
role: field.namedType(types.Role),
|
|
138
138
|
embedding: field.namedType(types.Embedding1536).optional(),
|
|
@@ -143,8 +143,8 @@ export const contract = defineContract(
|
|
|
143
143
|
|
|
144
144
|
const Post = model('Post', {
|
|
145
145
|
fields: {
|
|
146
|
-
id: field.id.
|
|
147
|
-
authorId: field.
|
|
146
|
+
id: field.id.uuidv7String(),
|
|
147
|
+
authorId: field.uuidString(),
|
|
148
148
|
title: field.text(),
|
|
149
149
|
},
|
|
150
150
|
});
|
|
@@ -194,7 +194,7 @@ const Membership = model('Membership', {
|
|
|
194
194
|
### Helper Notes
|
|
195
195
|
|
|
196
196
|
- Structural helpers: `field.column(...)`, `field.generated(...)`, `field.namedType(...)`, plus `model(...)` and `rel.*`
|
|
197
|
-
- Callback helper presets: `field.id.
|
|
197
|
+
- Callback helper presets: `field.id.uuidv4String()`, `field.id.uuidv7String()`, `field.id.nanoid({ size })`, `field.uuidString()`, `field.text()`, `field.timestamp()`, `field.temporal.createdAt()`, `field.temporal.updatedAt()`, and `type.*` (Postgres also adds `field.uuidNative()`, `field.id.uuidv4Native()`, `field.id.uuidv7Native()` — these emit `pg/uuid@1`)
|
|
198
198
|
- Timestamp helpers mirror PSL semantics: `field.temporal.createdAt()` lowers to a target storage `now()` default, while `field.temporal.updatedAt()` lowers to the target-owned `timestampNow` execution default for create and non-empty update mutations.
|
|
199
199
|
- Keep field-local and FK-local storage overrides next to the authoring site with `field.sql(...)` and `rel.belongsTo(...).sql({ fk })`
|
|
200
200
|
- Prefer typed local refs such as `field.namedType(types.Role)`, `User.refs.id`, and `User.ref('id')` when those tokens are available
|
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/sql-contract-ts",
|
|
3
|
-
"version": "0.13.0-dev.
|
|
3
|
+
"version": "0.13.0-dev.20",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"description": "SQL-specific TypeScript contract authoring surface for Prisma Next",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@prisma-next/config": "0.13.0-dev.
|
|
10
|
-
"@prisma-next/contract": "0.13.0-dev.
|
|
11
|
-
"@prisma-next/contract-authoring": "0.13.0-dev.
|
|
12
|
-
"@prisma-next/framework-components": "0.13.0-dev.
|
|
13
|
-
"@prisma-next/sql-contract": "0.13.0-dev.
|
|
14
|
-
"@prisma-next/utils": "0.13.0-dev.
|
|
9
|
+
"@prisma-next/config": "0.13.0-dev.20",
|
|
10
|
+
"@prisma-next/contract": "0.13.0-dev.20",
|
|
11
|
+
"@prisma-next/contract-authoring": "0.13.0-dev.20",
|
|
12
|
+
"@prisma-next/framework-components": "0.13.0-dev.20",
|
|
13
|
+
"@prisma-next/sql-contract": "0.13.0-dev.20",
|
|
14
|
+
"@prisma-next/utils": "0.13.0-dev.20",
|
|
15
15
|
"arktype": "^2.2.0",
|
|
16
16
|
"pathe": "^2.0.3",
|
|
17
17
|
"ts-toolbelt": "^9.6.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@prisma-next/test-utils": "0.13.0-dev.
|
|
21
|
-
"@prisma-next/tsconfig": "0.13.0-dev.
|
|
20
|
+
"@prisma-next/test-utils": "0.13.0-dev.20",
|
|
21
|
+
"@prisma-next/tsconfig": "0.13.0-dev.20",
|
|
22
22
|
"@types/pg": "8.20.0",
|
|
23
23
|
"pg": "8.21.0",
|
|
24
|
-
"@prisma-next/tsdown": "0.13.0-dev.
|
|
24
|
+
"@prisma-next/tsdown": "0.13.0-dev.20",
|
|
25
25
|
"tsdown": "0.22.1",
|
|
26
26
|
"typescript": "5.9.3",
|
|
27
27
|
"vitest": "4.1.8"
|