Proposal: add defaultValueBinary attribute on column tag

I’d like to propose another attribute permissible on the column tag: defaultValueBinary.

It seems to me that each database has a different way of loading binary data into blobs, clobs and varbinary columns.  However, the JDBC API unifies all these together with the setBlob() and setClob() APIs.

I would propose changing the XSD to permit such an attribute, standardize the text-representation of its value (perhaps hex notation, base64, something like that) and then changing the innards of Liquibase to detect such a value, if present, and use the relevant setBlob() calls to insert the value.

Obviously I’m just sketching here, but does this sound like a good idea?  The end goal is to get the refactoring to deal with blob/binary data as well in a database-independent fashion.


I had thought about it at one point too. I would think perhaps a more useful approach would be to specify a filename containing the binary data to use, and it woudl be up to the database implementation to format/encode it correctly. That way you could more easily view the binary data that would be inserted.

I haven’t implemented it primarily because I wasn’t sure the database support for setting binary data via SQL, but if anyone wants to attempt it, that would be great.