Skip to content

Generates jOOQ Java classes from the database launched in Docker container after Flyway migrations were applied

License

Notifications You must be signed in to change notification settings

SuppieRK/jooq-java-class-generator

Repository files navigation

The work on this software project is in no way associated with my employer nor with the role I'm having at my employer.

I maintain this project alone and as much or as little as my spare time permits using my personal equipment.

Overview

FOSSA Status

This Gradle plugin acts as a glue between (and exposes) two other great plugins available:

This plugin adds a small missing part between those two plugins: Testcontainers to create a database during the Gradle build stage:

  • This allows running Flyway migration scripts against a real database instance.
  • And limits the scope of jOOQ code generation to only those made by specific codebase.

Usage

Using plugins DSL

plugins {
  id 'io.github.suppierk.jooq-java-class-generator' version '1.0.1'
}

Using legacy plugin application

buildscript {
  repositories {
    maven {
      url 'https://plugins.gradle.org/m2/'
    }
  }
  dependencies {
    classpath 'io.github.suppierk:plugin:1.0.1'
  }
}

apply plugin: 'io.github.suppierk.jooq-java-class-generator'

You can also check example-project in this repo

Configuration

Because this plugin represents a glue between other plugins, please consult with their documentation first:

This plugin will simply set certain configurations for those plugins during Gradle build stage.

The only configurable thing this plugin offers is to set a specific Docker image to be used by Testcontainers via:

jooqDockerImages {
    // These are default values that can be overridden
    postgres = 'postgres:16-alpine'
}

This configuration has been made to support jOOQ behavior when it comes to restricting code generation based on the database version or other dependencies within your project restricting your options, see the following comment

Arguably, this can also be automated based on jOOQ version support matrix, however I do not want to take away the ability to define your own Docker image.

License

FOSSA Status

About

Generates jOOQ Java classes from the database launched in Docker container after Flyway migrations were applied

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •