Skip to content

AlexRITIAN/codegen-gradle-plugin

Repository files navigation

codegen-gradle-plugin

Derived from gradle-jooq-plugin, this plugin is designed for code generation with additional default configurations for ease of use. It utilizes flyway and testcontainer to generate code from a local database.

Usage

Applying the Plugin

plugins {
    id 'io.github.alexritian.codegenGradlePlugin'
}

Configuring the Plugin

jooq {
    configurations {
        main {
            database {
                schema = 'public'
                includes = '.*'
            }
            output {
                packageName = 'io.github.alexritian.codegen'
            }
            forcedTypes {
                timestampToInstant()
            }
        }
    }
}

Note

The extension name follows gradle-jooq-plugin conventions. Multiple configurations are supported as well.

database

By default, testcontainer will start a database instance. To use a different database, you can specify the url, driver, user, and password parameters.

forcedTypes

You can configure some forced type conversions. The timestampToInstant function converts the following database types to java.time.Instant:

  • timestamp
  • timestamp without time zone
  • timestamp with time zone
  • timestamptz

Note

Currently, only the timestampToInstant method is available, but additional type conversion methods will be added in the future.

Other Configurations

Some default configurations are provided based on gradle-jooq-plugin.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages