fix(sql): recognize @set declarations after comments

Closes #6974
This commit is contained in:
t8y2 committed 2026-08-23 09:44:33 +00:00
1 parent 4dd107484f
commit 6e189723bd
3 files changed
+32 -8

No files matched your search

@@ -210,7 +210,7 @@ describe("useSqlExecution", () => {
it("expands preceding @set values in a selected shell-style statement", async () => {
const selectedSql = "SELECT * FROM patrol WHERE post_id = ${postid};";
const fullSql = ["@set postid = '224';", selectedSql, "@set postid = 'future';"].join("\n");
const fullSql = ["-- saved query", "@set postid='224';", selectedSql, "@set postid = 'future';"].join("\n");
const selectionFrom = fullSql.indexOf("SELECT");
const selectionTo = selectionFrom + selectedSql.length;
const activeTab = ref<QueryTab | undefined>({ ...queryTab("app"), sql: fullSql });