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.

Metricdrizzle-ormknex
Weekly downloads9,868,4113,940,390
Monthly downloads39,472,03117,423,302
GitHub stars34,62620,285
Minified size27.3 kB314.3 kB
Minified + gzipped8.4 kB86.2 kB
Dependencies014
Open issues1,818715
Last commit2026-06-012026-05-04
Latest version0.45.23.2.10
LicenseApache-2.0MIT

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

Featuredrizzle-ormknex
ApproachORM / query builderQuery builder
Type safetyInferred (no codegen)Limited
Built-in migrations✓ Yes✓ Yes
DatabasesPostgreSQL / MySQL / SQLiteSQL only
PatternSQL-like functionalSQL query builder

drizzle-orm

Drizzle ORM package for SQL databases

knex

A batteries-included SQL query & schema builder for PostgresSQL, MySQL, CockroachDB, MSSQL and SQLite3

Related comparisons

Embed this comparison

A live badge for your README — it updates as the numbers change.

drizzle-orm vs knex downloads
[![drizzle-orm vs knex](https://devcompare.dev/badge/drizzle-orm-vs-knex.svg)](https://devcompare.dev/compare/drizzle-orm-vs-knex)

Data from npm, Bundlephobia and GitHub. Last updated 2026-06-02.