What problem does it solve?
This Skill helps developers write safe, expressive PostgreSQL queries in Node.js/TypeScript projects using Kysely, reducing runtime SQL errors and enabling robust data access patterns.
Core Features & Use Cases
- Type-safe query patterns: select, where, joins, aggregates, and advanced expressions using the Kysely Expression Builder.
- Migrations and schema evolution: define migrations, up/down scripts, and safe column types with type-checked builders.
- JSONB and array handling: work with JSON/JSONB and array columns natively without manual string parsing.
- Complex relations and subqueries: nested json helpers (jsonArrayFrom/jsonObjectFrom) and subquery joins to fetch related data in a single query.
- Pitfalls and best practices: guidance on type generation, performance, and TS inference.
Quick Start
Install and configure Kysely with PostgreSQL in your Node.js project. Then begin using the patterns described above to craft type-safe queries and migrations.