Skip to content

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

fix: don't call markRaw when data is undefined (#2810)

Liu Jic02e252788c0
diff --git a/frontend/src/composables/useExecuteSQL.ts b/frontend/src/composables/useExecuteSQL.ts
index dc7d424c57..4b8d8af1eb 100644
--- a/frontend/src/composables/useExecuteSQL.ts
+++ b/frontend/src/composables/useExecuteSQL.ts
@@ -122,9 +122,13 @@ const useExecuteSQL = () => {
adviceNotifyMessage
);
}
+
+ // use `markRaw` to prevent vue from monitoring the object change deeply
+ const queryResult = sqlResultSet.data
+ ? markRaw(sqlResultSet.data)
+ : undefined;
Object.assign(tab, {
- // use `markRaw` to prevent vue from monitoring the object change deeply
- queryResult: markRaw(sqlResultSet.data) as any,
+ queryResult,
adviceList: sqlResultSet.adviceList,
executeParams: {
query,
@@ -132,7 +136,11 @@ const useExecuteSQL = () => {
option,
},
});
- sqlEditorStore.fetchQueryHistoryList();
+ if (queryResult) {
+ // Refresh the query history list when the query executed successfully
+ // (with or without warnings).
+ sqlEditorStore.fetchQueryHistoryList();
+ }
} catch (error) {
Object.assign(tab, {
queryResult: undefined,