Elestia Open Source Ratings
5.9

Knex.js

Reasonable, with limits. 8th of 10 ORMs and query builders.

Knex.js is a mature, multi-dialect SQL query builder for Node.js with built-in migrations, seeds and connection pooling. It is still solid, and other tools build on it. For new TypeScript work, Kysely or Drizzle give much stronger type safety, so Knex fits best where it already runs or where you need Oracle or SQL Server support.

Best for: JavaScript or mixed JS/TS teams that need a proven query builder with built-in migrations across many SQL databases, including Oracle and SQL Server.

WebsiteGitHubnpm

Scores

Overall5.9

How strongly do we recommend it for a new project today?

Claude Opus 5.5: 5.0, likely 4.0 to 6.0

Knex is a reliable, well-known SQL query builder with strong migrations and the widest dialect support. Kysely now does the same job with far better types and faster maintenance, and Drizzle and Prisma lead new TypeScript projects. Maintenance has slowed and its growth trails the category. It is a reasonable pick for JS projects or Oracle and MSSQL needs, but most new TS projects should choose Kysely or Drizzle.

GPT-6.2 Sol: 6.8, likely 5.6 to 7.9

Knex is a good choice for JavaScript teams that want explicit SQL, broad dialect support, and built-in migrations. For most new TypeScript projects that want a query builder, Kysely’s stronger inference and more recent maintenance make it the better starting point. Knex’s continued use in major frameworks supports the recommendation, while the release pause and below-baseline download growth limit it.

Needed by many6.6

How many developers need a tool for this job?

Claude Opus 5.5: 7.0, likely 6.0 to 8.0

Most backend JS/TS projects need database access, and many of them use SQL. Knex covers SQL databases only, but almost all of them. Because it is a query builder rather than a full ORM, it serves part of that group, which keeps it below the top band.

GPT-6.2 Sol: 6.2, likely 5.0 to 7.3

Knex covers several of the most widely used relational databases and works with any Node.js framework. Its SQL-first approach fits a substantial share of backend work, while frontend-only projects, document databases, and teams that want an ORM fall outside its main audience. The database survey gives a strong signal about the databases people use and only an indirect signal about demand for a query builder.

Helps a lot6.5

How well does it do the job for those who need it?

Claude Opus 5.5: 5.5, likely 4.5 to 6.5

The query builder, migrations, transactions and pooling are mature, and the dialect support is wide. The main limit is that its types are weak next to Kysely and Drizzle, so many errors only show up at runtime. That gap is the deciding factor for TypeScript projects today.

GPT-6.2 Sol: 7.4, likely 6.3 to 8.4

Version 3.3.0 combines a flexible SQL builder with migrations, transactions, streaming, and detailed examples. Kysely infers aliases and changing result shapes more reliably, giving teams and coding agents better compiler feedback on query edits. An independent benchmark found lower latency than Prisma in one older API workload, and an open PostgreSQL report describes a transaction cleanup failure, leaving performance and reliability across dialects less certain.

Holds up over time5.5

Will it still be a good choice in two years?

Claude Opus 5.5: 5.0, likely 3.5 to 6.5

The project shipped a burst of releases in March to June 2026, from 3.2.0 to 3.3.0, but there have been no pushes since June. The Scorecard Maintained check is 0, and there are 585 open issues and 191 open PRs. It has no visible funding, and the ecosystem is moving to typed builders: MikroORM 7 replaced Knex with Kysely. It is not abandoned, but the pace is slow.

GPT-6.2 Sol: 5.9, likely 4.5 to 7.3

Knex recorded 129 commits and nine GitHub releases over the year, with nearly five months since the last push by the review date. A reported TypeScript regression was fixed in about three weeks, while 585 issues and 191 pull requests remained open. Several maintainers contributed to releases and discussed a 4.0 roadmap, but future release timing and sustained funding are unclear. Kysely has a more recent release and more commits in the same period.

  • github commitsLastYear, releasesLastYear, pushedAt, openIssues, openPullRequests: Annual activity was substantial, with a recent pause and a large backlog.
  • github.com/knex/knex/releases: Shows multiple release contributors, a 2026 release burst, and fixes for module and typing regressions.
  • github.com/knex/knex/issues/6452: Reported May 18 and closed with a fix June 9.
  • github.com/knex/knex/issues/6409: Maintainers discuss potential breaking changes for 4.0.
  • peers Kysely: 430 commits in the past year and a November release.
Used widely6.4

How many use it, and is that growing?

Claude Opus 5.5: 6.5, likely 5.5 to 7.5

Knex had 28M downloads in four weeks and about 95k dependent repos, so its installed base is large. Many of those downloads come through Strapi, Objection, Bookshelf and similar tools. Its yearly ratio is about 2.5, well below the 4.1 median, while Kysely and Drizzle grew 20x or more. It is losing share of new projects.

  • npm downloadsLast4Weeks: 28.1M, against 11.3M a year ago (about 2.5x, below the 4.1 median)
  • dependents repos: 94,868, more than Prisma or Drizzle
  • peers Kysely/Drizzle downloads: 118M and 190M, both growing much faster
  • bluesky posts: 0 posts, so little current attention

GPT-6.2 Sol: 6.3, likely 5.1 to 7.5

ecosyste.ms found about 95,000 dependent repositories, ahead of Prisma and TypeORM in this sample and behind Sequelize. Four-week npm downloads grew from 11.3 million to 28.1 million, or 2.48×, below the 4.1× catalog baseline and well below Kysely and Drizzle. Frameworks such as Strapi and Backstage bring indirect installs, so download counts give limited evidence about how many new projects choose Knex directly.

  • dependents repos, packages: 94,868 indexed repositories and 3,407 npm packages declare a dependency.
  • npm downloadsLast4Weeks, downloadsSame4WeeksYearAgo, medianDownloadsRatio: Downloads rose 2.48× against a 4.1× baseline.
  • peers: Knex has an established installed base, with much slower download growth than Kysely and Drizzle.
  • backstage.io/docs/backend-system/core-services/database: Backstage exposes Knex through its core database service.
  • docs.strapi.io/cms/configurations/database: Strapi 5 uses Knex for database connections.
Vouched for6.9

Who stands behind it being good?

Claude Opus 5.5: 6.0, likely 5.0 to 7.0

Knex has long production use, and ORMs and CMSs such as Objection.js, Bookshelf, Strapi and Ghost are built on it. Current independent comparisons call it mature but steer new TypeScript projects to Kysely or Drizzle. Recent survey praise is missing.

GPT-6.2 Sol: 7.7, likely 6.5 to 8.7

Strapi 5, Backstage, and Directus rely on Knex for core database access. That gives it several independent examples of real use, while MikroORM 7’s move away from Knex shows that some established users have changed direction. Evidence about current developer satisfaction and retention is thin.

Safe6.1

How safe is it to depend on?

Claude Opus 5.5: 6.5, likely 5.5 to 7.5

It is MIT licensed, and there have been no advisories in 24 months. The two older SQL-injection advisories, from 2019 and 2022, were fixed. The Scorecard is weak at 4.6: no security policy, unpinned dependencies, broad token permissions and partial code review. It pulls in 14 dependencies, which is moderate.

  • advisories: 2 in total, none in the last 24 months
  • scorecard score: 4.6; Security-Policy, Pinned-Dependencies and Token-Permissions all 0
  • npm dependencies: 14 direct dependencies
  • npm license: MIT

GPT-6.2 Sol: 5.7, likely 4.4 to 7.1

Both listed SQL injection advisories were patched before or around public disclosure, and OSV lists no new advisories in the past 24 months. The package has an MIT licence, 14 direct dependencies, and a GitHub Actions workflow that uses npm trusted publishing with provenance. OpenSSF scores it 4.6, with zeroes for workflow token permissions, dependency pinning, and a public security policy. Open reports involving Oracle and SQL Server leave uncertainty about the scope of remaining risk.

Good

  • It supports more dialects than most peers: PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle and CockroachDB.
  • Its migration and seed system is mature, with batch rollbacks and, since 3.3, migrate.to and migrate.before.
  • It has been in use for over a decade, with about 95k dependent repos and ORMs such as Objection.js and Bookshelf built on it.
  • The API is small and close to SQL, and AI agents and developers write it easily from plenty of examples.

Bad

  • TypeScript types were added later, and complex queries often fall back to any, unlike Kysely or Drizzle.
  • Activity has slowed: there have been no commits since June 2026, and 585 issues and 191 PRs are open.
  • The 3.2.x line shipped an ESM exports change that later releases had to fix and then revert.
  • Downloads grow more slowly than the category median, and MikroORM 7 moved its SQL layer from Knex to Kysely.

The numbers

npm downloads, 4 weeks
28M ×2.5 in a year
GitHub stars
20k
Commits, 12 months
129
npm version
3.3.0 Jun 2026
Versions, 12 months
12
Advisories, 24 months
0 of 2 ever
OpenSSF Scorecard
4.6 out of 10, Nov 2026
Licence
MIT

Read on 21 November 2026 from GitHub (knex/knex), npm (knex), OSV and the OpenSSF Scorecard.

ORMs and query builders

  1. 8.1Drizzle ORM
  2. 8.0Kysely
  3. 7.8Mongoose
  4. 7.5Prisma
  5. 7.3MikroORM
  6. 6.7ZenStack
  7. 6.4TypeORM
  8. 5.9Knex.js
  9. 5.3Objection.js
  10. 5.0Sequelize
Compare all 10 on six scores