# Knex.js

> SQL query builder for Node.js with migrations and seeds

Source: https://talira.ai/catalog/knex-js-ym73tqpg
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / databases / sql toolkits](https://talira.ai/categories/libraries/databases/sql-toolkits), [developer tools / database / migrations](https://talira.ai/categories/developer-tools/database/migrations), [languages / javascript](https://talira.ai/categories/languages/javascript)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Knex](https://talira.ai/orgs/knex.md)

Knex.js is a SQL query builder for Node.js. It builds queries for PostgreSQL, MySQL and MariaDB, CockroachDB, Amazon Redshift, SQLite3, Oracle and SQL Server from one chainable API, with transactions, connection pooling, streaming queries, and both promise and callback interfaces. It also has a schema builder and a migrations and seeds CLI, and TypeScript types. It is not an ORM itself: ORMs such as Objection.js and MikroORM are built on it. It is MIT licensed and installs from npm.

## Links

- Website: https://knexjs.org/
- GitHub: https://github.com/knex/knex
- Docs: https://knexjs.org/guide/

## Problems it solves

- build SQL queries in Node.js without writing raw SQL strings
- run database schema migrations in a Node.js project
- write queries that work on both Postgres and SQLite from JavaScript

## Features

- Query builder for PostgreSQL, MySQL, MariaDB, CockroachDB, Redshift, SQLite3, Oracle and SQL Server
- Schema builder
- Migrations and seeds with a CLI
- Transactions and connection pooling
- Streaming queries
- Promise and callback APIs

## Trust

Overall: 0.47 out of 1.
Signals: maintenance 0.27, adoption 0.86, momentum 0.63, community 1.00, backing 0.30, extensibility 0.00.

- latest release 3.3.0 5 months ago
- 20.3k GitHub stars
- 622 contributors
- backed by Knex

Warnings:

- last commit 5 months ago

## Alternatives

- [Kysely](https://talira.ai/catalog/kysely-em8f33ta.md): Type-safe SQL query builder for TypeScript
- [Reylo](https://talira.ai/catalog/reylo-0v2g7263.md): Import .sql files into TypeScript with types inferred from your live database, plus SQL-first migrations

## Sources

[^1]: https://github.com/knex/knex/blob/master/LICENSE (checked 27 Nov 2026)
