Class SqlDialectOptionsConfiguration
java.lang.Object
io.micronaut.data.runtime.config.SqlDialectOptionsConfiguration
- Direct Known Subclasses:
DataJdbcConfiguration.DialectOptionsConfiguration, DataR2dbcConfiguration.DialectOptionsConfiguration
Common SQL dialect option configuration shared by JDBC and R2DBC datasource configuration.
- Since:
- 5.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringbooleanstatic @Nullable StringparseMajorMinor(@Nullable String text) Extracts themajor.minorversion from a database version text, such asOracle AI Database 26ai Free Release 23.26.3.0.0 - ... Version 23.26.3.0.0or23.26.3.0.0.@Nullable StringresolveVersion(Supplier<@Nullable String> detector) Resolves the dialect version for runtime components such as schema generation: the configured version, or the detected one whendetectionis enabled.voidsetDetectVersion(boolean detectVersion) Opts in to targeting the version reported by the database for schema generation and validation when noversionis configured.voidsetVersion(@Nullable String version)
-
Constructor Details
-
SqlDialectOptionsConfiguration
public SqlDialectOptionsConfiguration()
-
-
Method Details
-
getVersion
- Returns:
- The target dialect version.
- Since:
- 5.2
-
setVersion
- Parameters:
version- The target dialect version.- Since:
- 5.2
-
isDetectVersion
public boolean isDetectVersion()- Returns:
- Whether schema generation and validation target the version reported by the database when no
versionis configured. - Since:
- 5.3
-
setDetectVersion
public void setDetectVersion(boolean detectVersion) Opts in to targeting the version reported by the database for schema generation and validation when noversionis configured. Repository SQL is generated at compilation time and is not affected.- Parameters:
detectVersion- Whether to detect the database version- Since:
- 5.3
-
resolveVersion
Resolves the dialect version for runtime components such as schema generation: the configured version, or the detected one whendetectionis enabled.- Parameters:
detector- Detects the database version, returningnullwhen it is unknown- Returns:
- The dialect version, or
nullfor none - Since:
- 5.3
-
parseMajorMinor
Extracts themajor.minorversion from a database version text, such asOracle AI Database 26ai Free Release 23.26.3.0.0 - ... Version 23.26.3.0.0or23.26.3.0.0.- Parameters:
text- The version text reported by the database or driver- Returns:
- The
major.minorversion, ornullwhen the text has none - Since:
- 5.3
-