drizzle-orm vs knex
drizzle-orm is downloaded 2.3× more often than knex (39,472,031 vs 17,423,302 per month), so it has the larger community and more answered questions online. drizzle-orm ships 90% less gzipped JavaScript (8.4 kB vs 86.2 kB), which matters if bundle size is a priority. Both projects are actively maintained.
| Metric | drizzle-orm | knex |
|---|---|---|
| Weekly downloads | 9,868,411✓ | 3,940,390 |
| Monthly downloads | 39,472,031✓ | 17,423,302 |
| GitHub stars | 34,626✓ | 20,285 |
| Minified size | 27.3 kB✓ | 314.3 kB |
| Minified + gzipped | 8.4 kB✓ | 86.2 kB |
| Dependencies | 0✓ | 14 |
| Open issues | 1,818 | 715✓ |
| Last commit | 2026-06-01✓ | 2026-05-04 |
| Latest version | 0.45.2 | 3.2.10 |
| License | Apache-2.0 | MIT |
When to choose which
drizzle-orm
Type-safe, SQL-like ORM with a tiny runtime.
Choose it when: Type-safe SQL with minimal abstraction and no codegen — great for serverless/edge where bundle size and cold starts matter.
- + Fully type-safe, no codegen
- + SQL-like & tiny
- + Edge/serverless friendly
- - Younger ecosystem
- - You work closer to raw SQL
knex
A SQL query builder, not a full ORM.
Choose it when: You want to compose SQL programmatically (and run migrations) without the abstraction of a full ORM.
- + Close to SQL
- + Built-in migrations
- + Lightweight
- - No models or generated types
- - Lower-level
Feature comparison
| Feature | drizzle-orm | knex |
|---|---|---|
| Approach | ORM / query builder | Query builder |
| Type safety | Inferred (no codegen) | Limited |
| Built-in migrations | ✓ Yes | ✓ Yes |
| Databases | PostgreSQL / MySQL / SQLite | SQL only |
| Pattern | SQL-like functional | SQL query builder |
Related comparisons
Embed this comparison
A live badge for your README — it updates as the numbers change.
[](https://devcompare.dev/compare/drizzle-orm-vs-knex)Data from npm, Bundlephobia and GitHub. Last updated 2026-06-02.