I use my liqibase scripts for Jooq code generation. As I learned from the instructions and log, the Dialect is H2.
Is that a problem if the application runs against a SQL Server database afterwards? Does the code generation have to be adjusted or do the metaclasses remain the same?
<plugins>
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
...
<configuration>
<generator>
<name>org.jooq.codegen.JavaGenerator</name>
<database>
<name>org.jooq.meta.extensions.liquibase.LiquibaseDatabase</name>
The LiquibaseDatabase
can be used for simple database schemas where it is desirable not to connect to an actual database instance (e.g. for performance reasons) in order to generate code. It's drawbacks are that it's not an actual SQL Server database, but a simulated migration - currently on an in-memory H2 database. This means that some vendor specific functionality may not work as expected.
It is usually better not to use the above utility for more complex schemas with vendor specific features (e.g. stored procedures, etc.). Instead, use the SQLServerDatabase
that connects to an actual database instance.
You could still use Liquibase on a testcontainers based SQL Server instance to set up your schema prior to generating jOOQ code, as explained in this blog post here.