Skip to content

shki

Author your schema in SQL. Let shki work out the migration.

shki manages database schema change by comparing an intended database shape with recorded schema history and producing migration artifacts. The direction is SQL-first and Drizzle-inspired:

  • You author a Declarative Schema in SQL.
  • shki compiles it in a disposable Shadow Database.
  • The resulting Snapshot is compared with the latest recorded Snapshot from the Journal.
  • shki diff previews the Migration Plan.
  • shki generate writes migration SQL, a new Snapshot, and a Journal entry.
  • shki migrate applies migration artifacts to the live database.

Quick start

Initialize a project, edit schema/main.sql, and generate your first migration. Quick start

How it works

Shadow Database, Snapshots, and the Journal — what shki is actually doing. How it works

Declarative Schema

Single file or directory, extensions, and Shadow Database setup. Declarative Schema

Migrations

Preview, generate, hand-write, apply, adopt, and roll back. Migrations

Codegen

Rust, TypeScript, and Protobuf types, plus type-safe sqlx query functions. Codegen · Typed queries