shki diff
shki diff [--shadow-database-url URL] [--pg-version 14..18]Compiles the Declarative Schema in the Shadow Database, snapshots the result, and compares it with the latest Snapshot recorded in the Journal. Prints an object-level summary of the resulting Migration Plan, including rename candidates.
diff writes no files, prints no SQL, and never touches the live database. It
is the safe command to run as often as you like.
Options
Section titled “Options”| Flag | Purpose |
|---|---|
--shadow-database-url <URL> |
Use an external Shadow Database. Env: SHKI_SHADOW_DATABASE_URL. |
--pg-version <14…18> |
Embedded PostgreSQL major version. Default 18. Env: SHKI_PG_VERSION. |
-v, --verbose |
More detail about the compile and diff. |
Examples
Section titled “Examples”shki diffshki diff --pg-version 16shki diff --shadow-database-url postgres://user:pass@localhost:5432/shki_shadow- If any Custom Migrations have no Snapshot yet,
diffreplays them on the Shadow Database first so the baseline is complete. - “No schema changes detected” means the Declarative Schema and the latest Snapshot agree — nothing to generate.
- An index declared
CREATE INDEX CONCURRENTLYdiffs exactly like a plain one: the keyword is a creation strategy, not schema state. It only changes whatshki generatewrites. - PostgreSQL only: Declarative Schema compilation is not implemented for MySQL, and is planned for SQLite.
See also: shki generate,
How It Works.