What problem does it solve?
It prevents slow, incorrect, and non-portable database implementations by providing a repeatable Drizzle ORM + Postgres blueprint for schemas, queries, mutations, transactions, indexes, pagination, and performance checks.
Core Features & Use Cases
- Portable schema conventions: enforce a canonical Drizzle shape with
$inferSelect/$inferInsert, snake_case DB columns, camelCase TS properties, and domain-based schema files.
- Safe data modeling patterns: relations, enums, audit columns, soft delete rules, and dual-ID modeling with concurrency-safe
human_id generation.
- Query and mutation best practices: parameterized queries, correct upserts, consistent transaction usage, and N+1 avoidance via joins/relations.
- Indexing and performance workflow: choose correct Postgres index types, order composite index columns by query shape, and require
EXPLAIN ANALYZE before optimizing.
Quick Start
Use kb-db to implement or review a Drizzle ORM schema and queries for a Postgres-backed feature, ensuring timezone-aware timestamps, safe soft-delete reads, correct relations, and performance-validated indexing.