fix: pass SQL directly in AI execute to avoid stale state (#153)

When executing SQL from the AI panel, pass the SQL string directly to
tryExecute() instead of relying on the executableSql computed property,
which could use stale selectedSql or cursorPos values.
This commit is contained in:
t8y2 committed 2026-05-08 16:45:01 +08:00
1 parent ae890092dd
commit 92fe47b913
2 files changed
+16 -3

No files matched your search

+2 -1
View File
@@ -320,7 +320,8 @@ function onAiReplaceSql(sql: string) {
function onAiExecuteSql(sql: string) {
const tabId = ensureQueryTab();
queryStore.updateSql(tabId, sql);
nextTick(() => tryExecute());
selectedSql.value = "";
nextTick(() => tryExecute(sql));
}
function handleKeydown(e: KeyboardEvent) {