You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d8dc7c6
Browse filesBrowse the repository at this point in the historyBrowse files
A diff reads a database in many queries. A change made while it ran —
a migration, a table someone added — was seen by some of them and not
others, and the diff could describe a database that never existed: a
foreign key to a table it did not read, a view on a column it read
before the column was dropped.
Each side now opens a REPEATABLE READ, READ ONLY transaction that
exports its snapshot and stays open for the run, and the connection
DBDiff reads with joins it, including the one made again for each
schema of a multi-schema diff. Definitions are still rendered with
temporary objects, inside a savepoint that is rolled back; a read that
may fail runs inside one too, so the transaction stays usable. A server
that cannot export a snapshot is read as before, and the log says so.
As with pg_dump, what the reads lock stays locked until the run ends.
--no-snapshot reads each query on its own. MySQL and SQLite are
unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -433,6 +433,8 @@ _Flags always override settings in `.dbdiff`._
433
433
|`--schemas=<list>`| PostgreSQL: the schemas to compare (supports globs). Defaults to `public`. `--schemas='*'` compares every schema but the system's own; `--schemas=public,app` compares two. Objects outside `public` are named in full in the migration, and a schema only one side has is created or dropped. |
434
434
|`--ignore-schemas=<list>`| PostgreSQL: schemas to skip (supports globs). On its own, compares every other schema. Example: `--ignore-schemas=auth,storage,extensions`|
435
435
|`--allow-destructive`| Generate the migration even when it contains data-losing changes. See [Destructive Change Protection](#destructive-change-protection). |
436
+
|`--renames=auto\|off`| PostgreSQL: `auto` (the default) renames a column, table or sequence whose only difference is its name, keeping its data, where exactly one such pair exists. `off` drops and adds instead. |
437
+
|`--no-snapshot`| PostgreSQL: read each query on its own. By default each side is read as of one instant, in a `REPEATABLE READ` transaction held for the run, so a change made while the diff runs is seen by all of its reads or by none. As with `pg_dump`, what the reads lock stays locked until the run ends, so DDL on that side waits for it. |
436
438
|`--debug`| Enable verbose error output. |
437
439
|`server1.db1:server2.db2`| Databases to compare. Or a single table: `server1.db1.table1:server2.db2.table1`. |
0 commit comments