- migration writer now emits unique constraints (direct apply and live diff
previously dropped them); idempotent via the existing DO block
- unique constraint adopts a same-named model unique index with
ADD CONSTRAINT ... UNIQUE USING INDEX instead of building a second index
- dbml reader names unnamed unique indexes ukey_<table>_<cols> to match the
unique constraint naming
- foreign key deferral: Constraint.Deferrable/InitiallyDeferred are *bool
(nil = unspecified, never diffed); writers emit DEFERRABLE, DEFERRABLE
INITIALLY DEFERRED and NOT DEFERRABLE; live reader reads condeferrable and
condeferred; dbml reader/writer support deferrable and initially deferred
- tests and README/naming docs updated
- windows/installer.nsi: installs to Program Files, manages system PATH,
registers uninstaller
- relspec update [--check] [--yes]: compares against the latest release and
prompts; on Windows downloads and runs the installer
- release workflow builds and uploads relspec-setup-windows-amd64.exe
- make installer-windows
Enter on File Path inputs opens a file browser (load/save, extension
filter, hidden toggle, overwrite confirm). Enter on Connection String
inputs opens a builder for PostgreSQL, MSSQL and SQLite with masked
password/preview, parsing and optional connection test.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Poll source files/directories and regenerate output on change.
Output path is excluded from watching; errors don't stop the loop.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds WriterOptions.TypeMappings and a repeatable --type-map sqltype=gotype
flag. Defaults are unchanged when no mapping is given. Closes#36 (bun/gorm).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- bun: scanonly+generated for GENERATED columns; scanonly+identity for ALWAYS identity (PK gets identity only)
- gorm: <-:false+generated / identity, same primary key rule
- dbml: write GENERATED/IDENTITY column notes and read them back into the model
- pgsql: emit generation/identity clauses in migration create-table and add-column, no DEFAULT
- readmes updated
Direct pgsql output (job output.conn_env, merge --output-conn) now reads the live
schema and executes only the differences. full_ddl: true (job option) or --full-ddl
(merge) restores the full idempotent DDL; file output is unchanged.
- compare PKs by columns, skip constraint-backed indexes, normalize index method,
FK actions, serial/numeric types, default literals/casts and truncated names
- diff table and column comments instead of re-emitting them
- remove leftover ZZDUMP debug code
key_column_usage and constraint_column_usage were joined on constraint name only,
so an N-column foreign key returned N*N column pairs. Read from pg_constraint with
unnest(conkey, confkey) instead.
- derive the primary key sequence from the column's nextval() default instead of an unused identity_<table>_<pk> sequence
- setval after table creation (full and diff paths), forward-only, MAX+1 with is_called=false
- do not DROP DEFAULT on serial/bigserial columns without a model default
Generated files carried the RelSpec version and build date, so every
rebuild produced a diff even when the schema was unchanged.
- bun, gorm, drizzle: remove the GeneratedBy template field and line
- pgsql, mssql, sqlite: emit a constant "-- Generated by RelSpec"
- bun: replace the version header test with a version-free assertion
pkg/buildinfo is unchanged and still backs the CLI version.