1

What does your approach to generating Records during compilation time look like without connection to the database? I use to maven plugin for that but I still need a connection to the database but I don't have one.

Matrix12
  • 446
  • 8
  • 19

1 Answers1

2

jOOQ offers 4 out of the box solutions to generating code without a connection to a live database, including:

All of the above meta data sources come with their own set of limitations, including lack of support for some vendor specific stuff, but that might not affect you. In simple cases, especially the DDLDatabase can be really useful to achieve quicker turnarounds when generating code.

If vendor specific functionality is a thing in your application, then the official recommendation is to use testcontainers to set up your schema for jOOQ code generation (and integration testing!).

Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
  • All these require an established connection to the database, right? I want to generate a record object without connection to the database. – Matrix12 Dec 27 '22 at 11:55
  • @Matrix12: None of the 4 `XYZDatabase` implementations I've losted do. Why not follow the links and learn about what they're doing? – Lukas Eder Dec 27 '22 at 13:14