@prisma-next/ids 0.3.0-dev.135 → 0.3.0-dev.147

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 +17 -7
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -31,14 +31,24 @@ flowchart LR
31
31
  ## Usage
32
32
 
33
33
  ```ts
34
- import { defineContract } from '@prisma-next/sql-contract-ts/contract-builder';
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
- export const contract = defineContract()
38
- .table('user', (t) =>
39
- t.generated('id', uuidv4()).column('email', { type: { codecId: 'pg/text@1', nativeType: 'text' } }),
40
- )
41
- .build();
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,14 +1,14 @@
1
1
  {
2
2
  "name": "@prisma-next/ids",
3
- "version": "0.3.0-dev.135",
3
+ "version": "0.3.0-dev.147",
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.135",
10
- "@prisma-next/utils": "0.3.0-dev.135",
11
- "@prisma-next/contract-authoring": "0.3.0-dev.135"
9
+ "@prisma-next/utils": "0.3.0-dev.147",
10
+ "@prisma-next/contract-authoring": "0.3.0-dev.147",
11
+ "@prisma-next/contract": "0.3.0-dev.147"
12
12
  },
13
13
  "devDependencies": {
14
14
  "tsdown": "0.18.4",