Leander
Leander

Reputation: 1395

Create Table from generated classes

I have generated the representations for my database-model in jooq. Can I use this to recreate the Database?.

createTable(org.jooq.Table<?> table) wants me to specify the columns.

Ideally when the schema changes, i would just update the jooq representation and when another user installs it it would automatically create the right schema.

Upvotes: 2

Views: 300

Answers (1)

Lukas Eder
Lukas Eder

Reputation: 220762

There is a pending feature request for this kind of functionality: https://github.com/jOOQ/jOOQ/issues/3160

But as of jOOQ 3.7, this isn't yet possible. The main challenge is the fact that the generated schema meta information will always lack important pieces (e.g. vendor-specific storage clauses), so this kind of functionality is good for simple databases or test databases at best.

Upvotes: 1

Related Questions