Skip to content
aicoolies logo
Kysely logo

Kysely

Type-safe SQL query builder for TS

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.

About Kysely

Kysely is a type-safe TypeScript SQL query builder that provides unparalleled autocompletion and compile-time safety for database queries. Inspired by Knex.js but built from the ground up with TypeScript in mind, Kysely ensures that you can only reference tables and columns that actually exist in your database schema, catching errors before your code ever runs. It runs on Node.js, Deno, Bun, Cloudflare Workers, and web browsers, making it a versatile choice for modern JavaScript runtimes.

Kysely stands out as a thin abstraction layer over SQL, designed by SQL enthusiasts who want predictable one-to-one query compilation rather than magical ORM behavior. It provides smart column inference that restricts field access to only the columns visible in each part of a query, ensuring result types include only selected columns with correct types and aliases. Kysely supports the full range of SQL operations including SELECT, INSERT, UPDATE, DELETE, MERGE, WITH clauses, and complex subqueries, all with complete type safety and autocompletion support.

Kysely is targeted at TypeScript developers and teams proficient in SQL who want the safety of type checking without sacrificing control over their queries. It is used in production by companies like Deno, Maersk, and Cal.com, demonstrating its readiness for enterprise workloads. Kysely integrates with PostgreSQL, MySQL, and SQLite through dialect-specific drivers, and its plugin system allows extending functionality with custom transformations, making it an excellent choice for projects where type safety and SQL familiarity are top priorities.

Pricing & Platform Specs

Pricing Summary

Free and 100% open source under the MIT license. Kysely is completely free for personal and commercial use with zero software licensing costs. Deploys seamlessly across Node.js, Bun, Deno, browser Web Workers, and serverless/edge runtimes.

full pricing breakdown →

Supported Platforms

Node.js, Deno, Bun

Explore categories, tags & use cases

SQL query builder for Node.js

Flexible SQL query builder for Node.js supporting PostgreSQL, MySQL, SQLite, Oracle, and MSSQL. Chainable API for constructing queries with parameterized bindings. Features schema builder, migration system, seed files, transaction support, and connection pooling. Foundation for ORMs like Bookshelf.js and Objection.js. One of the most established query builders in the Node.js ecosystem.

Open Source

ORM for TypeScript and JavaScript

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.

Open Source

Promise-based Node.js ORM

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

Community experience

Sources & verification

Sources checked
Content verified

Verification dates are editorial checks. Routine CMS saves and automatic updatedAt timestamps do not advance them.

FAQ

What is Kysely?

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.

Is Kysely free?

Yes — Kysely is open source and free to use. Free and 100% open source under the MIT license. Kysely is completely free for personal and commercial use with zero software licensing costs. Deploys seamlessly across Node.js, Bun, Deno, browser Web Workers, and serverless/edge runtimes.

Is Kysely open source?

Yes — Kysely is open source.

Is Kysely still maintained?

Yes — Kysely is active. Its listing was last verified on September 6, 2026.

What are the best Kysely alternatives?

The first editor-selected Kysely alternatives are Knex.js, TypeORM, Sequelize.