What is Drizzle ORM?
Drizzle ORM is a lightweight, TypeScript-native ORM for PostgreSQL, MySQL, and SQLite. Unlike Prisma, schemas are defined in TypeScript code using builder functions (pgTable, mysqlTable, sqliteTable), giving full type inference without a separate schema file.
Why Generate from JSON?
When building API-backed applications, you often have sample JSON from an existing API or database. Generating a Drizzle schema from that sample saves 10–20 minutes of manual mapping per table.
Column Type Mapping per Dialect
- PostgreSQL:
text(),integer(),doublePrecision(),boolean(),timestamp() - MySQL:
varchar(),int(),double(),tinyint(),datetime() - SQLite:
text(),integer(),real(),integer()(bool),text()(date)