SQLcl Liquibase - generate-schema enhanced. Capture only new changes since provided date.

Oracle APEX & PL/SQL Developer with 10 years of experience in IT, including financial systems for government administration, energy, banking and logistics industry. Enthusiast of database automation. Oracle ACE Associate. Certified Liquibase database versioning tool fan. Speaker at Kscope, APEX World, SOUG, HrOUG, POUG and DOAG. Likes swimming in icy cold lakes in winter and playing basketball.
SQLcl Liquibase generate-schema command is excellent (read more here)
But what If I don't want to capture all my objects repeatedly?
I want to capture, e.g. every week, all the objects that have changed since the previous run.
So I'm missing something like:
"liquibase generate-schema changesSince 2023-07-01"
Hopefully, Oracle will add this feature soon.
But meanwhile, I created a workaround SQL script for that.
Details:
It takes objects that changed in the last few days
Then dbms_output a script for SQLcl Liquibase.
You should create a temp folder, e.g. changesSince, go there, log into SQLcl and execute received dbms_output
It executes "liquibase generate-object --object-type TYPE --object-name NAME" as many times as many objects change (this command generates only one object per one execution, instead of all objects)
If there are new objects, remember to add new lines to controller.xml - you can use ChatGPT to help you with that :)
https://gist.github.com/rgrzegorczyk/11f3f48913e3d23f307040f3dc42e0b8
Feel free to use it or improve it. But don't just copy/paste and run. Try to understand this script, as you are using it at your own risk :)




