# Drizzle ORM — card for AI agents

TypeScript ORM for SQL databases with type safety and zero-runtime overhead.

Category: Databases, ORMs and clients · npm package `drizzle-orm` · latest version 0.45.4 (checked 2026-11-01)
Install: `npm install drizzle-orm`
License: Apache-2.0 (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## Drizzle ORM
- Define and manage the database schema in TypeScript with the dialect's table helper, for example `pgTable` from `drizzle-orm/pg-core`.
- For flat reads, joins and filters, use the SQL-like builder (`db.select().from(...).leftJoin(...).where(...)`).
- For nested relational data, use `db.query.<table>.findMany({ with: { ... } })` instead of hand-built joins. The docs say it outputs exactly one SQL query.
- Run schema changes through Drizzle Kit, which either generates SQL migration files or applies changes directly to the database.
- For Expo SQLite, OP SQLite and React Native migrations, follow the Get Started guide. The dedicated web and mobile page is not written yet.
- Check the installed version first. The project is on 0.x, minor releases have shipped breaking changes, and the docs have separate v0 to v1 and Relational Queries v1 to v2 guides.
- For runtime validation, use the integrations listed under Validations in the docs (zod, valibot, typebox, arktype, effect-schema).

## Docs written for agents
- [llms.txt (index of the docs)](https://orm.drizzle.team/llms.txt)

## What it is
- Drizzle ORM is a TypeScript ORM published as `drizzle-orm` on npm under the Apache-2.0 license. The repository was created on 2021-06-24. The maintainers describe it as "lightweight at only ~7.4kb minified+gzipped", tree shakeable, and with "exactly 0 dependencies". It targets PostgreSQL, MySQL, SQLite and SingleStore, and the docs also list MSSQL and CockroachDB.
- You declare tables in TypeScript and then query them in one of two styles. The SQL-like builder reads like SQL: `select`, `from`, `leftJoin`, `where`. The relational Queries API fetches nested data with calls like `db.query.users.findMany({ with: { posts: true } })`. A companion CLI, Drizzle Kit, handles migrations, and Drizzle Studio is a data browser.
- The README pitches it at projects on serverless and edge platforms: "no Rust binaries, no serverless adapters". The docs address developers who already know SQL and want typed access without a framework dictating project structure. The latest release is 0.45.4, and the docs already carry a v0 to v1 upgrade guide.

## Caveats
- Still on 0.x, with breaking changes in minor releases: The latest release is 0.45.4. The site's changelog flags breaking changes in minor versions. For example, ORM v0.33.0 changed how `jsonb` is inserted with `postgres-js`.
- A v1 migration is coming: The docs navigation includes an upgrade guide from v0 to v1. A separate section covers moving the relational queries API from v1 to v2. Expect code changes when you upgrade.
- Team migration workflow is undocumented: The "Migrations for teams" page has no content yet. It says it is waiting on a new migrations folder structure and points to a GitHub discussion.
- Mobile migrations live in the Get Started guide: The page on web and mobile migrations is a placeholder. For Expo SQLite, OP SQLite and React Native, it sends readers to the Get Started guide instead.

## Numbers (AgentGid data)
- Gid Score: 86.1 (#28 of all tools, 1 of 120 in its category)
- Used in 253 public projects set up for AI coding agents (4.0%)
- Downloads last week: 49,635,806 (as of 2026-11-24), +72.7% over 4 weeks
- GitHub stars: 36,369 (as of 2026-11-24)
- Last push: 2026-11-20

## Often used with
Drizzle Kit 94.5%, Zod 75.5%, tsx 52.6%, Class Variance Authority 53.4%, clsx 57.3%, dotenv 51.8%

## Checked alternatives (same job)
- Prisma: https://agentgid.com/tools/prisma/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/drizzle-orm/
- Homepage: https://orm.drizzle.team
- Repository: https://github.com/drizzle-team/drizzle-orm
- Source: https://github.com/drizzle-team/drizzle-orm#readme
- Source: https://github.com/drizzle-team/drizzle-orm
- Source: https://github.com/drizzle-team/drizzle-orm/releases
- Source: https://orm.drizzle.team
- Source: https://orm.drizzle.team/llms.txt
- Source: https://orm.drizzle.team/docs/overview
- Source: https://orm.drizzle.team/docs/kit-migrations-for-teams
- Source: https://orm.drizzle.team/docs/kit-web-mobile

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
