klay-kiln-sql v1.2.0 is a Kiln extension that generates SQL model schemas and migrations from Klay entity definitions. It produces idiomatic DDL for PostgreSQL, SQLite, and MySQL, supporting indexes, foreign keys, and type mappings. Released on a monthly cadence, it integrates with Klay's Kiln code generation pipeline, differentiating itself by offering a schema-first approach with type-safe TypeScript output.
npm install klay-kiln-sqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to define a Klay model and generate PostgreSQL DDL using generateSQL.
Use dialect: 'postgresql' instead of 'postgres'.
Use directly as a string; if you need individual statements split by semicolons.
Use check constraints or JSON fields for SQLite enum workarounds.
Manually name foreign keys using the `foreignKeyName` option on relations.
Use import { generateSQL } from 'klay-kiln-sql' or dynamic import.Use dialect: 'postgresql'.