Type-safety without compromises
Kysely's state-of-the-art, type-safe API provides precise result types and catches errors within queries at compile-time, giving high-performing teams the confidence to ship at greater velocity. Use `kysely-codegen` to make the database the source of types.
What you see is what you get
Kysely is a thin abstraction layer over SQL, crafted by SQL lovers for SQL lovers, focusing on familiarity through naming and structure, and predictability through 1:1 compilation. Teams proficient in SQL can pick up Kysely and be productive in minutes.
Write with great auto-completion
Your database schema types flow through Kysely's fluent API, offering a typing experience that's second only to full-blown database IDEs. Get intelligent, context-aware suggestions for functions, table names, and column names as you type.
Build SQL queries with unmatched depth
Kysely supports building a wide range of SQL queries, clauses, functions, and expressions, including SELECT, INSERT, UPDATE, DELETE, MERGE, WITH, and more. When needed, you can also use raw SQL strings, even within structured queries.
Query any SQL database
Kysely's community-driven dialect system makes it easy to implement support for any SQL database without waiting for the core team. It ships with official dialects for PostgreSQL, MySQL, MS SQL Server, and SQLite right out of the box.
Run anywhere
Kysely is lightweight, ships both CommonJS and ESM, has zero dependencies, and avoids any environment-specific APIs. It can run in any JavaScript environment, including Node.js, Deno, Bun, AWS Lambda, Cloudflare Workers, and browsers.
Take control over your migrations
Kysely includes optional up/down migration primitives, allowing you to move away from risky black box migration tools and write your own migrations. Use `kysely-ctl` to run your migrations directly in the terminal or within your CI/CD pipeline.
Extend with plugins
Kysely's plugin system allows you tap into the process, and modify queries before compilation and/or their results after execution. This opens up various use cases, such as transforming camelCase names to snake_case and vice versa.
What the internet is saying
Developers are loving Kysely for its simplicity and power.
Try it out for yourself!
Modify the query on the left and view the generated SQL on the right.
Looking for code examples?
From finding a single record to complex joins, our docs have examples to get you started quickly.
Jump right in