# Kysely: 8.0 out of 10

A strong pick. 2nd of 10 in [ORMs and query builders](https://elestia.ai/opensource/orms/index.md).

Kysely is a zero-dependency, type-safe SQL query builder for TypeScript. It stays close to SQL and is among the most precisely typed options. It is a strong pick for teams that know SQL and do not want an ORM's modelling layer, but it has no schema-first models and does not generate migrations, and it is still on 0.x versions.

**Best for:** TypeScript teams that write real SQL and want full type inference without an ORM, on Postgres, MySQL, SQLite, MSSQL or edge runtimes.

## Scores

- **Overall: 8.0** (likely 6.9 to 8.7)
  - Claude Opus 5.5 (7.5): Kysely is the best pure type-safe query builder in the category, and it is very active and growing fast. Drizzle is still the broader default for most new projects because it adds a schema layer and migration generation. Kysely's 0.x breaking changes and this year's injection advisories keep it below the top tier. It is a strong pick for SQL-first teams.
  - GPT-6.2 Sol (8.4): Kysely is a strong first choice for explicit SQL in a new TypeScript project, especially when complex queries and result inference matter. It offers stronger query typing than Knex, while Prisma and Drizzle suit teams that want schema and relation tooling in one package. Active maintenance and downstream adoption support the recommendation, with some uncertainty from release concentration, upgrade friction, and the difficulty of measuring direct adoption.
- **Needed by many: 6.7** (likely 5.6 to 7.8)
  - Claude Opus 5.5 (7.0): Reading and writing SQL databases is needed in most backend and full-stack JS projects. Kysely serves the SQL-database share and leaves out MongoDB. Its SQL-first, non-ORM approach appeals most to developers who are comfortable with SQL.
  - GPT-6.2 Sol (6.4): Kysely covers the major relational databases and works across Node.js, Bun, Deno, and edge runtimes with suitable drivers. Its strongest fit is strict TypeScript with explicit SQL, which narrows the audience to one part of the database-tool market. The survey establishes demand for the databases it supports, while the share of JavaScript and TypeScript developers who want this query style is harder to estimate.
- **Helps a lot: 8.4** (likely 7.3 to 9.3)
  - Claude Opus 5.5 (8.0): Type inference and SQL expressiveness are among the best in the category, and it supports many dialects with zero dependencies. Recent releases added query cancellation and a PGlite dialect. It loses points for having no ORM modelling layer and no migration generation, which Drizzle and Prisma provide. Filters can also get verbose.
  - GPT-6.2 Sol (8.7): Kysely combines precise result inference with composable SQL and practical escape hatches for complex queries. A recent third-party PostgreSQL benchmark showed competitive performance on its tested workloads. Users report confusing type errors on complex queries, and schema synchronization takes extra tooling. Worked examples and compiler feedback help coding agents, though agent success rates and performance across dialects are still uncertain.
- **Holds up over time: 7.4** (likely 6.2 to 8.3)
  - Claude Opus 5.5 (7.0): Activity is high: 430 commits and 26 releases in the last year, a patch on 2026-11-12, and about 1,000 issues closed. The 0.28 line is still maintained next to 0.29. Two co-leads carry the core work as volunteers with no clear corporate funding, and the 0.x versions mean minor releases can break code. Downstream use by Better Auth and ZenStack makes it more likely to keep going.
  - GPT-6.2 Sol (7.7): The repository logged 430 commits and 26 GitHub releases in a year, and maintainers backported fixes to the 0.28 line. MikroORM's switch from Knex to Kysely gives it another established downstream user. The team maintains it in its spare time, npm lists two maintainers, and recent GitHub releases largely come from one account. The 0.29 import changes and a reported production disruption after a 0.28 patch widen the range.
- **Used widely: 5.9** (likely 4.7 to 7.1)
  - Claude Opus 5.5 (7.0): Downloads rose about 22x in a year, to 118M per 4 weeks, far above the 4.1 median. Much of that comes through transitive installs, mainly Better Auth's built-in adapter and ZenStack. Direct use is smaller: 1,155 dependent repos, against 2,870 for Drizzle and 43,615 for Prisma. Still, the trend in direct choice is clearly upward.
  - GPT-6.2 Sol (4.8): Four-week npm downloads grew 22.6× year over year, well above the 4.1× catalog median and slightly ahead of Drizzle's 19.1×. Ecosyste.ms found 1,155 dependent repositories, below Drizzle and far below Prisma and Knex. Kysely has 14,373 stars and more Bluesky links than most peers, though maintainers account for several top posts. Better Auth, MikroORM, and CI generate installs that make direct adoption and its growth hard to isolate.
- **Vouched for: 7.6** (likely 6.1 to 8.6)
  - Claude Opus 5.5 (7.0): Popular frameworks have chosen it as their engine: Better Auth runs its SQL adapters on it, and ZenStack v3 rewrote its ORM engine on it. Independent write-ups praise its type safety. It has no survey satisfaction data we could confirm, and most comparison articles are thin or written by vendors.
  - GPT-6.2 Sol (8.2): MikroORM 7 uses Kysely to execute SQL, Better Auth uses its dialects, and the U.S. Tax Court uses it in its case-management code. A developer also documented moving a production application from Prisma to Kysely after using it for complex reporting queries. These are distinct commitments, while the satisfaction evidence comes from individual reports.
- **Safe: 7.2** (likely 5.5 to 8.2)
  - Claude Opus 5.5 (7.0): It has zero runtime dependencies, an MIT licence, and a Scorecard of 7.3 with good workflow hygiene. Four high-severity SQL injection advisories came out in 2026, all in sql.lit and JSON-path APIs or in untyped use, and all were patched. One fix in 0.28.12 was incomplete and needed a later patch. Code-Review scores 0, and there is no fuzzing.
  - GPT-6.2 Sol (7.3): The MIT-licensed core has zero runtime dependencies, and the tagged npm workflow uses OIDC and staged publishing. Version 0.29.9 contains fixes for all five upstream advisories, including a moderate SQL Server issue missing from the supplied feed that was patched before disclosure. Follow-up advisories exposed gaps in earlier JSON-path fixes. OpenSSF Scorecard gives strong marks for CI and token permissions, with zero scores for code review and fuzzing.

## Good

- Typing for joins, subqueries and selected columns is very precise, and result types are inferred with no codegen at runtime.
- It has zero dependencies, a small bundle, and runs on Node, Deno, Bun, browsers and edge runtimes through many dialects.
- Code reads like SQL, so you learn little new API and the queries are easy to check.
- Well-known tools build on it, including Better Auth and the ZenStack v3 engine, and kysely-codegen keeps types in sync with the database.

## Bad

- It is not an ORM: there are no declarative models, no relation loading, and migrations are not generated.
- It is still 0.x, and minor releases break things: 0.29 went ESM-only and moved the migration exports.
- Four high-severity SQL injection advisories came out in 2026, in the raw-literal and JSON-path APIs.
- A small volunteer core team handles releases, and code review is not enforced on every change.

## The numbers

- Downloads, 4 weeks: 118M
- In a year: ×23
- GitHub stars: 14k
- Commits, 12 months: 430
- Last npm release: Nov 2026
- Advisories, 24 months: 4
- Licence: MIT
- GitHub: https://github.com/kysely-org/kysely
- npm: https://www.npmjs.com/package/kysely

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 21 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
