Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix: handle undefined db groups (#16172)
ecmadaoa369d8492450
diff --git a/frontend/src/composables/useExecuteSQL.ts b/frontend/src/composables/useExecuteSQL.tsindex b1e842a3c3..cc930226b8 100644--- a/frontend/src/composables/useExecuteSQL.ts+++ b/frontend/src/composables/useExecuteSQL.ts@@ -197,7 +197,7 @@ const useExecuteSQL = () => {// Check if the user selects multiple databases to query.if (tab.batchQueryContext && hasFeature("bb.feature.batch-query")) {- const { databases, databaseGroups } = tab.batchQueryContext;+ const { databases = [], databaseGroups = [] } = tab.batchQueryContext;for (const databaseResourceName of databases) {if (!isValidDatabaseName(databaseResourceName)) {continue;diff --git a/frontend/src/types/sqlEditor/tab.ts b/frontend/src/types/sqlEditor/tab.tsindex abf996d30c..67e65145fa 100644--- a/frontend/src/types/sqlEditor/tab.ts+++ b/frontend/src/types/sqlEditor/tab.ts@@ -20,7 +20,7 @@ export type BatchQueryContext = {// databaseGroups is used to store the selected database group names for batch request.// Format: projects/{project}/databaseGroups/{databaseGroup}- databaseGroups: string[];+ databaseGroups?: string[];};export type SQLEditorDatabaseQueryContext = {diff --git a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vueindex bdb38e20e6..d6a617b240 100644--- a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue+++ b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue@@ -10,8 +10,8 @@$t("sql-editor.batch-query.description", {database: state.selectedDatabases.size,group:- tabStore.currentTab?.batchQueryContext?.databaseGroups.length ??- 0,+ tabStore.currentTab?.batchQueryContext?.databaseGroups+ ?.length ?? 0,project: project.title,})}}diff --git a/frontend/src/views/sql-editor/EditorCommon/DatabaseChooser.vue b/frontend/src/views/sql-editor/EditorCommon/DatabaseChooser.vueindex 312df9df22..a1b44c7e0f 100644--- a/frontend/src/views/sql-editor/EditorCommon/DatabaseChooser.vue+++ b/frontend/src/views/sql-editor/EditorCommon/DatabaseChooser.vue@@ -95,7 +95,7 @@ const isBatchRequest = computed(() => {if (!batchQueryContext) {return false;}- const { databaseGroups, databases } = batchQueryContext;+ const { databaseGroups = [], databases = [] } = batchQueryContext;if (!hasFeature("bb.feature.database-grouping")) {return databases.length > 1;}