Kysely
Type-safe SQL query builder for JavaScript and TypeScript.
Kysely is a state-of-the-art, type-safe SQL query builder designed for JavaScript and TypeScript environments. It provides a thin abstraction layer over SQL, allowing developers to write queries with precise result types and catch errors at compile-time. This focus on type-safety and predictability helps high-performing teams ship software with greater confidence and velocity. Built by SQL enthusiasts, Kysely emphasizes familiarity through its naming and structure, making it easy for SQL-proficient teams to become productive quickly. It supports a wide range of SQL queries, clauses, functions, and expressions, and offers intelligent, context-aware auto-completion based on the database schema. Kysely is highly extensible with a community-driven dialect system, supporting various SQL databases like PostgreSQL, MySQL, MS SQL Server, and SQLite out of the box. It's lightweight, has zero dependencies, and runs in any JavaScript environment, including Node.js, Deno, Bun, AWS Lambda, and browsers. Beyond query building, Kysely includes optional migration primitives for fine-grained control over database schema changes, and a plugin system to modify queries or results. It aims to provide a robust and flexible solution for developers who value type-safety and direct control over their SQL.






