ORM
Kysely icon

Kysely

A type-safe SQL query builder rather than a full ORM, for when you want Postgres-level control with autocomplete instead of an abstraction layer.

What is Kysely?

Kysely is a TypeScript SQL query builder, not a full ORM. It generates fully type-safe queries from your database schema (via codegen or manually written types), so autocomplete and compile-time errors catch typos and shape mismatches, but the queries themselves stay close to actual SQL instead of being hidden behind an ORM's abstraction. It's built for developers who want type safety without giving up direct control over the SQL that gets executed.

Key features

  • End-to-end type inference: column names, types, and joins are all checked at compile time
  • Generates real, readable SQL rather than an ORM's own query language, so it's easier to reason about what actually hits the database
  • Plugin system for things like camelCase mapping, and dialects for Postgres, MySQL, SQLite, and others
  • Works well alongside raw SQL when a query is easier to write by hand, without fighting the abstraction
  • Schema/type generation tools (like kysely-codegen) keep types in sync with the actual database schema

Who it's for

Developers who know SQL and want type safety and autocomplete without an ORM's abstraction layer, migrations DSL, or performance overhead. Teams that want a full-featured ORM with built-in migrations, model-level validation, and less SQL exposure are better served by Prisma or Drizzle.

Pricing

Free and open source.