If you're tired of ORMs abstracting away SQL or plain query strings losing type safety at runtime, this is the middle ground. You get full TypeScript inference from schema to results without the overhead of an ORM. Define your database types once, then chain selectFrom, where, and joins with complete autocomplete and compile-time checks. It includes migrations, works across Postgres, MySQL, and SQLite, and lets you drop into raw SQL when you need it. The kysely-codegen tool generates types directly from your existing database, so you're not manually syncing schemas. It's legitimately just a query builder that compiles to SQL, nothing more, which is exactly the point.

skills.sh installs
398
GitHub stars
79
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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;
}

Sponsors

Details

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

More from bobmatnyc/claude-mpm-skills

All 158

Recommended

More Databases
1levnikolaevich avatarln-113-backend-docs-creatorlevnikolaevich/claude-code-skillsCreates backend docs (api_spec.md, database_schema.md). Use when project has backend API or database.384skills.sh installs
2levnikolaevich avatarln-723-seed-data-generatorlevnikolaevich/claude-code-skillsGenerates seed data from ORM schemas or entity definitions to any target format. Use when populating databases for development.360skills.sh installs
3dinerojs avatardinero-currency-patternsdinerojs/skillsCurrency handling patterns for the Dinero.js money library. Use when working with multiple currencies, converting between currencies, defining custom currencies349skills.sh installs
4patricio0312rev avatarbackup-restore-runbook-generatorpatricio0312rev/skillsCreates comprehensive disaster recovery procedures with automated backup scripts, restore procedures, validation checks, and role assignments. Use for "database291skills.sh installs
5patricio0312rev avatarinput-validation-sanitization-auditorpatricio0312rev/skillsIdentifies and fixes XSS, SQL injection, and command injection vulnerabilities with validation schemas, sanitization libraries, and safe coding patterns. Use fo285skills.sh installs
6davila7 avatarrailway-newdavila7/claude-code-templatesCreate Railway projects, services, and databases with proper configuration. Use when user says "setup", "deploy to railway", "initialize", "create project", "cr284skills.sh installs