kysely-codegen-sqlite v0.2.0 generates Kysely type definitions (.d.ts files) directly from SQLite databases. It supports CLI and configuration file usage, camelCase conversion, custom type imports, and requires Node >=20. Unlike generic codegen tools, it is purpose-built for SQLite and integrates tightly with Kysely and better-sqlite3. The library is ESM-only and ships TypeScript types.
npm install kysely-codegen-sqliteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows end-to-end setup: install deps, configure env, run codegen CLI, and use generated DB type with Kysely.
Upgrade Node.js to >=20.0.0 if using this version.
Do not edit the generated .d.ts file; custom types should be declared separately.
Import DB from the generated output file (e.g., ./db.d.ts) rather than the package name.
Use CLI argument --camel-case or enable in config file to match Kysely's CamelCasePlugin.
Do not import from 'kysely-codegen-sqlite' in your runtime code. Instead, import the generated .d.ts file.
Use npx kysely-codegen-sqlite instead of the bare command, or install locally with npm install --save-dev.
Ensure your database file is accessible and tables exist. Check DATABASE_URL in .env or provide --db-url explicitly.