Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: oceanbase beta badge and fallback admin host for readonly connection (#5755)

Danny Xu47efa2c3754f
diff --git a/backend/component/dbfactory/dbfactory.go b/backend/component/dbfactory/dbfactory.go
index 93c4074c79..c81c8e6967 100644
--- a/backend/component/dbfactory/dbfactory.go
+++ b/backend/component/dbfactory/dbfactory.go
@@ -109,17 +109,21 @@ func (d *DBFactory) GetAdminDatabaseDriver(ctx context.Context, instance *store.
// Upon successful return, caller must call driver.Close(). Otherwise, it will leak the database connection.
func (d *DBFactory) GetReadOnlyDatabaseDriver(ctx context.Context, instance *store.InstanceMessage, databaseName string) (db.Driver, error) {
dataSource := utils.DataSourceFromInstanceWithType(instance, api.RO)
+ adminDataSource := utils.DataSourceFromInstanceWithType(instance, api.Admin)
// If there are no read-only data source, fall back to admin data source.
if dataSource == nil {
- dataSource = utils.DataSourceFromInstanceWithType(instance, api.Admin)
+ dataSource = adminDataSource
}
if dataSource == nil {
return nil, common.Errorf(common.Internal, "data source not found for instance %q", instance.Title)
}
host, port := dataSource.Host, dataSource.Port
- if dataSource.Host != "" || dataSource.Port != "" {
- host, port = dataSource.Host, dataSource.Port
+ if host == "" {
+ host = adminDataSource.Host
+ }
+ if port == "" {
+ port = adminDataSource.Port
}
dbBinDir := ""
diff --git a/frontend/src/components/InstanceForm.vue b/frontend/src/components/InstanceForm.vue
index 0d390f3b48..48f4829dea 100644
--- a/frontend/src/components/InstanceForm.vue
+++ b/frontend/src/components/InstanceForm.vue
@@ -945,7 +945,9 @@ const allowUpdate = computed((): boolean => {
});
const isEngineBeta = (engine: EngineType): boolean => {
- return ["ORACLE", "MSSQL", "REDSHIFT", "MARIADB"].includes(engine);
+ return ["ORACLE", "MSSQL", "REDSHIFT", "MARIADB", "OCEANBASE"].includes(
+ engine
+ );
};
// The default host name is 127.0.0.1 or host.docker.internal which is not applicable to Snowflake, so we change
diff --git a/frontend/src/utils/instance.ts b/frontend/src/utils/instance.ts
index 7ef3ec36e3..efa1f88cf8 100644
--- a/frontend/src/utils/instance.ts
+++ b/frontend/src/utils/instance.ts
@@ -12,16 +12,16 @@ export const supportedEngineList = () => {
const engines: EngineType[] = [
"MYSQL",
"POSTGRES",
- "OCEANBASE",
"TIDB",
"SNOWFLAKE",
"CLICKHOUSE",
"MONGODB",
- "SPANNER",
"REDIS",
+ "SPANNER",
"ORACLE",
- "MSSQL",
+ "OCEANBASE",
"MARIADB",
+ "MSSQL",
"REDSHIFT",
];
return engines;