You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/prisma-client-types-generator/README.md
+24-7Lines changed: 24 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
A tool to generate TypeScript types from your Prisma schema, can be safely imported on the browser.
4
4
5
+
**✨ Now supports Prisma 7!**
6
+
5
7
## what does it do
6
8
7
9
This package generates TypeScript types from your Prisma schema file that can be safely used in browser environments. Unlike the types generated by Prisma Client, these types:
@@ -13,7 +15,16 @@ This package generates TypeScript types from your Prisma schema file that can be
13
15
14
16
This is particularly useful when you want to share types between your backend and frontend code without bringing in the full Prisma Client library to the browser.
15
17
16
-
For example, if you have a Prisma model it will generate:
18
+
## Requirements
19
+
20
+
- Prisma 7.x or higher
21
+
- TypeScript 5.x or higher
22
+
23
+
For Prisma 6 support, use version 1.0.x of this package.
24
+
25
+
## What it generates
26
+
27
+
For each Prisma model it will generate:
17
28
18
29
- ModelValues => the scalars
19
30
- ModelKeys => the unique keys
@@ -36,6 +47,10 @@ generator types {
36
47
### 2. Example Prisma Schema
37
48
38
49
```prisma
50
+
generator client {
51
+
provider = "prisma-client"
52
+
}
53
+
39
54
model User {
40
55
id Int @id @default(autoincrement())
41
56
email String @unique
@@ -96,13 +111,15 @@ async function fetchUser(id: number): Promise<UserExtended> {
96
111
You can customize the generator output using configuration options in your `schema.prisma`:
0 commit comments