Summary
After editing data in a SQLite table, Save fails or the same database stops opening:
- Save fails with
attempt to write a readonly database (code 8). Reproduced in the real app: Demo Playground → users → edit a cell → Save → Apply.
- The database "does not open" afterwards. Closing any pooled session (the Save session is idle-closed 4 s after Save, the SQL editor, Disconnect in the tree) closes the file for every other open view of the same database.
Cause
SqliteConnection.connect uses sqflite's default singleInstance: true, so opening the same path again returns the first Database. The pool's separate readOnly / tableWrite / readWrite sessions therefore share one handle: a Save session reuses the read-only browse handle, and closing any session closes the shared handle. In addition, Table Browser keeps its browse lease forever and shows Not connected when that session was closed (e.g. after Disconnect) instead of re-acquiring it.
Also (editing UX)
- Table Browser showed two sets of edit controls (header: badge / Revert / Save; grid toolbar: Revert All / badge / Save Changes). While dirty, the header set pushed DDL / Refresh / Prev / Next off-screen.
- Save errors were shown as raw driver exceptions (
SqfliteFfiException(sqlite_error: 8, , SqliteException(8)…).
- Toast read
1 change(s) saved.
Summary
After editing data in a SQLite table, Save fails or the same database stops opening:
attempt to write a readonly database (code 8). Reproduced in the real app: Demo Playground →users→ edit a cell → Save → Apply.Cause
SqliteConnection.connectuses sqflite's defaultsingleInstance: true, so opening the same path again returns the firstDatabase. The pool's separatereadOnly/tableWrite/readWritesessions therefore share one handle: a Save session reuses the read-only browse handle, and closing any session closes the shared handle. In addition, Table Browser keeps its browse lease forever and showsNot connectedwhen that session was closed (e.g. after Disconnect) instead of re-acquiring it.Also (editing UX)
SqfliteFfiException(sqlite_error: 8, , SqliteException(8)…).1 change(s) saved.