Repository navigation
Verify and document pg_dump schema snapshot input - #69
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A service that does not keep its schema as SQL migrations, such as one using a Liquibase changelog or a JPA-generated schema, can point sqlcj at a
pg_dump --schema-onlyfile. This change adds a reference service and a PostgreSQL integration test showing that its migration history, an equivalent hand-written snapshot, and a livepg_dumpof the migrated database generate the same compiling, executable Java. It also documents the dump as a supported schema input.Changes
LIKEcopy and partitions, plus an equivalent hand-written snapshot and a query group over its tables.ReferenceServiceIntegrationTest, which:psqland runspg_dump --schema-onlyagainst the migrated database,ALTER COLUMN ... SET DATA TYPEmigration and the unknown-table diagnostic for a query naming a table of another schema, neither writing any file.pg_dump --schema-onlysnapshot as a schema file in the configuration reference.SETpreamble, identity and sequence statements, constraints, grants and other schemas,public.qualification,Scope and non-goals
pg_dumprun writes a new\restrictkey.ALTER COLUMN ... SET DATA TYPEremains unsupported and is rejected with its location.DOblocks or function bodies, and columns removed byDROP TYPE ... CASCADE, are still not read from a migration history. The documentation names them as the cases where a dump and its history differ.