Reputation: 1660
Is there any way to generate SQLite database model from Java code using JOOQ?
Upvotes: 0
Views: 850
Reputation: 221031
You can generate DDL statements like CREATE TABLE ..
or ALTER TABLE .. ADD CONSTRAINT ..
using the DSLContext.ddl()
API, for instance:
// SCHEMA is the generated schema that contains a reference to all generated tables
Queries ddl =
DSL.using(configuration)
.ddl(SCHEMA);
for (Query query : ddl.queries()) {
System.out.println(query);
}
This is documented here: https://www.jooq.org/doc/latest/manual/sql-building/ddl-statements/generating-ddl/
Upvotes: 1