Skip to content
Share on
Updated

Introduction

Choosing a database library for a Node.js or TypeScript application is a decision you live with for a long time: it shapes how you model data, how you write queries and how you change your schema. There are many options, and they differ in their level of abstraction, their TypeScript support, the databases and runtimes they work with, and how actively they're maintained.

This article collects the information you'd look up before choosing, for the most widely used ORMs and query builders. It doesn't rank them or pick a winner: which library fits depends on your database, your team and how you like to work.

This guide is published by Prisma, which develops Prisma ORM, one of the libraries compared here. To keep the comparison fair, every library gets the same structure, all figures come from public sources you can check, and every section describes trade-offs, including Prisma ORM's.

All figures were collected on September 30, 2026. They change quickly, so check the linked repositories and npm pages before you decide.

What's covered

  • ORMs: Drizzle ORM, MikroORM, Prisma ORM, Sequelize and TypeORM
  • ODM for MongoDB: Mongoose
  • Query builders: Knex.js and Kysely
  • Libraries with little or no recent development: Bookshelf.js, Objection.js, Waterline and MassiveJS
  • Other notable libraries: database drivers and SQL-first libraries such as pg-promise and Slonik

Within each group, libraries are listed alphabetically.

The set differs from the 2022 edition of this article. Drizzle ORM and Kysely are new: they now have the most npm downloads of the ORMs and query builders compared here. MikroORM moved from "other notable" to a full section because it's now one of the most actively developed ORMs. Bookshelf.js, Objection.js and Waterline moved to a shorter section because they've had little or no development since (the evidence is below).

Criteria

CriterionWhat it tells youMeasured by
PopularityHow widely the library is installednpm downloads in 30 days, the change from the same 30 days in 2025, GitHub stars
ActivityWhether the library is being developedStable releases, commits and commit authors in the last 12 months; date of the latest stable release
Maintenance and supportWho keeps it running, and where you can get helpWho maintains it and how that's funded, documentation, community channels, open issues
MaturityHow settled the API isAge, current major version, whether a new major version is in alpha, beta or release candidate
TypeScriptWhere the types come fromThe project's documentation
Databases and runtimesWhether it works with your database and deploymentThe project's documentation (Node.js versions, Bun, Deno, edge runtimes), only what the docs state
MigrationsHow you change the database schemaThe project's documentation
LicenseWhether you can use itnpm and GitHub

This article doesn't measure how precisely each library types query results. That's the subject of the companion article, Evaluating type safety in TypeScript ORMs.

How to read the numbers

  • npm downloads count every install, including CI runs and installs as a dependency of another package. For example, kysely is a dependency of better-auth and of MikroORM 7's @mikro-orm/sql, and drizzle-orm is a dependency of Payload's PostgreSQL adapter, @payloadcms/db-postgres. Downloads measure how widely a package is installed, not how many projects chose it.
  • Download growth was high across the whole npm registry: between the same 30 days in 2025 and 2026, downloads of express grew by 169% and react by 273%. Compare growth figures between libraries rather than reading them as adoption on their own.
  • Stars accumulate over a project's lifetime and say little about current use.
  • Commits depend on workflow: some projects squash each pull request into one commit, others commit in many small steps. One rule applies to every project: a commit isn't counted if its GitHub account ends in [bot] or its commit author name ends in "bot". That excludes Dependabot, Renovate, GitHub Actions, release bots and coding agents that commit under a bot name. Contributors are the distinct accounts behind the remaining commits. The share of the most active account shows how much a project depends on one person; an account can be a person or an automation working on their behalf.
  • Open issues reflect how a project triages as much as the quality of the code.

Downloads are for the 30 days from August 30 to September 28, 2026 (npm's "last month" window), compared with August 30 to September 28, 2025. Commits and contributors are for the default branch between September 30, 2025 and September 30, 2026, except for Drizzle ORM (see the note under the activity table).

SQL, query builders and ORMs

Database libraries work at different levels of abstraction. From lowest to highest:

  • Database drivers such as pg (node-postgres) connect to the database and send the SQL you write.
  • Query builders such as Kysely and Knex.js let you build SQL with JavaScript or TypeScript method calls. You still think in tables, joins and columns.
  • Object-relational mappers (ORMs) such as Prisma ORM, TypeORM and Sequelize let you work with models that correspond to tables, and load related records for you. An ODM (object-document mapper) such as Mongoose does the same for a document database.

Many libraries blur these lines. Drizzle ORM, for example, has both an SQL-like query builder and a relational query API, and most ORMs let you drop down to raw SQL. To learn more about the trade-offs between the levels, read Comparing SQL, query builders, and ORMs.

Summary

Overview

LibraryTypeModels defined withLatest stable releaseDatabasesLicense
Drizzle ORMORMTypeScript table definitions0.45.3 (1.0 in RC)PostgreSQL, MySQL, SQLite, SingleStore, Gel (0.45 only); SQL Server and CockroachDB in 1.0 RCApache-2.0
MikroORMORMdefineEntity, decorators or EntitySchema7.2.2PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle, MongoDBMIT
Prisma ORMORMPrisma schema file7.10.0 (8.0 in RC)PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, CockroachDB (Prisma ORM 7)Apache-2.0
SequelizeORMModel.init() or sequelize.define()6.37.8 (7.0 in alpha)PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle, Db2, SnowflakeMIT
TypeORMORMDecorated classes or EntitySchema1.1.1PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle, SAP HANA, CockroachDB, Spanner, MongoDBMIT
MongooseODMSchema objects9.10.3MongoDBMIT
Knex.jsQuery builderNo models3.3.0PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle, CockroachDB, Amazon RedshiftMIT
KyselyQuery builderA TypeScript interface that describes your tables0.29.6 (0.30 in beta)PostgreSQL, MySQL, SQL Server, SQLite, PGlite, plus community dialectsMIT

Popularity

Librarynpm packageDownloads (30 days)Change from 2025GitHub stars
Drizzle ORMdrizzle-orm90.2M+951%35.9k
MikroORM@mikro-orm/core3.7M+211%9.2k
Prisma ORM@prisma/client65.2M+309%47.7k
Sequelizesequelize11.0M+22%30.4k
TypeORMtypeorm20.0M+82%36.7k
Mongoosemongoose26.5M+72%27.5k
Knex.jsknex20.7M+102%20.3k
Kyselykysely68.9M+1,385%14.2k

@prisma/client is the package that Prisma ORM 7 and earlier apps import. Prisma ORM 8 apps import @prisma/orm-postgres or @prisma/orm-mongo instead, which had about 180,000 and 47,000 downloads in the same 30 days.

Activity

LibraryLatest stable releaseStable versions (12 months)Commits (12 months)Contributors (12 months)Most active account's shareOpen issues
Drizzle ORM0.45.3, Sept 21, 202661,3212035%1,383
MikroORM7.2.2, Sept 28, 2026571,0265686%16
Prisma ORM7.10.0, Aug 25, 2026237,9263182%2,574
Sequelize6.37.8, Mar 7, 20261932144%934
TypeORM1.1.1, Sept 1, 202674608341%453
Mongoose9.10.3, Sept 29, 2026721,93810168%160
Knex.js3.3.0, June 26, 2026121274728%578
Kysely0.29.6, Sept 16, 2026172492987%140
  • "Stable versions" counts versions published to npm without a prerelease tag, on every release line a project maintains. The counts for MikroORM (6.x), Prisma ORM (6.x), TypeORM (0.3.x) and Mongoose (6.x to 8.x) include releases for older major versions.
  • Drizzle ORM develops 1.0 on working branches that are merged into its beta branch when a prerelease is published (for example, the rc4 branch for 1.0.0-rc.4). Its commits are counted on rc5, the branch for the next release candidate, which contains all of beta plus 258 newer commits. Its default branch, which holds 0.45.x, had 65 commits in the same period. Prisma ORM's default branch holds Prisma ORM 8, and Sequelize's holds Sequelize 7.

Drizzle ORM

At a glance

  • Type: ORM with an SQL-like query builder and a relational query API
  • Latest release: 0.45.3 (September 21, 2026). Version 1.0 is a release candidate: the latest one, 1.0.0-rc.4, was published on June 27, 2026, and only builds of the next one, tagged with a commit hash, have been published since. The Drizzle documentation already installs the release candidate (drizzle-orm@rc).
  • Databases: PostgreSQL, MySQL, SQLite, SingleStore and Gel, including serverless services such as Neon, Supabase, Turso, PlanetScale and Cloudflare D1. The 1.0 release candidate adds SQL Server and CockroachDB; its package doesn't include the Gel driver (drizzle-orm/gel), although the docs still describe it.
  • Runtimes: according to the README, Node.js, Bun, Deno, Cloudflare Workers, Supabase functions, other edge runtimes and browsers
  • TypeScript: you define tables in TypeScript, and query types are inferred from those definitions without a code generation step
  • Schema and migrations: Drizzle Kit, a separate CLI, generates SQL migration files from changes to your schema, or pushes changes directly to the database
  • License: Apache-2.0 (drizzle-orm), MIT (drizzle-kit)
  • Links: Website, GitHub, npm

How it works

Drizzle describes itself as a "headless" ORM and a thin typed layer on top of SQL. You declare tables with functions such as pgTable(), and write queries with an API that mirrors SQL: select, from, join and where. A second API, relational queries, loads nested related records without writing the joins yourself. The drizzle-orm package has no dependencies of its own; you install the driver for your database next to it.

A join that fetches the posts of a user with a given email:

const rows = await db
.select({ title: posts.title, author: users.name })
.from(posts)
.innerJoin(users, eq(posts.userId, users.id))
.where(eq(users.email, 'alice@example.com'))

Project health

Drizzle ORM had the most npm downloads of the ORMs and query builders compared here: 90.2 million in 30 days, about ten times as many as a year earlier. These downloads include installs as a dependency of other packages, such as Payload's PostgreSQL adapter. It's developed by the Drizzle Team. According to the project's sustainability page, PlanetScale hired the entire core team in March 2026 so they can work on Drizzle full time. Version 1.0 is developed on working branches that are merged into the beta branch when a prerelease is published. The branch for the next release candidate, rc5, holds 1,321 commits from 20 people made in the past year, spread across several core team members; no release candidate has been published since June 27, 2026. Support is through Discord and GitHub, where 1,383 issues were open.

Trade-offs

Drizzle suits you if you like writing queries that look like SQL and want types without a code generation step, and it's one of the libraries whose documentation explicitly covers edge runtimes. On the other hand, it hasn't reached 1.0: the stable release is 0.45.3 while the documentation targets the release candidate, and the upgrade guide describes breaking changes to the relational query API and to Drizzle Kit's migration folders. The team is small (20 commit authors in the past year), and the number of open issues is high.

MikroORM

At a glance

  • Type: ORM based on the Data Mapper, Unit of Work and Identity Map patterns
  • Latest release: 7.2.2 (September 28, 2026). MikroORM 7.0.0 was released on March 11, 2026.
  • Databases: PostgreSQL (including CockroachDB and PGlite), MySQL, MariaDB, SQLite (including libSQL), SQL Server, Oracle and MongoDB
  • Runtimes: MikroORM 7 requires Node.js 22.17 or later and is an ES module. The deployment docs explain how to run on Cloudflare Workers and other edge runtimes that don't allow eval, and the README links a Bun example app.
  • TypeScript: written in TypeScript; entity types are inferred from defineEntity() definitions, or taken from decorated classes
  • Schema and migrations: a schema generator, and migrations generated from the difference between your entities and the database
  • License: MIT
  • Links: Website, GitHub, npm

How it works

MikroORM is influenced by Doctrine and Hibernate. An EntityManager keeps track of every entity you load (the identity map). You change entities as plain objects, and calling em.flush() works out what changed and writes all of it in a single transaction (the unit of work). For queries the ORM API can't express, MikroORM has its own query builder and, since version 7, an integration with Kysely, which replaced Knex.js as its query runner.

A user and their posts:

const user = await em.findOne(
User,
{ email: 'alice@example.com' },
{ populate: ['posts'] }
)

Project health

MikroORM is less widely installed than the other ORMs here (3.7 million downloads in 30 days), but it's one of the most active: 57 stable releases, 1,026 commits from 56 people, and only 16 open issues. It's led by its author, Martin Adámek, who made 86% of those commits and accepts sponsorships through GitHub Sponsors. Support is through Discord and GitHub.

Trade-offs

MikroORM suits applications with complex domain models, where change tracking and automatic transactions save work, and it supports both SQL databases and MongoDB. The unit of work model takes time to learn: in a web server each request needs its own identity map (the docs describe a RequestContext helper for this), and changes are written only when you flush. Version 7 raised the minimum requirements to Node.js 22.17 and TypeScript 5.8. The project depends heavily on its lead maintainer.

Prisma ORM

At a glance

  • Type: ORM with a client generated from a schema
  • Latest release: Prisma ORM 7.10.0 (@prisma/client, August 25, 2026) is the current generally available version. Prisma ORM 8 is a release candidate (prisma 8.0.0-rc.19, September 29, 2026), and the release status page expects general availability in October 2026.
  • Databases: Prisma ORM 7 supports PostgreSQL, MySQL, MariaDB, SQL Server, SQLite and CockroachDB; for MongoDB, its docs point to Prisma ORM 6.19, which gets security patches until November 19, 2026. Prisma ORM 8 supports PostgreSQL (release candidate), MongoDB (early access) and SQLite (experimental), and lists the others as coming.
  • Runtimes: Prisma ORM 7 requires Node.js 20.19+, 22.12+ or 24+, and its docs cover Bun, Deno, Cloudflare Workers and Vercel Edge Functions. Prisma ORM 8 requires Node.js 22.18 or later (24.11 or later on the 24 line), and its guides cover Bun, Deno and Cloudflare Workers.
  • TypeScript: types are generated from the schema by the Prisma CLI
  • Schema and migrations: models are written in the Prisma schema language (Prisma ORM 8 also accepts a TypeScript builder). Migrations are planned from schema changes: SQL files in Prisma ORM 7, TypeScript files in Prisma ORM 8.
  • License: Apache-2.0
  • Links: Website, GitHub, npm: prisma, npm: @prisma/orm-postgres

How it works

Prisma ORM doesn't define models as classes. You describe them in a schema file, and Prisma generates a client from it whose methods and result types match your models. Queries return plain objects. The same schema is the source for migrations: when you change it, Prisma plans the changes that bring the database in line.

Prisma ORM 8, a rewrite in TypeScript, keeps this schema-first workflow (the schema is now called the contract) but changes the query API, the migration workflow and the packages: apps import one package per database, such as @prisma/orm-postgres, instead of @prisma/client.

A user and their posts in Prisma ORM 7:

const user = await prisma.user.findUnique({
where: { email: 'alice@example.com' },
include: { posts: true },
})

The same query in the Prisma ORM 8 release candidate:

const user = await db.orm.public.User.where({ email: 'alice@example.com' })
.include('posts')
.first()

Project health

Prisma ORM is developed by the company Prisma, which employs its maintainers. Its default branch, which holds Prisma ORM 8, had 7,926 commits from 31 people in the past year; 82% of them came from one maintainer's account. @prisma/client had 65.2 million downloads in 30 days. With 2,574 open issues, Prisma ORM has the largest issue backlog in this comparison. Support is through Discord and GitHub.

Trade-offs

Prisma ORM suits teams that want one schema as the source of truth for types and migrations, and a query API that doesn't require writing joins. Right now, though, it's in a transition. Prisma ORM 8 is the version the docs recommend for new projects, but it's a release candidate: it supports fewer databases than Prisma ORM 7, features such as filtering inside JSON columns, most nested writes and transaction isolation levels aren't available yet, and $extends won't be added because middleware replaces it (see Coming from Prisma ORM 7). Moving from 7 to 8 means learning a new query API. Prisma ORM 7 gets bug fixes and security updates for 18 months after 8 is final, but the prisma package's latest tag already points to the Prisma ORM 8 release candidate, so Prisma ORM 7 projects need to pin version 7. Both versions need a generation step after every schema change, which Drizzle doesn't.

Sequelize

At a glance

  • Type: ORM (Active Record style)
  • Latest release: 6.37.8 (March 7, 2026). Sequelize 7 has been in alpha since at least February 2022, when the first @sequelize/core package was published; its latest alpha is 7.0.0-alpha.48.
  • Databases: Sequelize 6 supports PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle, Db2 and Snowflake (Snowflake support isn't handled by the core team), according to its version compatibility table
  • Runtimes: Node.js 10 or later, according to the compatibility table
  • TypeScript: Sequelize ships its own type definitions, but its TypeScript documentation says some parts are still a work in progress and recommends the community sequelize-typescript package in the meantime
  • Schema and migrations: sync() creates tables from models; migrations are JavaScript files with up and down functions that you write and run with the Sequelize CLI
  • License: MIT
  • Links: Website, GitHub, npm

How it works

Sequelize is the oldest ORM here (first published on npm in 2011). You define models with Model.init() or sequelize.define(), declare associations such as hasMany() and belongsTo(), and query through static methods on the model classes. It supports transactions, eager and lazy loading, and read replication.

A user and their posts (eager loading):

const user = await User.findOne({
where: { email: 'alice@example.com' },
include: Post,
})

Project health

Sequelize is still widely installed (11.0 million downloads in 30 days), but its growth (+22%) was the lowest of the libraries in the main comparison, well below the npm registry as a whole. Sequelize 6 had one release in the past 12 months. The default branch, where Sequelize 7 is developed, had 93 commits from 21 people, and 934 issues were open. The README says the project is "seeking new maintainers" to finish the next major version, and that maintainers are paid from its Open Collective. Support is through Slack, GitHub Discussions and Stack Overflow.

Trade-offs

Sequelize supports more databases than most libraries here and has a long track record, so a large body of answers and examples exists. For a new project, weigh that against slow development: the next major version has been in alpha for more than four years, the stable version gets few releases, and its TypeScript support is incomplete by its own documentation.

TypeORM

At a glance

  • Type: ORM that supports both the Active Record and Data Mapper patterns
  • Latest release: 1.1.1 (September 1, 2026). TypeORM 1.0 was released on May 19, 2026; the 0.3.x line still gets releases (0.3.31 on July 13, 2026).
  • Databases: PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle, SAP HANA, CockroachDB, Google Spanner, MongoDB and sql.js
  • Runtimes: TypeORM 1.1 requires Node.js 20.19+, 22.13+ or 24.11+. The supported platforms page also covers browsers (with sql.js), Capacitor, Cordova and Ionic, Expo, NativeScript and React Native.
  • TypeScript: written in TypeScript; entities are usually classes with decorators, which need the experimentalDecorators and emitDecoratorMetadata compiler options and the reflect-metadata package
  • Schema and migrations: can generate migrations from changes to your entities
  • License: MIT
  • Links: Website, GitHub, npm

How it works

TypeORM is influenced by Hibernate, Doctrine and Entity Framework. You define entities as classes with decorators such as @Entity() and @Column(), and work with them through repositories (Data Mapper) or through methods on the entities themselves (Active Record). A query builder covers queries that the repository API can't express.

A user and their posts:

const user = await dataSource.getRepository(User).findOne({
where: { email: 'alice@example.com' },
relations: { posts: true },
})

Project health

TypeORM was created by Umed Khudoiberdiev in 2016. According to the maintainers page, maintenance passed to David Höck and Michael Bromley in late 2024, and they put together the current team. Since then the project released 1.0, which removes long-deprecated APIs and requires Node.js 20 (see the 1.0 release notes). In the past year it had 460 commits from 83 people, the broadest contributor base of the SQL ORMs here, and 453 open issues. typeorm had 20.0 million downloads in 30 days. Support is through Discord and Stack Overflow, and the core team offers commercial support.

Trade-offs

TypeORM suits teams that like class-based entities, such as those coming from Hibernate or using NestJS, and it supports the widest range of databases here. Upgrading from 0.3 to 1.0 involves breaking changes, described in the upgrade guide. Decorator-based entities depend on TypeScript's experimental decorators. For how precisely TypeORM types query results compared with the other libraries, see the type safety article.

Mongoose

At a glance

  • Type: ODM (object-document mapper) for MongoDB
  • Latest release: 9.10.3 (September 29, 2026). Mongoose 9.0.0 was released on November 21, 2025.
  • Databases: MongoDB. The compatibility page lists which Mongoose versions support which MongoDB server versions.
  • Runtimes: Mongoose 9 requires Node.js 20.19 or later; the README lists Deno support as alpha
  • TypeScript: ships its own type definitions and infers document types from schema definitions
  • Schema and migrations: schemas are defined and validated in your application, not in the database; Mongoose doesn't include a migration tool
  • License: MIT
  • Links: Website, GitHub, npm

How it works

MongoDB doesn't require documents in a collection to share a structure. Mongoose adds that structure in your application: you define a schema with types, defaults and validators, compile it into a model, and query through the model. Middleware (hooks) runs before and after operations, and populate() replaces references with the documents they point to.

A user and their posts, using a virtual posts field:

const user = await User.findOne({
email: 'alice@example.com',
}).populate('posts')

populate() isn't a join: in the example above, Mongoose runs one query on users and a second query on posts.

Project health

Mongoose has been developed since 2010 and lives in Automattic's GitHub organization. It had the most contributors in this comparison: 1,938 commits from 101 people in the past year (68% of them from its most active maintainer) and 72 stable releases, with 160 open issues. mongoose had 26.5 million downloads in 30 days. Support is through Slack, Stack Overflow and GitHub.

Trade-offs

If you use MongoDB from Node.js and want schemas, validation and middleware, Mongoose is the established choice. It works only with MongoDB. Because the schema lives in your application, documents written by other applications or before a schema change don't necessarily match it. Other libraries in this comparison also support MongoDB: MikroORM, TypeORM and Prisma ORM (early access in Prisma ORM 8). You can also use the MongoDB Node.js driver directly.

Knex.js

At a glance

  • Type: SQL query builder
  • Latest release: 3.3.0 (June 26, 2026)
  • Databases: PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle, CockroachDB and Amazon Redshift
  • Runtimes: Node.js 16 or later. The docs also describe a browser build, but warn that composing SQL in the browser for execution on the server is "highly discouraged" because it can cause serious security vulnerabilities.
  • TypeScript: written in JavaScript, with official type definitions that the docs call "best-effort". You pass row and result types as generic parameters, or declare your tables once by augmenting Knex's Tables interface.
  • Schema and migrations: a schema builder and a CLI for migrations and seed files, which you write by hand
  • License: MIT
  • Links: Website, GitHub, npm

How it works

Knex.js builds SQL from chained method calls and runs it through the driver for your database. It handles connection pooling, transactions and streaming queries. It has no models: Objection.js and Bookshelf.js were built on top of it to add them, and MikroORM used it until version 7.

The posts of a user with a given email:

const rows = await db('posts')
.join('users', 'users.id', 'posts.user_id')
.where('users.email', 'alice@example.com')
.select('posts.title', 'users.name as author')

Project health

Knex.js has been around since 2013 and is developed in the knex GitHub organization by a group of contributors. In the past year it had 12 stable releases and 127 commits from 47 people, the least concentrated contributor base in this comparison; there have been no commits to the default branch since the 3.3.0 release on June 26, 2026. 578 issues were open. knex had 20.7 million downloads in 30 days, twice as many as a year earlier. Support is through GitHub issues and Gitter.

Trade-offs

Knex.js is mature, supports many databases and has a large ecosystem of plugins and tools, which makes it a dependable base for existing JavaScript code. It was designed before TypeScript became common, and its docs warn that a query that type-checks isn't guaranteed to generate correct SQL; if compile-time checking of your queries matters, compare it with Kysely. Development is slower than in most projects here.

Kysely

At a glance

  • Type: type-safe SQL query builder
  • Latest release: 0.29.6 (September 16, 2026). Kysely hasn't reached 1.0; version 0.30 is in beta.
  • Databases: built-in dialects for PostgreSQL, MySQL, SQL Server, SQLite and PGlite; the dialects page lists community dialects for services such as PlanetScale, Cloudflare D1, Neon and libSQL
  • Runtimes: Kysely 0.29 requires Node.js 22 or later, and according to the README it also runs on Deno, Bun, Cloudflare Workers and in browsers
  • TypeScript: written in TypeScript; you describe your tables in a TypeScript interface, either by hand or generated from the database with tools such as kysely-codegen, and Kysely infers the type of each query's result
  • Schema and migrations: migrations are TypeScript files with up and down functions that you write; you run them with the Migrator API or the kysely-ctl CLI
  • License: MIT
  • Links: Website, GitHub, npm

How it works

Kysely was inspired by Knex.js, but it was designed for TypeScript. It only lets you refer to tables and columns that are visible at that point in the query, and the result type contains exactly the selected columns, including aliases. There are no models and no relation loading: you write joins, and for nested results you use helpers such as jsonArrayFrom() on PostgreSQL.

The posts of a user with a given email:

const rows = await db
.selectFrom('posts')
.innerJoin('users', 'users.id', 'posts.user_id')
.select(['posts.title', 'users.name as author'])
.where('users.email', '=', 'alice@example.com')
.execute()

Project health

Kysely's downloads grew faster than those of any other library in the main comparison: 68.9 million in 30 days, about 15 times as many as a year earlier. These downloads include installs as a dependency of other packages, such as better-auth and MikroORM 7. In the past year it had 17 stable releases and 249 commits from 29 people, with 140 open issues. It's led by its author, Sami Koskimäki, and by Igal Klebanov, whose account made 87% of the past year's commits. Support is through Discord and GitHub.

Trade-offs

Kysely suits you if you want to write SQL-shaped queries with checked table and column names and inferred result types, without ORM abstractions, and its README lists edge runtimes such as Cloudflare Workers. You're responsible for keeping the TypeScript description of your tables in sync with the database (code generators help), and for writing migrations. It's still at 0.x, so minor versions can contain breaking changes, and day-to-day development depends mostly on one maintainer.

Libraries with little or no recent development

These libraries were covered in earlier editions of this article, and some are still widely installed. If you depend on one of them, don't expect new features or quick fixes, and plan how you'd handle a bug or a security issue yourself.

LibraryLatest releaseLatest commit to the default branchArchivedDownloads (30 days)
Bookshelf.js1.2.0, June 7, 2020February 28, 2021No237,000
MassiveJS6.11.3, Dec 7, 2024December 7, 2024No28,000
Objection.js3.1.5, Sept 25, 2024June 23, 2026No991,000
Waterline0.15.2, Dec 11, 2022December 11, 2022No134,000
  • Bookshelf.js, an ORM built on Knex.js, hasn't had a release in more than six years, and an issue asking whether it's maintained hasn't had an answer from a maintainer since it was opened in March 2022. Its latest release declares a peer dependency on knex versions >=0.15.0 <0.22.0, while the fix for a Knex.js SQL injection advisory (CVE-2016-20018) shipped in Knex.js 2.4.0. It's the only library in this article whose downloads fell over the year (−30%).
  • Objection.js, a "relational query builder" built on Knex.js, hasn't been developed by its author since 2022: in The future of Objection.js, he wrote that he wouldn't be working on it anymore. A long-time contributor took over maintenance in 2023 to keep it up to date and fix bugs, but in April 2026 he wrote that he hadn't found the time lately. The latest release is from September 2024. Objection.js's author also created Kysely.
  • Waterline is the ORM of the Sails framework. It hasn't had a release or a commit since December 2022, and its repository doesn't accept issues. It's still part of Sails, whose ORM hook, sails-hook-orm, depends on waterline@^0.15.0, and Sails itself had a release in May 2026.
  • MassiveJS, a data mapper for PostgreSQL that the 2022 edition listed as notable, has had no release or repository activity since December 2024.

Other notable libraries

Database drivers

Every library above uses a driver to talk to the database, and you can use a driver directly when you want to write SQL yourself. The most widely installed:

DriverDatabasenpm packageDownloads (30 days)Latest release
node-postgresPostgreSQLpg213.8M8.23.0, Aug 8, 2026
Postgres.jsPostgreSQLpostgres68.0M3.4.9, Apr 5, 2026
MySQL2MySQLmysql258.6M3.24.5, Sept 29, 2026
MongoDB Node.js driverMongoDBmongodb58.8M7.7.0, Sept 28, 2026
better-sqlite3SQLitebetter-sqlite342.3M13.0.3, Aug 5, 2026
  • pg is what most of the libraries above use to connect to PostgreSQL, including Drizzle ORM's node-postgres driver, Kysely's PostgresDialect, Knex.js and Prisma ORM's @prisma/adapter-pg. It has a pure JavaScript client and optional native libpq bindings.
  • Postgres.js builds queries with tagged template literals, which send values as parameters instead of interpolating them into the SQL string.
  • better-sqlite3 has a synchronous API. Node.js also has a built-in node:sqlite module, marked as a release candidate in Node.js 24.
  • The older mysql package (5.1 million downloads in 30 days) hasn't had a release since version 2.18.1 on January 23, 2020, and TypeORM 1.0 dropped support for it in favor of mysql2.

Other databases have their own drivers, such as mssql and tedious for SQL Server, oracledb for Oracle, and @libsql/client for libSQL and Turso.

SQL-first libraries

These libraries sit just above a driver. You write SQL, and they add safety and types around it:

Librarynpm packageDownloads (30 days)Latest releaseWhat it adds
pg-promisepg-promise2.75M12.7.1, Aug 20, 2026Query formatting, tasks and transactions on top of pg
Slonikslonik580k49.10.10, Sept 21, 2026Strict types, runtime validation of results, safe connection and transaction handling
PgTyped@pgtyped/runtime350k2.4.2, Feb 10, 2025Generates TypeScript types for SQL queries from a running PostgreSQL database
Zapatoszapatos85k6.6.1, Sept 19, 2025Generates TypeScript types for every table in your database, plus typed SQL helpers

All four work only with PostgreSQL. PgTyped and Zapatos have had no commits to their default branches in the past 12 months.

Choosing a library

There's no single best library, but the data above suggests some starting points:

  • You want one model definition to drive types and migrations: Drizzle ORM (TypeScript), MikroORM (entities), Prisma ORM (schema file) and TypeORM (entities) all generate migrations from your models. Sequelize, Knex.js and Kysely migrations are written by hand.
  • You prefer SQL-shaped queries with inferred result types: Kysely and Drizzle ORM. If you want SQL itself, look at the drivers and SQL-first libraries.
  • You want change tracking and a unit of work: MikroORM.
  • You use MongoDB: Mongoose is the established ODM. MikroORM and TypeORM also support MongoDB, and so does Prisma ORM, in version 6.19 or as early access in Prisma ORM 8. The MongoDB driver works on its own.
  • You deploy to edge runtimes: check each library's docs for your platform. Drizzle ORM, Kysely and Prisma ORM document Cloudflare Workers, and MikroORM explains what edge runtimes need.
  • You need a database beyond PostgreSQL, MySQL and SQLite: TypeORM, Sequelize, MikroORM and Knex.js support SQL Server and Oracle; Prisma ORM 7, Kysely and the Drizzle ORM 1.0 release candidate support SQL Server.
  • You value stability over new features: check the maturity notes. Drizzle ORM and Kysely haven't reached 1.0, Prisma ORM 8 and Drizzle ORM 1.0 are release candidates, TypeORM just released 1.0, and Sequelize 7 is in alpha.

Whichever you choose, try it on a small part of your application first, and read its issue tracker for the problems others run into.

Prisma Postgres

Pair Prisma ORM with Prisma Postgres

Pair Prisma ORM with Prisma Postgres for an end-to-end typed data layer — hosted, pooled, and ready in seconds.

To learn more about the different levels of abstraction, read Comparing SQL, query builders, and ORMs.

Build with Prisma ORM and hosted Postgres

Get a type-safe data layer and a hosted Postgres database that work together out of the box.