Lets say I have this Prisma Schema:
model User {
id String @id @unique @default(dbgenerated("gen_random_uuid()")) @db.Uuid
email String @unique
username String
}
Is there a way I can get lets say email's type in my app?
Prisma by default generates types for all your models. You could import it like this:
import { PrismaClient, User } from '@prisma/client';
Your models will always be in sync with your schema file, anytime you change the schema file, you could execute npx prisma generate
to update the PrismaClient and the generated types for your models.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.