I’ve been digging into the current codebase for Liquibase as I’m trying to add an enhancment that lets me conditionally run entire xml files based on the status of the database.
But to do this doesn’t seem straight forward, the XML is parsed using a SAX event parser, that while works, looks like it requires lots of management.
I’m not sure of a better way, but some sort of node registration and parsing logic might be useful, and that way would decouple the structure of the XML from the java objects built to register it.
Am I completly reading the code wrong, and there is an easy way to add in my own nodes, or would something like this be useful?
I’m most happy to start looking into solutions to move in this direction, but only if people think it would be used.
I’m not completely sure what you are looking for. There is the extension system (liquibase.org/extensions) that lets you add custom changes or override existing tags which would let you put whatever logic you want in them.
At the changelog file level, the general code path is to have a ChangeLogParser (the xml one is currently sax based) which converts the changelog file into a DatabaseChangeLog Object which the rest of the code deals with. You could override the default xml changeLogParser and modify the generated DatabaseChangeLog object before returning it.