feat: Enhance AI Assistant with new actions and context handling
This commit is contained in:
1 parent
e2d8820751
commit
ccb3667a0c
14 files changed
+1044
-105
No files matched your search
@@ -50,6 +50,23 @@ export const useQueryStore = defineStore("query", () => {
|
||||
if (tab) tab.sql = sql;
|
||||
}
|
||||
|
||||
function updateDatabase(id: string, database: string) {
|
||||
const tab = tabs.value.find((t) => t.id === id);
|
||||
if (!tab || tab.database === database) return;
|
||||
tab.database = database;
|
||||
tab.result = undefined;
|
||||
tab.tableMeta = undefined;
|
||||
}
|
||||
|
||||
function updateConnection(id: string, connectionId: string, database = "") {
|
||||
const tab = tabs.value.find((t) => t.id === id);
|
||||
if (!tab || tab.connectionId === connectionId) return;
|
||||
tab.connectionId = connectionId;
|
||||
tab.database = database;
|
||||
tab.result = undefined;
|
||||
tab.tableMeta = undefined;
|
||||
}
|
||||
|
||||
function setTableMeta(id: string, meta: NonNullable<QueryTab["tableMeta"]>) {
|
||||
const tab = tabs.value.find((t) => t.id === id);
|
||||
if (tab) tab.tableMeta = meta;
|
||||
@@ -89,6 +106,8 @@ export const useQueryStore = defineStore("query", () => {
|
||||
createTab,
|
||||
closeTab,
|
||||
updateSql,
|
||||
updateDatabase,
|
||||
updateConnection,
|
||||
setTableMeta,
|
||||
executeCurrentTab,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user