Kysely - Type-Safe SQL Query Builder

Build type-safe SQL queries in TypeScript with zero runtime overhead.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/MacPhobos/research-mind --skill kysely-type-safe-sql-query-builder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Kysely - Type-Safe SQL Query Builder
Source: https://github.com/MacPhobos/research-mind/tree/main/.claude/skills/toolchains-typescript-data-kysely
Command: npx skills add https://github.com/MacPhobos/research-mind --skill kysely-type-safe-sql-query-builder

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a robust solution for building type-safe SQL queries in TypeScript, ensuring that your database interactions are secure and predictable, bridging the gap between raw SQL power and TypeScript's static typing.

Core Features & Use Cases

  • End-to-end Type Safety: Guarantees type consistency from your database schema all the way to your query results.
  • Zero Runtime Overhead: Compiles directly to plain SQL, offering maximum performance.
  • Database Agnostic: Supports PostgreSQL, MySQL, SQLite, and MSSQL.
  • Migration System: Includes built-in tools for managing database schema evolution.
  • Plugin Ecosystem: Extensible with plugins for CTEs, JSON operations, geospatial data, and more.
  • Use Case: A developer needs to build a complex reporting query involving multiple joins, aggregations, and CTEs. Using Kysely, they can write this query in TypeScript with full type safety, ensuring the output structure matches their expectations and preventing runtime errors.

Quick Start

Use the Kysely skill to define your database schema types and create a type-safe query instance.

Frequently Asked Questions about Kysely - Type-Safe SQL Query Builder

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 runtime overhead?

You can build type-safe SQL queries in TypeScript by using a query builder that compiles directly to plain SQL. This approach guarantees end-to-end type consistency from your database schema to query results with zero runtime overhead.

What's the best way to manage database schema evolution in a TypeScript SQL query builder?

The best way to manage database schema evolution is using a query builder with a built-in migration system. This allows you to track and apply schema changes predictably while maintaining type safety across your TypeScript codebase.

Does this TypeScript SQL query builder support PostgreSQL, MySQL, and SQLite?

Yes, this TypeScript SQL query builder supports multiple database dialects including PostgreSQL, MySQL, SQLite, and MSSQL. It compiles to plain SQL for any of these databases while maintaining end-to-end type safety.

How do I write complex reporting queries with multiple joins and aggregations in TypeScript?

To write complex reporting queries with multiple joins and aggregations in TypeScript, use a type-safe SQL query builder. It ensures the output structure matches your expectations and prevents runtime errors during query compilation.

Can I use raw SQL integration and plugins for JSON operations in a type-safe query builder?

Yes, you can use raw SQL integration and an extensible plugin ecosystem for advanced operations like JSON and full-text search. This allows you to execute specialized queries while preserving TypeScript type safety.

Why use a type-safe SQL query builder instead of an ORM for TypeScript database interactions?

You should use a type-safe SQL query builder instead of an ORM to bridge the gap between raw SQL power and static typing. It compiles to plain SQL directly, offering maximum performance without the heavy abstraction of an ORM.