Drizzle ORM Open-source TypeScript SQL data layer with SQL-like and relational queries, plus optional schema migration tooling.
Overview Drizzle ORM is an open-source data-access library for JavaScript and TypeScript applications. It describes SQL tables in code and offers SQL-like queries alongside a higher-level relational query API. Drizzle Kit supplies separate schema and migration tooling. It is useful when building a custom application around an existing or new SQL database; it is not itself a managed database or complete backend service.[2] [3]
Contents Data access in application code A Drizzle application describes tables in JavaScript or TypeScript and builds queries against them. Developers can retain a SQL-shaped model of selects and joins, or use the relational API for related records. The repository describes PostgreSQL, MySQL and SQLite integrations, including hosted and serverless providers. Its broad runtime claims should be read together with the selected database driver: a library's portability does not establish that every driver works in every deployment.[2]
Choosing the schema's source of truth For an existing database managed elsewhere, Kit can pull its structure into TypeScript declarations while another system continues to own migrations. For a code-first application, declarations become the intended structure. Kit can generate SQL migration files and later apply them, or hand those files to an external runner. This choice determines which artifacts a team reviews and versions; it is more consequential than selecting a convenient command for a prototype.[3]
Direct schema changes The push workflow compares the code schema with the connected database, derives SQL differences and applies them without generating a migration-file history in the usual workflow. That is convenient for iteration, but it is a database-changing operation, not a harmless type-generation step. As an operational assessment, generated changes and the selected connection should be reviewed before affecting valuable data. The documented sequence does not justify treating a successful push as a backup or a tested rollback.[4]
Relations and database constraints Drizzle's soft relations describe how application queries traverse tables. They do not implicitly create foreign keys or modify the database schema. Consequently, an application can successfully query a modeled relationship without the database enforcing the corresponding integrity rule. The inspected relation guide also uses RC packages and defineRelations. Copying it into a differently pinned starter may require version-specific adaptation rather than merely changing an import.[5]
Distribution and licensing The repository uses Apache-2.0, permitting use and redistribution under its notice and other conditions. That license governs the covered source, not a database provider's hosting contract. Drizzle's library and optional tooling let an application use its chosen infrastructure, but operating that infrastructure, configuring connections and maintaining schema changes remain separate responsibilities.[1] [2]
Substitution considerations Drizzle is a candidate replacement for Prisma ORM when the requirement is a typed SQL data layer and a schema-change workflow. The assessment concerns application functionality, not source compatibility: Prisma's contract and query interfaces differ, so swapping a dependency is insufficient. A migration needs representative query, relation and schema-change checks. No installation, throughput comparison or live database migration was performed for this article.[2] [3] [6]
Also included: 4 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.