Generate Drizzle schema from Prisma schema
npm install drizzle-prisma-generatorAutomatically generate Drizzle schema from Prisma schema
- Install generator: pnpm add -D drizzle-prisma-generator
- Add generator to prisma:
``Prisma`
generator drizzle {
provider = "drizzle-prisma-generator"
output = "./src/schema.ts"
}.ts
:warning: - if output doesn't end with , it will be treated like a folder, and schema will be generated to schema.ts inside of it. MySQL
:warning: - binary types in , PostgreSQL are not yet supported by drizzle-orm, therefore will throw an error. postgresql
:warning: - generator only supports , mysql, sqlite data providers, others will throw an error.
- Install drizzle-orm: pnpm add drizzle-orm`
- Import schema from specified output file\folder
- Congratulations, now you can use Drizzle ORM with generated schemas!