@prisma-next/ids 0.3.0-dev.134 → 0.3.0-dev.146
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 +17 -7
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -31,14 +31,24 @@ flowchart LR
|
|
|
31
31
|
## Usage
|
|
32
32
|
|
|
33
33
|
```ts
|
|
34
|
-
import {
|
|
34
|
+
import { textColumn } from '@prisma-next/adapter-postgres/column-types';
|
|
35
|
+
import sqlFamily from '@prisma-next/family-sql/pack';
|
|
35
36
|
import { uuidv4 } from '@prisma-next/ids';
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
import { defineContract, field, model } from '@prisma-next/sql-contract-ts/contract-builder';
|
|
38
|
+
import postgresPack from '@prisma-next/target-postgres/pack';
|
|
39
|
+
|
|
40
|
+
export const contract = defineContract({
|
|
41
|
+
family: sqlFamily,
|
|
42
|
+
target: postgresPack,
|
|
43
|
+
models: {
|
|
44
|
+
User: model('User', {
|
|
45
|
+
fields: {
|
|
46
|
+
id: field.generated(uuidv4()).id(),
|
|
47
|
+
email: field.column(textColumn),
|
|
48
|
+
},
|
|
49
|
+
}).sql({ table: 'user' }),
|
|
50
|
+
},
|
|
51
|
+
});
|
|
42
52
|
```
|
|
43
53
|
|
|
44
54
|
Pass generator options directly (for helpers whose `uniku` implementation supports them):
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/ids",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.146",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "ID generator helpers for Prisma Next contracts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"uniku": "^0.0.12",
|
|
9
|
-
"@prisma-next/contract": "0.3.0-dev.
|
|
10
|
-
"@prisma-next/contract-authoring": "0.3.0-dev.
|
|
11
|
-
"@prisma-next/utils": "0.3.0-dev.
|
|
9
|
+
"@prisma-next/contract": "0.3.0-dev.146",
|
|
10
|
+
"@prisma-next/contract-authoring": "0.3.0-dev.146",
|
|
11
|
+
"@prisma-next/utils": "0.3.0-dev.146"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"tsdown": "0.18.4",
|
|
15
15
|
"typescript": "5.9.3",
|
|
16
16
|
"vitest": "4.0.17",
|
|
17
|
-
"@prisma-next/
|
|
18
|
-
"@prisma-next/
|
|
17
|
+
"@prisma-next/tsconfig": "0.0.0",
|
|
18
|
+
"@prisma-next/tsdown": "0.0.0"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
21
|
"dist",
|