Tools/kysely-org/kysely

Kysely

Type-safe TypeScript SQL query builder

14.1k+27/wkgrowthTypeScriptMIT Licensenew this week

The Lens

By Erik Loyd, SaaS CEO and former COO/CFO of an AWS Premier Partner.

Updated Jun 2026

Kysely is a type-safe SQL query builder for TypeScript. It's not an ORM. It doesn't hide SQL behind methods. You write actual SQL, and TypeScript validates every piece of it.

The difference from Prisma or Drizzle: Kysely doesn't generate SQL from a schema file or provide an abstraction layer. You write SQL directly using a builder pattern, and the type system ensures it's correct. If a column doesn't exist on a table, TypeScript errors. If you try to compare a string column to a number, TypeScript errors. It's SQL with a safety net.

Completely free under MIT. No paid tier, no cloud service. It supports Postgres, MySQL, SQLite, and has community dialects for others. Drizzle ORM is the closest alternative, also type-safe, but with a more ORM-like API and built-in migrations. Prisma is easier to start with but generates heavier queries and has a larger runtime footprint.

The catch: the learning curve is steeper than Prisma. You need to understand SQL and TypeScript generics. Schema changes require manual type updates (or a code generator). It doesn't handle migrations; you'll need a separate tool. And because it's closer to raw SQL, it's more code to write than Prisma's concise API.

Free vs Self-Hosted vs Paid

fully free

Pricing Breakdown

Free tier: Everything. MIT licensed, no restrictions. Full query builder, all dialects, all features.

Self-hosted: N/A. It's a TypeScript library. Install via npm and import. Zero infrastructure.

Comparison to alternatives:

  • Drizzle ORM: Free (Apache 2.0). Type-safe with ORM features + migrations. Drizzle Studio for visual DB browsing. Most direct competitor
  • Prisma: Free open source, Prisma Accelerate (connection pooling/caching) starts at $0 with usage-based pricing. Easier to learn but heavier runtime
  • Knex.js: Free (MIT). The original JS query builder. Not type-safe but battle-tested
  • TypeORM: Free (MIT). Full ORM with decorators. Less type-safe than Kysely or Drizzle

The real cost: All the alternatives are free. The choice is about developer experience and SQL philosophy, not price. Kysely is for teams that want to write SQL and have TypeScript verify it. Drizzle is for teams that want type-safety with more convenience. Prisma is for teams that want to think less about SQL entirely.

Completely free. Choose based on how close to raw SQL you want to be, not price.

Self-hosting ops:trivial

Get tools like this every Wednesday

One featured tool, three on the radar. No fluff.

Similar Tools

Score
84/100 · A
Adoption25/30
Maintenance25/25
Community9/20
License15/15
Analysis10/10

A low score is not a verdict on quality. Young and niche tools start low by design. How we calculate scores

Trust Signals

High adoption: 13,682 starsPermissive license (MIT)

About

Stars
14,105
Forks
428

Explore Further

More tools in the directory