Releases: quantumsheep/dbdiff
Releases · quantumsheep/dbdiff
Release list
v1.2.0
Breaking changes
- Type
dbdiff diff <source> <target>. The bare form withoutdiffis removed. - The
--driverflag is now optional. dbdiff detects the engine from the source and the target. - The old
driverspackage moves tointernal. The newdriversandmigrationspackages give the stable Go API.
Highlights
- Go API:
drivers.Diffreturns the statements of a diff, andmigrations.Upandmigrations.Statusrun the migrations, with functional options. - Migrations: the
migratecommand group builds migration files from a diff and applies them with a lock and a history table. Seven subcommands:generate,status,preview,up,step,verify, andrepair. - SQL sources: an argument can name a
.sqlfile or a directory of.sqlfiles. - Data comparison: the
--dataflag compares the rows of each table that holds a primary key. - New diff flags:
--comments,--privileges,--exit-code, and--version. - PostgreSQL: the diff compares partitions, materialized views, policies, rules, procedures, extended statistics, identity and generated columns, object comments, and more.
- SQLite: the diff compares virtual tables, constraint names and clauses, index key options, and the parts of a
CREATE TABLEstatement that no PRAGMA reports. - A
.sqlfile with-- dbdiff:no-transaction, or the Atlas line-- atlas:txmode none, runs one call for each statement.
Fixes
- SQLite: the driver quotes every identifier, recreates a table safely, and guesses a rename with one candidate only.
- PostgreSQL: the statement order is stable, a column can change between
serialand a plain integer, and a recreated object keeps its owner, grants, policies, and triggers. - Data comparison: timestamps format in UTC,
NaNvalues quote correctly, generated columns skip, and child rows delete before parent rows. - Migrations: two files of one version give an error, a half-applied file writes a dirty history row, and a
.down.sqlfile does not apply.
Full changelog: v1.1.0...v1.2.0