Hey everyone!

I'm relatively new to JOOQ and eager to find some guidance. I'm working 
with a stack that includes Kotlin, Spring Boot, Flyway, Testcontainers, and 
JOOQ.

Here's what I'm aiming to achieve:

   1. When I run the gradle build task, I want it to start a Testcontainer 
   with an empty PostgreSQL database, then execute Flyway migrations, and 
   finally, have JOOQ codegen generate Java/Kotlin code.
   2. When running tests, either keep the Testcontainer running (which 
   might not be the best solution) or have it start only with the integration 
   tests.
   3. Ultimately, I want everything related to containers to shut down 
   properly.

I couldn't find a straightforward solution for this, but I did find 
something similar using docker-compose (before moving to tests).

Here's an example implementation: 
https://github.com/Ulllie/battle/tree/feature/test-jooq-with-testcontainer/jooq

BUT, the main issue arises when tests start running. JOOQ codegen tries to 
connect to the database again and fails because it wants to connect to port 
5432, but in my tests, I intend to use TestContainers.

This setup might be overkill, and I'm confident there could be a simpler 
solution.

The whole idea is to be able to run a single command - gradle build, 
without any pre-existing databases, to handle migrations, generate JOOQ 
classes, and then run integration tests. Plus, I can't figure out how to 
separate these concepts, i.e., I want to keep the ability to run tests by 
themselves.

I realize my question is a bit sprawling, so thanks in advance for bearing 
with me and any help you can offer

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/f56e3fd7-b860-4c4e-8aca-10a109efb9a9n%40googlegroups.com.

Reply via email to