# Kysely

> Type-safe SQL query builder for TypeScript

Source: https://talira.ai/catalog/kysely-em8f33ta
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / databases / sql toolkits](https://talira.ai/categories/libraries/databases/sql-toolkits), [languages / typescript](https://talira.ai/categories/languages/typescript)
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Kysely](https://talira.ai/orgs/kysely-org.md)

Kysely is a type-safe, autocompletion-friendly SQL query builder for TypeScript, inspired by [Knex.js](https://talira.ai/catalog/knex-js-ym73tqpg.md). It only lets a query refer to tables and columns visible at that point, and infers result types, column names and aliases from selects, joins, subqueries and with clauses, with escape hatches such as the sql template tag for what can't be typed at compile time. It has dialects for PostgreSQL, MySQL, Microsoft SQL Server, SQLite and PGlite, and runs on Node.js, Deno, Bun, Cloudflare Workers and in browsers. Sami Koskimäki wrote it, and he and Igal Klebanov lead the project.

## Links

- Website: https://kysely.dev/
- GitHub: https://github.com/kysely-org/kysely
- Docs: https://kysely.dev/

## Problems it solves

- write SQL queries in TypeScript with types checked against my database schema
- a query builder that autocompletes my table and column names
- build SQL in TypeScript without a full ORM

## Features

- Compile-time checks that queries only use visible tables and columns
- Result types inferred from selects, joins, subqueries and with clauses
- Dialects for PostgreSQL, MySQL, SQL Server, SQLite and PGlite
- Runs on Node.js, Deno, Bun, Cloudflare Workers and browsers
- sql template tag and dynamic module for queries that can't be typed

## Trust

Overall: 0.72 out of 1.
Signals: maintenance 1.00, adoption 0.83, momentum 0.70, community 0.89, backing 0.30, extensibility 0.00.

- last commit 2 days ago
- 186 commits in the last 90 days
- latest release v0.29.9 17 days ago
- 14.4k GitHub stars
- 166 contributors
- has a company behind it

## Alternatives

- [Prisma ORM](https://talira.ai/catalog/prisma-orm-3y118vyc.md): One schema. Every query type-safe.
- [Reylo](https://talira.ai/catalog/reylo-0v2g7263.md): Import .sql files into TypeScript with types inferred from your live database, plus SQL-first migrations
- [Knex.js](https://talira.ai/catalog/knex-js-ym73tqpg.md): SQL query builder for Node.js with migrations and seeds

## Sources

[^1]: https://github.com/kysely-org/kysely/blob/master/README.md (checked 28 Nov 2026)
[^2]: https://github.com/kysely-org/kysely/blob/master/LICENSE (checked 28 Nov 2026)
