Type-safe SQL query builder for TypeScript that provides auto-completion and compile-time type checking without the abstraction overhead of a traditional ORM. Write queries that map directly to SQL while getting full TypeScript inference from your database schema. Supports PostgreSQL, MySQL, and SQLite with migrations, transactions, and raw SQL escape hatches. Lightweight with zero dependencies. Ideal for developers who want SQL control with TypeScript safety. Growing Knex.js alternative.
Best Knex.js Alternatives
3 editor-verified alternatives · Knex.js overview →
source: tools.alternatives · stored order · active records only; review scores are annotations and never change membership or order
Full-featured ORM for TypeScript and JavaScript supporting Active Record and Data Mapper patterns. Works with PostgreSQL, MySQL, MariaDB, SQLite, Oracle, SQL Server, and MongoDB. Features decorator-based entity definitions, migrations, relations (one-to-one, many-to-many), lazy/eager loading, query builder, transactions, and caching. Supports both Node.js and browser runtimes. 34K+ GitHub stars. Mature but losing mindshare to Prisma and Drizzle for new TypeScript projects.
Mature, promise-based ORM for Node.js supporting PostgreSQL, MySQL, MariaDB, SQLite, and SQL Server. Features model definitions with validations, eager/lazy loading, transactions, migrations, raw queries, and lifecycle hooks. Supports soft deletes, scopes, and virtual fields. One of the oldest and most battle-tested Node.js ORMs, widely used in enterprise apps though increasingly succeeded by Prisma and Drizzle in new projects.
Open-source Knex.js alternatives
Kysely, TypeORM, Sequelize — see all open-source developer tools.
FAQ
What is the best Knex.js alternative?
Kysely tops our editor-verified list of 3 Knex.js alternatives.
Are there open-source Knex.js alternatives?
Yes — Kysely, TypeORM, Sequelize are open source.