Change naming for disabling additional datasource (#41815)

Closes #40761

Signed-off-by: Martin Bartoš <mabartos@redhat.com>
This commit is contained in:
Martin Bartoš 2025-08-14 17:42:16 +02:00 committed by GitHub
parent 06f80416fb
commit c25dd1dba8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 54 additions and 38 deletions

View File

@ -101,10 +101,10 @@ public class DatabaseOptions {
.defaultValue(10000)
.build();
public static final Option<Boolean> DB_ACTIVE_DATASOURCE = new OptionBuilder<>("db-active-<datasource>", Boolean.class)
public static final Option<Boolean> DB_ENABLED_DATASOURCE = new OptionBuilder<>("db-enabled-<datasource>", Boolean.class)
.category(OptionCategory.DATABASE_DATASOURCES)
.defaultValue(true)
.description("Deactivate specific named datasource <datasource>.")
.description("If the named datasource <datasource> should be enabled at runtime.")
.build();
public static final Option<String> DB_POSTGRESQL_TARGET_SERVER_TYPE = new OptionBuilder<>("db-postgres-target-server-type", String.class)

View File

@ -101,7 +101,7 @@ final class DatabasePropertyMappers {
fromOption(DatabaseOptions.DB_SQL_LOG_SLOW_QUERIES)
.paramLabel("milliseconds")
.build(),
fromOption(DatabaseOptions.DB_ACTIVE_DATASOURCE)
fromOption(DatabaseOptions.DB_ENABLED_DATASOURCE)
.to("quarkus.datasource.\"<datasource>\".active")
.build(),
fromOption(DB_URL_PATH)

View File

@ -141,13 +141,13 @@ public class DatasourcesConfigurationTest extends AbstractConfigurationTest {
public void datasourceEnabled() {
ConfigArgsConfigSource.setCliArgs("");
initConfig();
assertConfig("db-active-store", "true");
assertConfig("db-enabled-store", "true");
assertExternalConfig("quarkus.datasource.\"store\".active", "true");
onAfter();
ConfigArgsConfigSource.setCliArgs("--db-active-store=false");
ConfigArgsConfigSource.setCliArgs("--db-enabled-store=false");
initConfig();
assertConfig("db-active-store", "false");
assertConfig("db-enabled-store", "false");
assertExternalConfig("quarkus.datasource.\"store\".active", "false");
}

View File

@ -72,8 +72,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -81,6 +79,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify

View File

@ -74,8 +74,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -83,6 +81,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify

View File

@ -67,8 +67,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -76,6 +74,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify

View File

@ -67,8 +67,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -76,6 +74,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify

View File

@ -67,8 +67,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -76,6 +74,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify

View File

@ -67,8 +67,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -76,6 +74,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify

View File

@ -109,8 +109,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -118,6 +116,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify

View File

@ -176,8 +176,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -185,6 +183,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify

View File

@ -157,8 +157,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -166,6 +164,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify

View File

@ -177,8 +177,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -186,6 +184,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify

View File

@ -151,11 +151,12 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-log-slow-queries-threshold-<datasource> <milliseconds>
Preview: Used for named <datasource>. Log SQL statements slower than the
configured threshold with logger org.hibernate.SQL_SLOW and log-level info.

View File

@ -171,11 +171,12 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-log-slow-queries-threshold-<datasource> <milliseconds>
Preview: Used for named <datasource>. Log SQL statements slower than the
configured threshold with logger org.hibernate.SQL_SLOW and log-level info.

View File

@ -156,8 +156,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -165,6 +163,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify

View File

@ -176,8 +176,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -185,6 +183,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify

View File

@ -154,8 +154,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -163,6 +161,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify

View File

@ -174,8 +174,6 @@ Database:
Database - additional datasources (Preview):
--db-active-<datasource> <true|false>
Preview: Deactivate specific named datasource <datasource>. Default: true.
--db-debug-jpql-<datasource> <true|false>
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
statements to debug JPA SQL statement generation. Default: false.
@ -183,6 +181,9 @@ Database - additional datasources (Preview):
Preview: Used for named <datasource>. The fully qualified class name of the
JDBC driver. If not set, a default driver is set accordingly to the chosen
database.
--db-enabled-<datasource> <true|false>
Preview: If the named datasource <datasource> should be enabled at runtime.
Default: true.
--db-kind-<datasource> <vendor>
Preview: Used for named <datasource>. The database vendor. In production mode
the default value of 'dev-file' is deprecated, you should explicitly specify