Skip to content

sukeshpabolu/drizzle-prisma-generator

 
 

Repository files navigation

Drizzle Prisma Generator

Automatically generate Drizzle schema from Prisma schema

Usage

  • Install generator: pnpm add -D drizzle-prisma-generator
  • Add generator to prisma:
generator drizzle {
  provider = "drizzle-prisma-generator"
  output = "./src/schema.ts"
  version = "v1"
}

⚠️ - if output doesn't end with .ts, it will be treated like a folder, and schema will be generated to schema.ts inside of it.
⚠️ - binary types in MySQL, PostgreSQL are not yet supported by drizzle-orm, therefore will throw an error.
⚠️ - generator only supports postgresql, mysql, sqlite data providers, others will throw an error.
⚠️ - currently the supported value for version is v1. if version is not provided, the relations file for rabv2 is generated and saved inside the parent folder of schema.ts as relations.ts

  • Install drizzle-orm: pnpm add drizzle-orm
  • Import schema from specified output file\folder
  • Congratulations, now you can use Drizzle ORM with generated schemas!

About

Generate Drizzle schema from Prisma schema

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 95.0%
  • JavaScript 5.0%