Kysely

Build type-safe SQL queries in TypeScript with compile-time validation.

Updated Feb 12, 2026
One-click install
npx skills add https://github.com/nhattran998/crossfire --skill kysely-nhattran998
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Kysely
Source: https://github.com/nhattran998/crossfire/tree/main/.agents/skills/kysely
Command: npx skills add https://github.com/nhattran998/crossfire --skill kysely-nhattran998

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kysely eliminates runtime SQL mistakes by providing compile-time type safety for building and executing SQL queries in TypeScript.

Core Features & Use Cases

  • Type-Safe Query Building: Compile-time SQL validation with automatic type inference from a TypeScript schema.
  • Fluent, Composable API: Build selects, joins, inserts, updates, deletes, aggregations, and pagination in a readable chainable style.
  • Database-Agnostic Support: Use the same typed query patterns across engines like PostgreSQL, MySQL, and SQLite by swapping dialect configuration.

Quick Start

Use the Kysely Skill to run a type-safe query that selects specific user columns where the id equals 1.

Frequently Asked Questions about Kysely

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

FAQPage Schema
How do I write type-safe SQL queries in TypeScript to prevent runtime errors?

Type-safe SQL queries in TypeScript are built by defining a typed schema interface and using a fluent query builder API to validate columns and result shapes at compile time. This prevents invalid SQL from reaching your database.

What is the best way to build type-safe database queries for PostgreSQL in a web backend?

Building type-safe database queries for PostgreSQL involves configuring a dialect and connection pool, then chaining composable query methods for selects, joins, and CRUD operations to return strongly typed results.

Can I use the same type-safe query builder for MySQL and SQLite databases?

Yes, the same type-safe query builder supports MySQL and SQLite databases. You can apply typed query patterns across different engines by simply swapping the dialect configuration in your database connection setup.

How do I set up a TypeScript schema interface for type-safe SQL query building?

To set up a TypeScript schema interface for type-safe SQL query building, define your database tables and columns as TypeScript types. The query builder uses this interface to automatically infer types and validate queries at compile time.

Does type-safe query building handle complex operations like joins and pagination?

Yes, type-safe query building handles complex operations like joins and pagination. You can build these operations in a readable, chainable style while the API ensures the joined columns and filtered results remain strongly typed.