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
tg sql opens the account's cache read-write and blocks writes with a regular expression. A statement that starts with PRAGMA and contains none of the blocked words passes, so PRAGMA user_version = 0 changes the file: the next open runs the one-time migrations again. Other pragmas can change the journal mode or schema flags the same way.
Proposed: run PRAGMA query_only = ON on the connection tg sql uses, after the cache is opened and migrated, and map SQLite's read-only error to SQL_WRITE_NOT_ALLOWED. Keep the regular expression for its clearer message.
Done when a test shows that PRAGMA user_version = 0 is refused and leaves the value unchanged, and reading pragmas still works.
Activity
fix(sql): run tg sql on a read-only connection
fix(sql): refuse pragma writes with an argument and several statements
fix(sql): run tg sql on a read-only connection
fix(sql): refuse pragma writes with an argument and several statements