FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(sqlite): classify WITH / PRAGMA by first statement, not prefix · Issue #797 · QueryaHub/Querya-Desktop · GitHub

fix(sqlite): classify WITH / PRAGMA by first statement, not prefix #797

Description

Summary

SqliteConnection.execute treats startsWith('with'|'pragma'|select|explain|values) as a read-only query: skips the Dart StateError on a read-only connection and uses rawQuery. WITH … INSERT and PRAGMA journal_mode=WAL are writes. The file may still be SQLITE_OPEN_READONLY (engine rejects), so the Dart guard is not the real boundary — and on a RW connection WITH wrongly goes through rawQuery.

Scope

  • Classify after stripping comments: first keyword of the first statement.
  • WITH is read-only only if the statement is a SELECT CTE, not DML.
  • PRAGMA that assigns (e.g. journal_mode=) is a write.
  • Tests: read-only connection rejects WITH x AS (SELECT 1) INSERT …; PRAGMA busy_timeout still allowed.

Out of scope

  • Full SQL parser. Comment-strip + first keyword is enough.

Activity

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

    backendBackend database driver execution and queriesbugSomething isn't workingerror-handlingTheme parser epic label: error-handlingsqliteSQLite database driver and workspace

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL