Skip to content
whichdevtool?
Categories ▾

Frameworks and UI

Frontend and full-stack frameworks Backend frameworks UI component libraries

Hosting

VPS and cloud servers App hosting and PaaS

Data

Managed databases File and object storage ORMs and database toolkits

AI

AI model APIs

Email

Transactional email APIs Email marketing and newsletters

Payments

Payments and billing

Domains and edge

Domain registrars CDN, DNS and edge security

Operations and identity

Monitoring, uptime and error tracking Auth and identity Background jobs, queues and workflows
Stacks Directory
Ctrl K

Search directory
Menu
StacksDirectory Pricing changes Glossary
VPS and cloud servers App hosting and PaaS Managed databases Transactional email APIs Email marketing and newsletters Domain registrars CDN, DNS and edge security Monitoring, uptime and error tracking Auth and identity Frontend and full-stack frameworks Backend frameworks UI component libraries AI model APIs File and object storage Payments and billing Background jobs, queues and workflows ORMs and database toolkits
  1. Home
  2. ORMs and database toolkits
  3. Knex.js
KJ

JavaScript SQL query builder · by Knex (community project)

Knex.js

Veteran multi-dialect SQL query builder for Node.js with transactions, connection pooling, streaming and a built-in migration and seed runner; active again with releases through 2026.

Visit knexjs.org ↗ Alternatives Open source Open source Self-hostable
knexjs.org
Knex.js homepage
§1

Overview

Knex.js was started in 2012 by Tim Griesser and is one of the most used SQL builders in Node.js. You write queries such as knex('users').join(...).select(...), define tables with a schema builder, and manage schema changes with its migration and seed CLI. It handles connection pooling, transactions and streaming, with both promise and callback APIs.

After version 3.1.0 in December 2023, releases paused until March 2026, when 3.2.0 arrived with migration lifecycle hooks and many fixes; 3.3.0 on 26 June 2026 added a MariaDB driver and knex.migrate.to. Several ORMs build on it, notably Objection.js, whose repository has seen little activity since 2025, and Bookshelf. MikroORM moved off Knex in version 7.

TypeScript typings are included, but types are not inferred from your schema the way Kysely does it, which is why many TypeScript projects now pick Kysely instead; the Knex author himself has praised Kysely as close to what he would build today.

§2

Pricing and plans

Plan Price What you get
Knex.js $0 MIT licence

Free and open source under the MIT licence; there is no paid product.

Source: github.com/knex/knex · prices as published, excluding tax.

§3

What it does

Multi-dialect builder
One API for PostgreSQL, MySQL, MariaDB, CockroachDB, SQL Server, SQLite and Oracle, including Oracle Wallet authentication.
Schema builder
createTable, alterTable and index helpers that emit dialect-specific DDL.
Migrations and seeds
CLI and API to create, run, roll back and target specific migrations, with lifecycle hooks since 3.2.
Transactions and pooling
Transaction helpers and a tarn.js connection pool, or bring your own pool since 3.3.
Streaming
Stream large result sets instead of loading them into memory.
§4

Strengths and limitations

Strengths

  • Mature and widely deployed, with many plugins and recipes
  • Broad dialect coverage including Oracle and SQL Server
  • Built-in migrations and seeds without an ORM
  • Maintenance resumed with several releases in 2026

Limitations

  • Result types are not inferred from the schema; TypeScript users must declare row types themselves
  • Migrations are written by hand; there is no schema diffing
  • Release activity paused from late 2023 to March 2026, and the issue tracker has hundreds of open issues
  • Needs Node.js drivers, so it does not run on edge runtimes
§5

Who it suits

Good for

  • Existing JavaScript codebases that already use Knex
  • Apps that need a query builder plus migrations on Oracle or SQL Server
  • Projects using Objection.js

Look elsewhere if

  • New TypeScript projects that want inferred result types (Kysely, Drizzle)
  • Edge and serverless runtimes without Node.js drivers
§6

Pricing history

  • 22 Mar 2026

    Knex resumes releases with 3.2.0

    Knex 3.2.0 was the first feature release since 3.1.0 in December 2023, adding migration lifecycle hooks and many fixes; 3.3.0 followed on 26 June 2026 with a MariaDB driver. Source ↗

§7

Alternatives to Knex.js

Tool From Free option Stages
Ec
Ecto Elixir data mapping and query toolkit
— Open source
EO
Eloquent ORM Active Record ORM for Laravel
— Open source
AR
Active Record (Rails) Active Record ORM for Ruby on Rails
— Open source
SQLAlchemy Python SQL toolkit and ORM
— Open source
Drizzle ORM SQL-like TypeScript ORM
— Open source
Sq
sqlc SQL-to-code compiler
— Open source

All ORMs and database toolkits →

§8

Questions

Is Knex still maintained?

Yes. After a pause, versions 3.2.0 (March 2026) and 3.3.0 (June 2026) were released with new features and fixes.

Knex vs Kysely: what is the difference?

Both are query builders; Kysely infers result types from a typed schema, while Knex relies on types you declare and includes a migration CLI.

Does Knex have migrations?

Yes, Knex includes a migration and seed runner with up and down functions that you write.

Sources read for this page

  • https://github.com/knex/knex
  • https://knexjs.org/changelog.html
  • https://github.com/knex/knex/releases/tag/3.3.0
  • https://github.com/Vincit/objection.js
  • https://kysely.dev/
Spec sheet
From
Open source
Free tier
Free to self-host
Stages
HobbyIndieStartupScale-upEnterprise Suits hobby, indie, startup, scale-up
Language
JavaScript (TypeScript typings)
Approach
Query builder
Databases
Postgres, MySQL, MariaDB, CockroachDB, MSSQL, SQLite, Oracle
Migrations
Yes, built-in runner with up/down files; not generated
Open source
Yes
Self-host
Yes
EU data
Not stated
Category
ORMs
Visit knexjs.org ↗

To report an out-of-date price or limit, use the correction form.

whichdevtool?

Developer and cloud tools compared on price, free tier and limits, each with its source. For side projects, solo developers and small teams.

Categories

  • VPS and cloud servers
  • App hosting and PaaS
  • Managed databases
  • Transactional email APIs
  • Email marketing and newsletters
  • Domain registrars
  • CDN, DNS and edge security
  • Monitoring, uptime and error tracking
  • Auth and identity
  • Frontend and full-stack frameworks
  • Backend frameworks
  • UI component libraries
  • AI model APIs
  • File and object storage
  • Payments and billing
  • Background jobs, queues and workflows
  • ORMs and database toolkits

Research

  • Directory
  • Stacks by project
  • Developer news
  • Pricing changes
  • Glossary

Site

  • About and methods
  • How we make money
  • Suggest a tool or fix
  • Privacy
© 2026 whichdevtool.com Prices change. Each tool page links to its source. We may earn a commission when you sign up through links on this site. How we make money