Skip to content

fix: sqlite_execute runs only the first statement #928

Closed

Description

@EVWorth

execute_sync in src-tauri/crates/mas-sqlite/src/query.rs passes the whole SQL string to db.prepare / db.execute. rusqlite compiles only the first statement and ignores the rest without an error. So a script run on a SQLite connection does only its first statement and still reports success.

The mock (src/dev/mock/handlers/sqlite.ts) splits on ;, which hides this from the preview and from the frontend tests.

Reproduce

Run CREATE TABLE a(x); CREATE TABLE b(y); on a SQLite connection: only a is created.

Fix

Loop over the statements (use the tail rusqlite's prepare leaves, or Batch) and return one result per statement, as the MySQL executor does, including the statement index on an error. Add tests for a two-statement script and for a failure in the second statement. Make the mock split the same way the backend does.

Activity

  1. added
    bug
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions