kysely

Build type-safe SQL queries for TypeScript with joins, subqueries, and CTEs.

68|19|Updated Nov 21, 2025
One-click install
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill kysely-bobmatnyc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kysely
Source: https://github.com/bobmatnyc/claude-mpm-skills/tree/main/toolchains/typescript/data/kysely
Command: npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill kysely-bobmatnyc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a type-safe way to build SQL queries in TypeScript, ensuring that your database interactions are robust and error-free, bridging the gap between your application code and your database.

Core Features & Use Cases

  • End-to-end Type Safety: Guarantees type consistency from your database schema to your query results.
  • SQL Control: Offers the power of raw SQL with the safety of TypeScript.
  • Use Case: When building a new feature that requires complex data aggregation from multiple tables, use Kysely to write precise, type-checked queries that prevent runtime errors and improve developer confidence.

Quick Start

Define your database schema types and then use the Kysely instance to chain query methods like .selectFrom(), .where(), and .execute().

Frequently Asked Questions about kysely

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build type-safe SQL queries in TypeScript without losing raw SQL control?

You can build type-safe SQL queries in TypeScript by defining your database schema types and chaining query methods like selectFrom(), where(), and execute(), ensuring end-to-end type consistency from schema to query results without runtime overhead.

What is a type-safe query builder and when do I need it for database interactions?

A type-safe query builder bridges application code and databases by enforcing schema-to-result type consistency, needed when constructing complex queries involving joins, subqueries, or CTEs to prevent runtime errors and improve developer confidence.

Does this type-safe SQL query builder support PostgreSQL, MySQL, and SQLite?

Yes, the type-safe SQL query builder supports PostgreSQL, MySQL, and SQLite, allowing you to execute type-checked queries and manage schema migrations across these database platforms within TypeScript applications.

Can I handle complex data aggregation from multiple tables using a TypeScript query builder?

Yes, you can handle complex data aggregation from multiple tables by using the query builder to write precise, type-checked queries with joins and subqueries that prevent runtime errors during data retrieval.

What is the best way to manage database schema migrations in a TypeScript application?

The best way to manage schema migrations in TypeScript is using a built-in migration system that facilitates schema evolution alongside type-safe query construction, ensuring database structure changes are tracked and applied systematically.

Are there runtime overhead concerns when using a type-safe query builder for SQL?

No, there is zero runtime overhead when using this type-safe query builder for SQL, as type checking occurs during compilation while the generated queries execute with the performance of raw SQL at runtime.