Skip to content

Type-safe SQL query builder with full schema-to-result inference, zero ORM overhead, and raw SQL escape hatches.

CCM score
51 of 100
skills.sh installs
407
GitHub stars
79
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers schema typing, CRUD, joins, aggregations, subqueries, CTEs, and recursive queries across PostgreSQL, MySQL, SQLite, and MSSQL
  • Includes migrations, transactions, and a plugin ecosystem for CTEs, JSON, and geospatial queries
  • Generates types from an existing database via kysely-codegen with npx kysely-codegen --url
  • Designed for teams building type-safe database layers or migrating away from heavier ORMs

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill kysely -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Kysely - Type-Safe SQL Query Builder

Overview

Kysely is a type-safe TypeScript SQL query builder that provides end-to-end type safety from database schema to query results. Unlike ORMs, it generates plain SQL and gives you full control while maintaining perfect TypeScript inference.

Key Features:

  • Complete type inference (schema → queries → results)
  • Zero runtime overhead (compiles to SQL)
  • Database-agnostic (PostgreSQL, MySQL, SQLite, MSSQL)
  • Migration system included
  • Plugin ecosystem (CTEs, JSON, geospatial)
  • Raw SQL integration when needed

Installation:

npm install kysely
# Database driver (choose one)
npm install pg              # PostgreSQL
npm install mysql2          # MySQL
npm install better-sqlite3  # SQLite

Quick Start

1. Define Database Schema Types

import { Generated, Selectable, Insertable, Updateable } from 'kysely';

// Table interface (all columns)
interface UserTable {
  id: Generated<number>;
  email: string;
  name: string | null;
  created_at: Generated<Date>;
  updated_at: Date;
}

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Category
Databases
First seen
Jun 3, 2026

Questions

What does the kysely skill help with?

The kysely skill covers the Kysely type-safe SQL query builder for TypeScript, giving end-to-end type inference from database schema to query results. It covers queries, joins, subqueries, CTEs, migrations, transactions and plugins, and it works with PostgreSQL, MySQL, SQLite and MSSQL. Kysely generates plain SQL, so it adds no ORM runtime overhead.

How do I install the kysely skill?

Run npx -y skills add bobmatnyc/claude-mpm-skills --skill kysely -y in your project. Once installed, the agent can build type-safe database layers and write queries against your schema.

Where does kysely rank among Databases skills?

Kysely is listed in the Databases category on Claude Marketplaces, alongside supabase-postgres-best-practices and several Prisma skills. Its focus is raw-SQL control with full TypeScript types rather than an ORM abstraction.

What do I need before using kysely?

You need a Node.js project and the kysely package plus a database driver such as pg for PostgreSQL, mysql2 for MySQL, or better-sqlite3 for SQLite. Database connection settings are read from environment variables in the examples.

Can kysely generate types from an existing database?

Yes, the skill shows using kysely-codegen to generate TypeScript table and Database types from a live database URL. This lets you start type-safe work on an existing schema without writing interfaces by hand.

More from bobmatnyc/claude-mpm-skills

All 154

Similar to Kysely

More Databases