Skip to content

Commit c25dd1d

Browse files
authored
Change naming for disabling additional datasource (keycloak#41815)
Closes keycloak#40761 Signed-off-by: Martin Bartoš <mabartos@redhat.com>
1 parent 06f8041 commit c25dd1d

19 files changed

+54
-38
lines changed

quarkus/config-api/src/main/java/org/keycloak/config/DatabaseOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ public class DatabaseOptions {
101101
.defaultValue(10000)
102102
.build();
103103

104-
public static final Option<Boolean> DB_ACTIVE_DATASOURCE = new OptionBuilder<>("db-active-<datasource>", Boolean.class)
104+
public static final Option<Boolean> DB_ENABLED_DATASOURCE = new OptionBuilder<>("db-enabled-<datasource>", Boolean.class)
105105
.category(OptionCategory.DATABASE_DATASOURCES)
106106
.defaultValue(true)
107-
.description("Deactivate specific named datasource <datasource>.")
107+
.description("If the named datasource <datasource> should be enabled at runtime.")
108108
.build();
109109

110110
public static final Option<String> DB_POSTGRESQL_TARGET_SERVER_TYPE = new OptionBuilder<>("db-postgres-target-server-type", String.class)

quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/DatabasePropertyMappers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public static PropertyMapper<?>[] getDatabasePropertyMappers() {
101101
fromOption(DatabaseOptions.DB_SQL_LOG_SLOW_QUERIES)
102102
.paramLabel("milliseconds")
103103
.build(),
104-
fromOption(DatabaseOptions.DB_ACTIVE_DATASOURCE)
104+
fromOption(DatabaseOptions.DB_ENABLED_DATASOURCE)
105105
.to("quarkus.datasource.\"<datasource>\".active")
106106
.build(),
107107
fromOption(DB_URL_PATH)

quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/DatasourcesConfigurationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ public void defaults() {
141141
public void datasourceEnabled() {
142142
ConfigArgsConfigSource.setCliArgs("");
143143
initConfig();
144-
assertConfig("db-active-store", "true");
144+
assertConfig("db-enabled-store", "true");
145145
assertExternalConfig("quarkus.datasource.\"store\".active", "true");
146146
onAfter();
147147

148-
ConfigArgsConfigSource.setCliArgs("--db-active-store=false");
148+
ConfigArgsConfigSource.setCliArgs("--db-enabled-store=false");
149149
initConfig();
150-
assertConfig("db-active-store", "false");
150+
assertConfig("db-enabled-store", "false");
151151
assertExternalConfig("quarkus.datasource.\"store\".active", "false");
152152
}
153153

quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBootstrapAdminService.approved.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,16 @@ Database:
7272

7373
Database - additional datasources (Preview):
7474

75-
--db-active-<datasource> <true|false>
76-
Preview: Deactivate specific named datasource <datasource>. Default: true.
7775
--db-debug-jpql-<datasource> <true|false>
7876
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
7977
statements to debug JPA SQL statement generation. Default: false.
8078
--db-driver-<datasource> <driver>
8179
Preview: Used for named <datasource>. The fully qualified class name of the
8280
JDBC driver. If not set, a default driver is set accordingly to the chosen
8381
database.
82+
--db-enabled-<datasource> <true|false>
83+
Preview: If the named datasource <datasource> should be enabled at runtime.
84+
Default: true.
8485
--db-kind-<datasource> <vendor>
8586
Preview: Used for named <datasource>. The database vendor. In production mode
8687
the default value of 'dev-file' is deprecated, you should explicitly specify

quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBootstrapAdminUser.approved.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,16 @@ Database:
7474

7575
Database - additional datasources (Preview):
7676

77-
--db-active-<datasource> <true|false>
78-
Preview: Deactivate specific named datasource <datasource>. Default: true.
7977
--db-debug-jpql-<datasource> <true|false>
8078
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
8179
statements to debug JPA SQL statement generation. Default: false.
8280
--db-driver-<datasource> <driver>
8381
Preview: Used for named <datasource>. The fully qualified class name of the
8482
JDBC driver. If not set, a default driver is set accordingly to the chosen
8583
database.
84+
--db-enabled-<datasource> <true|false>
85+
Preview: If the named datasource <datasource> should be enabled at runtime.
86+
Default: true.
8687
--db-kind-<datasource> <vendor>
8788
Preview: Used for named <datasource>. The database vendor. In production mode
8889
the default value of 'dev-file' is deprecated, you should explicitly specify

quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.approved.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ Database:
6767

6868
Database - additional datasources (Preview):
6969

70-
--db-active-<datasource> <true|false>
71-
Preview: Deactivate specific named datasource <datasource>. Default: true.
7270
--db-debug-jpql-<datasource> <true|false>
7371
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
7472
statements to debug JPA SQL statement generation. Default: false.
7573
--db-driver-<datasource> <driver>
7674
Preview: Used for named <datasource>. The fully qualified class name of the
7775
JDBC driver. If not set, a default driver is set accordingly to the chosen
7876
database.
77+
--db-enabled-<datasource> <true|false>
78+
Preview: If the named datasource <datasource> should be enabled at runtime.
79+
Default: true.
7980
--db-kind-<datasource> <vendor>
8081
Preview: Used for named <datasource>. The database vendor. In production mode
8182
the default value of 'dev-file' is deprecated, you should explicitly specify

quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.approved.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ Database:
6767

6868
Database - additional datasources (Preview):
6969

70-
--db-active-<datasource> <true|false>
71-
Preview: Deactivate specific named datasource <datasource>. Default: true.
7270
--db-debug-jpql-<datasource> <true|false>
7371
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
7472
statements to debug JPA SQL statement generation. Default: false.
7573
--db-driver-<datasource> <driver>
7674
Preview: Used for named <datasource>. The fully qualified class name of the
7775
JDBC driver. If not set, a default driver is set accordingly to the chosen
7876
database.
77+
--db-enabled-<datasource> <true|false>
78+
Preview: If the named datasource <datasource> should be enabled at runtime.
79+
Default: true.
7980
--db-kind-<datasource> <vendor>
8081
Preview: Used for named <datasource>. The database vendor. In production mode
8182
the default value of 'dev-file' is deprecated, you should explicitly specify

quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.approved.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ Database:
6767

6868
Database - additional datasources (Preview):
6969

70-
--db-active-<datasource> <true|false>
71-
Preview: Deactivate specific named datasource <datasource>. Default: true.
7270
--db-debug-jpql-<datasource> <true|false>
7371
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
7472
statements to debug JPA SQL statement generation. Default: false.
7573
--db-driver-<datasource> <driver>
7674
Preview: Used for named <datasource>. The fully qualified class name of the
7775
JDBC driver. If not set, a default driver is set accordingly to the chosen
7876
database.
77+
--db-enabled-<datasource> <true|false>
78+
Preview: If the named datasource <datasource> should be enabled at runtime.
79+
Default: true.
7980
--db-kind-<datasource> <vendor>
8081
Preview: Used for named <datasource>. The database vendor. In production mode
8182
the default value of 'dev-file' is deprecated, you should explicitly specify

quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.approved.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,16 @@ Database:
6767

6868
Database - additional datasources (Preview):
6969

70-
--db-active-<datasource> <true|false>
71-
Preview: Deactivate specific named datasource <datasource>. Default: true.
7270
--db-debug-jpql-<datasource> <true|false>
7371
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
7472
statements to debug JPA SQL statement generation. Default: false.
7573
--db-driver-<datasource> <driver>
7674
Preview: Used for named <datasource>. The fully qualified class name of the
7775
JDBC driver. If not set, a default driver is set accordingly to the chosen
7876
database.
77+
--db-enabled-<datasource> <true|false>
78+
Preview: If the named datasource <datasource> should be enabled at runtime.
79+
Default: true.
7980
--db-kind-<datasource> <vendor>
8081
Preview: Used for named <datasource>. The database vendor. In production mode
8182
the default value of 'dev-file' is deprecated, you should explicitly specify

quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.approved.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,16 @@ Database:
109109

110110
Database - additional datasources (Preview):
111111

112-
--db-active-<datasource> <true|false>
113-
Preview: Deactivate specific named datasource <datasource>. Default: true.
114112
--db-debug-jpql-<datasource> <true|false>
115113
Preview: Used for named <datasource>. Add JPQL information as comments to SQL
116114
statements to debug JPA SQL statement generation. Default: false.
117115
--db-driver-<datasource> <driver>
118116
Preview: Used for named <datasource>. The fully qualified class name of the
119117
JDBC driver. If not set, a default driver is set accordingly to the chosen
120118
database.
119+
--db-enabled-<datasource> <true|false>
120+
Preview: If the named datasource <datasource> should be enabled at runtime.
121+
Default: true.
121122
--db-kind-<datasource> <vendor>
122123
Preview: Used for named <datasource>. The database vendor. In production mode
123124
the default value of 'dev-file' is deprecated, you should explicitly specify

0 commit comments

Comments
 (0)