New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a jOOQ-meta-kotlin module for kotlin extensions to the jOOQ-meta module #15400
Projects
Milestone
Comments
21 tasks
lukaseder
changed the title
Add a jooq-meta-kotlin
Add a jooq-meta-kotlin module for kotlin extensions to the jOOQ-meta module
Jul 13, 2023
lukaseder
changed the title
Add a jooq-meta-kotlin module for kotlin extensions to the jOOQ-meta module
Add a jOOQ-meta-kotlin module for kotlin extensions to the jOOQ-meta module
Jul 13, 2023
This test passes! assertEquals(
Configuration()
.withJdbc(Jdbc().withUrl("x"))
.withLogging(Logging.DEBUG)
.withGenerator(Generator()
.withDatabase(Database()
.withProperties(
Property().withKey("k").withValue("v"),
Property().withKey("x").withValue("y"))
.withSyntheticObjects(SyntheticObjectsType()
.withPrimaryKeys(SyntheticPrimaryKeyType()
.withKey("k")
.withFields("a", "b", "c")))
.withSchemata(SchemaMappingType()
.withInputSchema("input")
.withOutputSchema("output")
))
.withGenerate(Generate()
.withUdts(true))
),
configuration {
jdbc { url = "x" }
logging = Logging.DEBUG
generator {
database {
properties {
property {
key = "k"
value = "v"
}
property {
key = "x"
value = "y"
}
}
syntheticObjects {
primaryKeys {
primaryKey {
key = "k"
fields = listOf("a", "b", "c")
}
}
}
schemata {
schema {
inputSchema = "input"
outputSchema = "output"
}
}
}
generate {
isUdts = true
}
}
}
) Very cool! |
Depending on whether #12985 will be backported, this will be backported as well. |
lukaseder
added a commit
that referenced
this issue
Jul 13, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jOOQ 3.19 will ship with a new official jooq-codegen-gradle plugin:
To make configuring jOOQ from Groovy / Kotlin simpler, new modules could be added containing extension functions that DSL-ify the
org.jooq.meta.jaxb.Configuration
class, etc. For example:This produces a valid XML configuration as follows:
Seems like a super low hanging fruit! I'll check if the gradle/groovy integration can profit of a similar thing. The existing third party plugin https://github.com/etiennestuder/gradle-jooq-plugin does some reflection tricks, but it would be better if we could generate actual code to help the IDE with auto completion, etc.
The text was updated successfully, but these errors were encountered: