You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P1/bug] Multi-statement execution records a single history entry; loses per-statement structure #329
doExecuteQuery (src/stores/resultStore.ts:181-219) aggregates results.reduce((sum, r) => sum + r.rows.length, 0) and records one entry per call — even when the user executed a multi-statement batch like SELECT 1; INSERT INTO log ...; SELECT 2. The history loses the per-statement structure.
Problem
If statement 3 fails, the entry records status: "error" with the third statement's error, but the first two may have succeeded — the entry is misleading. The history is supposed to be a personal log of "what I ran"; a multi-statement exec showing "error" because the LAST statement failed is wrong.
One history entry per statement in the batch. Pass through results.map((r, i) => ({ ... entry with sql: statement_index_snippet, status: r.error ? "error" : "success", ... })). Storage cost is minor.
Proposed fix
Scope L — record one history entry per statement in the batch. The entry.id needs to be unique per statement (already UUID, so safe).
Acceptance
A 3-statement batch where the last statement fails shows 3 history entries: the first two success, the third error; the success entries have their row counts; the error entry shows the error message.
Activity
feat(history): record a multi-statement run one statement at a time