Skip to content

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

chore: update (#16131)

h3n4lf53c06aad294
diff --git a/frontend/src/utils/sqlEditor.ts b/frontend/src/utils/sqlEditor.ts
index 5cf8aa7ac2..8930f1958a 100644
--- a/frontend/src/utils/sqlEditor.ts
+++ b/frontend/src/utils/sqlEditor.ts
@@ -222,18 +222,24 @@ export const ensureDataSourceSelection = (
} else {
behavior = "ALLOW_ADMIN";
}
+
if (behavior === "ALLOW_ADMIN") {
if (current) {
return current;
}
- return adminDataSource.id;
+ return head(readonlyDataSources)?.id ?? adminDataSource.id;
}
+
if (behavior === "FALLBACK") {
- if (current) {
+ if (
+ current &&
+ (current !== adminDataSource.id || readonlyDataSources.length === 0)
+ ) {
return current;
}
return head(readonlyDataSources)?.id ?? adminDataSource.id;
}
+
if (behavior === "RO") {
if (
current &&