Class SchemaExtension
java.lang.Object
io.github.suppierk.codegen.extensions.SchemaExtension
- All Implemented Interfaces:
org.gradle.api.Named
Describes schema-scoped configuration: Flyway overrides and the list of jOOQ configurations that
should target the schema. Exposed via
DatabaseExtension.schema(String, Action).- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Named
org.gradle.api.Named.Namer -
Constructor Summary
ConstructorsConstructorDescriptionSchemaExtension(String name, org.gradle.api.model.ObjectFactory objects) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidflyway(groovy.lang.Closure<?> closure) Groovy-friendly variant accepting aClosure.voidflyway(org.gradle.api.Action<? super FlywayConfig> action) Applies configuration to the schema-specific Flyway settings.Returns the schema-specific Flyway configuration that will override any defaults coming from the database entry.org.gradle.api.provider.ListProperty<String> Names of jOOQ configurations that should target this schema.getName()voidjooqConfigurations(Iterable<String> configurations) Groovy-friendly setter acceptingIterableof configuration names.voidjooqConfigurations(String... configurations) Groovy-friendly varargs setter for jOOQ configurations.voidsetJooqConfigurations(List<String> configurations) Sets jOOQ configurations targeting the current schema.voidwhenJooqConfigurationsUpdated(org.gradle.api.Action<? super List<String>> action) Registers an action that will be notified whenever the schema's jOOQ configuration list changes.
-
Constructor Details
-
SchemaExtension
Default constructor.- Parameters:
name- unique schema nameobjects- Gradle object factory used to instantiate properties
-
-
Method Details
-
getFlyway
Returns the schema-specific Flyway configuration that will override any defaults coming from the database entry. Users can mutate the returned object directly in their build script.- Returns:
- mutable Flyway configuration
- See Also:
-
flyway
Applies configuration to the schema-specific Flyway settings.- Parameters:
action- configuration block
-
flyway
public void flyway(@Nonnull groovy.lang.Closure<?> closure) Groovy-friendly variant accepting aClosure.- Parameters:
closure- configuration block
-
getName
- Specified by:
getNamein interfaceorg.gradle.api.Named
-
getJooqConfigurations
Names of jOOQ configurations that should target this schema. The returnedListPropertyparticipates in Gradle's up-to-date checking and will trigger task registration updates when mutated.- Returns:
- list property containing configuration names
-
whenJooqConfigurationsUpdated
public void whenJooqConfigurationsUpdated(@Nonnull org.gradle.api.Action<? super List<String>> action) Registers an action that will be notified whenever the schema's jOOQ configuration list changes. Used byGeneratorPluginto dynamically register or tear down tasks as users mutate the DSL.- Parameters:
action- callback receiving the latest configuration names
-
setJooqConfigurations
Sets jOOQ configurations targeting the current schema.- Parameters:
configurations- configuration names- See Also:
-
jooqConfigurations
Groovy-friendly varargs setter for jOOQ configurations.- Parameters:
configurations- configuration names
-
jooqConfigurations
Groovy-friendly setter acceptingIterableof configuration names.- Parameters:
configurations- configuration names
-