prisma-zero 0.1.2 → 0.1.3
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 +26 -0
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -71,6 +71,32 @@ export const userTable = table('User')
|
|
|
71
71
|
.primaryKey('id');
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
+
## Postgres Time Support
|
|
75
|
+
|
|
76
|
+
Prisma Postgres `DateTime` native types continue to map to Zero `number()` columns, including `@db.Time` and `@db.Timetz`:
|
|
77
|
+
|
|
78
|
+
```prisma
|
|
79
|
+
model StoreHours {
|
|
80
|
+
id String @id @default(uuid())
|
|
81
|
+
opensAt DateTime @db.Time(6)
|
|
82
|
+
closesAt DateTime @db.Timetz(6)
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The generated Zero schema will include:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
export const storeHoursTable = table('StoreHours')
|
|
90
|
+
.columns({
|
|
91
|
+
id: string(),
|
|
92
|
+
opensAt: number(),
|
|
93
|
+
closesAt: number(),
|
|
94
|
+
})
|
|
95
|
+
.primaryKey('id');
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
This generator intentionally keeps `time` and `timetz` fields as plain `number()` columns so they match Zero's existing date/time handling. If your app uses `@db.Time` or `@db.Timetz`, make sure your installed `@rocicorp/zero` version includes upstream support for those Postgres types (`0.26.0+`).
|
|
99
|
+
|
|
74
100
|
### Supported Array Types
|
|
75
101
|
|
|
76
102
|
- **Scalar arrays**: `String[]`, `Int[]`, `Float[]`, `Boolean[]`, `DateTime[]`, `BigInt[]`, `Decimal[]`
|
package/dist/generator.cjs
CHANGED
package/dist/generator.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prisma-zero",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Generate Zero schemas from Prisma ORM schemas",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -36,27 +36,27 @@
|
|
|
36
36
|
"url": "https://bugs.rocicorp.dev"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@prisma/generator-helper": "^7.
|
|
39
|
+
"@prisma/generator-helper": "^7.5.0",
|
|
40
40
|
"camelcase": "^9.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@rocicorp/prettier-config": "^0.4.0",
|
|
44
|
-
"@rocicorp/zero": "0.
|
|
45
|
-
"@types/node": "^
|
|
46
|
-
"@types/pg": "^8.
|
|
44
|
+
"@rocicorp/zero": "1.0.0",
|
|
45
|
+
"@types/node": "^25.5.0",
|
|
46
|
+
"@types/pg": "^8.20.0",
|
|
47
47
|
"@types/pluralize": "^0.0.33",
|
|
48
48
|
"@types/ws": "^8.18.1",
|
|
49
|
-
"@vitest/browser": "^4.
|
|
50
|
-
"@vitest/coverage-v8": "4.
|
|
51
|
-
"@vitest/ui": "^4.
|
|
52
|
-
"oxlint": "^1.
|
|
53
|
-
"oxlint-tsgolint": "^0.
|
|
54
|
-
"prettier": "^3.
|
|
49
|
+
"@vitest/browser": "^4.1.1",
|
|
50
|
+
"@vitest/coverage-v8": "4.1.1",
|
|
51
|
+
"@vitest/ui": "^4.1.1",
|
|
52
|
+
"oxlint": "^1.57.0",
|
|
53
|
+
"oxlint-tsgolint": "^0.17.4",
|
|
54
|
+
"prettier": "^3.8.1",
|
|
55
55
|
"tsup": "^8.5.1",
|
|
56
56
|
"tsx": "^4.21.0",
|
|
57
|
-
"typescript": "^
|
|
58
|
-
"vite-tsconfig-paths": "^
|
|
59
|
-
"vitest": "^4.
|
|
57
|
+
"typescript": "^6.0.2",
|
|
58
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
59
|
+
"vitest": "^4.1.1"
|
|
60
60
|
},
|
|
61
61
|
"prettier": "@rocicorp/prettier-config",
|
|
62
62
|
"scripts": {
|