
About Knex.js
Knex.js is a query builder for JavaScript and Node.js. It helps you write SQL from code and supports many database engines.
What it does
Knex gives you a chainable API for queries and schema changes, so you do not need to write raw SQL strings for every task. It supports promises, callbacks and streams, and it handles transactions with savepoints and connection pooling. Its responses are standardized across the supported dialects.
Key features
- Query and schema builders for tables, columns and indexes
- Promise, callback and stream interfaces
- Transactions with savepoints
- Connection pooling
- Support for PostgreSQL, MySQL, SQLite, SQL Server and more
Who it's for
JavaScript and Node.js developers who want a flexible query builder without a full ORM. Backend teams that work with more than one database type also find it useful.
Pricing and good to know
Knex is open source under the MIT license and free to use. The project publishes a guide, a changelog and a FAQ. It runs on Node.js and needs a separate driver package for the database you choose.
Highlights
- Query and schema builders for tables, columns and indexes
- Promise, callback and stream interfaces
- Transactions with savepoints
- Connection pooling
- Support for PostgreSQL, MySQL, SQLite, SQL Server and more












