I would like to embed Liquibase in my application. As a standard practice I want to use in-memory H2 or HSQLDB for development and PostgreSQL/Oracle for deployment. The schema generation (during development and production) should happen through Liquibase. I know I can call the main method of Liquibase to do this (which in turn can read from liquibase.properties) but what I really want to be able to do is to pass a DataSource (or a Connection) instance to Liquibase so that Liquibase can generate the schema.
Embedding Liquibase is important in this case because in-memory databases must be created in the same JVM process to be useful. Is there a set of recommended API that I can use? Thanks in advance for any pointers.