I am exploring a replacement for dbdeploy for my project and far as I can see Liquibase fits the bill.
Our current dbdeploy delta scripts (in their now dead language) makes use of Apache Velocity for some parameters etc. The scripts themselves otherwise are then plain SQL. In dbdeploy we read all the delta scripts, process the velocity script part and send the resulting SQL to dbdeploy.
Is anything like this possible in Liquibase? I.e. a mechanism where I can manipulate each changelog before it is executed?
PS! This processing is done from Java, by the way.
When Liquibase executes you point it at a set of changelog files. You can process those changelogs before you start Liquibase if you want to. But you need to be careful not to modify a changeset that has already been executed, or you will get a checksum error (unless using runOnChange, but that’s another discussion). You can also include variables in your changelogs, and provide values for those variables at execution time.
Plain SQL is fine in Liquibase, but I would recommend converting to Liquibase formatted SQL, which adds important metadata for Liquibase.
The dbdeploy mechanism is such that, it reads and identifies the change scripts it want to run. The user can extend a script handler class that is presented a string of the changescript dbdeploy intend to run. The velocity processing can then be done and the resulting script handed to the next step of executing it.
I was hoping for something similar so I don’t have to manipulate about 100 change scripts…
Sorry, I’m a DBA, I don’t really understand any of what you provided. Maybe somebody else can assist.
@rgellein Are you trying to deploy different sets of changes from the same source, depending on some set of context provided?
If so, check out This is a Story about Control: context-filter, label-filter | Liquibase.com
You also might be interested in Preconditions preconditions | Liquibase Docs
Thanks, for the link. I was thinking that, that might provide the answer, yes. Will check it out