网页
综合
更新时间 2026-11-14 16:26:16
Kysely — Type-safe SQL query builder for TypeScript
自动蜘蛛
kysely.dev
正文约 1783 字
Mature, predictable SQL, precise types, tight feedback loops.Runs everywhere: Node, Deno, Bun, Workers, Browsers.
or audit us on socket.dev
Non-existent tables, misspelled columns, mistyped values: Kysely surfaces them as you type, as agents code, and as your schema evolves, not in production at 3am.
When a column gets renamed, the TypeScript compiler walks you through every query that needs updating.
Extract any fragment of a query into a plain, typed function and reuse it across queries. Expressions, subqueries, and CTEs all compose the same way. It's just TypeScript.
Here, a correlated subquery returns each person's pets as typed, nested JSON. One query, one round trip, no relations DSL to learn.
What Kysely optimizes for.
Precise TypeScript result types and compile-time errors within queries. With introspection and codegen, your database is the source of types.
A thin abstraction layer over SQL, crafted by SQL lovers for SQL lovers. Familiar naming, predictable 1:1 query compilation.
Your database schema types flow through Kysely's fluent API. A typing experience second only to full-blown database IDEs.
Spec-faithful APIs for everything production teams need, composable all the way down, escape hatches everywhere.
No environment-specific APIs, nothing to bundle around. Runs in Node.js, Deno, Bun, AWS Lambda, Cloudflare Workers, and browsers.
Plugins modify queries before compilation and results after execution. camelCase to snake_case and back, for example.
Everything is documented inline, with type-checked code examples that can't drift. Hover docs for humans, rich context for agents.
PostgreSQL, MySQL, MS SQL Server, SQLite, and PGlite out of the box, plus a community-driven dialect system for everything else.
Unprompted, in public, on the record.
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。