Hi,
I need to do a diff between a Liquibase changelog and a database, so first I need to load the changelog into another database so I can run the diff. If I load it into an in-memory DB like HSQL I’ll get all kinds of invalid differences such as data types, indexes, foreign keys… because HSQL works differently than DB2 or MySQL…
So I decided to try to build my own generic SnapshotGenerator that I can use to mirror any other type of database.
I would load the changelog into my GenericSnapshotGenerator and also pass it a reference to the other Database that I’ll be comparing it with (such as DB2Database). Then I would forward any read-only calls to the other database class (such as getDatabaseProductVersion(), isSystemTable()…) but handle calls that modify the DB myself (such as adding tables…) by creating the SQL objects in-memory using the classes already defined by Liquibase.
I have some questions though.
First, can anyone think of a better way to do this?
Second, how can I translate the SQL statements into Liquibase SQL objects (without reinventing the wheel)?
-
Learn
-
Resources
-
Free Tools
OSS Risk Scanner Database DevOps Risk AssessmentCheat Sheets
Snowflake + Liquibase Databricks + Liquibase -
eBooks
6 Liquibase Community Risks & How to Avoid Guide: SOC 2 Compliance at the Database Layer Guide: Quantify the Value of Liquibase Secure -
Comparison Guides
Liquibase vs. Flyway Liquibase vs. Bytebase Liquibase Community vs Liquibase Secure
-
- Quickstart
- Get Started
- Documentation
- University
-
Resources
- Connect
- Contribute
- Join
- Blog