Skip to main content

Kysely

The type-safe SQL
query builder for TypeScript

Getting startedView on Github

Type-safe SQL queries

Kysely let's you write type-safe SQL queries. This eliminates entire classes of errors and let's you sleep peacefully at night.

No magic, just SQL

Kysely is a light abstraction layer over SQL. This makes it easy to reason about performance, and reduces the amount of concepts you need to learn to be proficient with the library.

Great autocompletion

By exposing your database schema to the TypeScript compiler, you get autocompletion on table names, column names, aliases, etc.

Multi-dialect support

PostgreSQL, MySQL, or SQLite? We've got you covered. There's also a growing ecosystem of 3rd party dialects, including PlanetScale, D3, SurrealDB, and more. Learn more.

Runs on every environment

Kysely runs on node.js, the browser, serverless and edge environments, even on Deno! Learn more.

Extensible core

Kysely comes with a plugin system that lets you extend the core with your own functionality. Learn more.

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