Describe the bug
Follow-up to #581. The SQLite driver now reads column metadata with PRAGMA table_xinfo instead of table_info, which was needed to expose generated columns. The side effect is that table_xinfo also returns the hidden columns of virtual tables (hidden = 1), which table_info used to leave out.
Only hidden values 2 and 3 are flagged as is_generated, so these hidden columns are treated as plain writable columns. The data grid is unaffected because SELECT * never returns them, but the New Row modal builds its form from the column metadata, so on an fts5 table it now lists the internal docs and rank columns as fillable fields.
This is not just cosmetic: in fts5 the column named after the table is the command interface, so a value written there can trigger special commands (e.g. 'delete-all' wipes the whole index).
The fix should be a one-liner: skip rows with hidden = 1 when mapping table_xinfo results in sqlite_column_from_row / get_columns / get_all_columns_batch (src-tauri/src/drivers/sqlite/mod.rs). That restores the old table_info behavior for virtual tables while keeping generated columns visible.
To Reproduce
- Create a SQLite db with a virtual table:
CREATE VIRTUAL TABLE docs USING fts5(title, body);
- Open it in Tabularis and select the
docs table
- Open the New Row modal
docs and rank are listed as editable fields, only title and body should be there
OS Version
Arch Linux
Tabularis Version
v0.19.0 (main, after #581)
Relevant Log Output
Describe the bug
Follow-up to #581. The SQLite driver now reads column metadata with
PRAGMA table_xinfoinstead oftable_info, which was needed to expose generated columns. The side effect is thattable_xinfoalso returns the hidden columns of virtual tables (hidden = 1), whichtable_infoused to leave out.Only
hiddenvalues 2 and 3 are flagged asis_generated, so these hidden columns are treated as plain writable columns. The data grid is unaffected becauseSELECT *never returns them, but the New Row modal builds its form from the column metadata, so on an fts5 table it now lists the internaldocsandrankcolumns as fillable fields.This is not just cosmetic: in fts5 the column named after the table is the command interface, so a value written there can trigger special commands (e.g.
'delete-all'wipes the whole index).The fix should be a one-liner: skip rows with
hidden = 1when mappingtable_xinforesults insqlite_column_from_row/get_columns/get_all_columns_batch(src-tauri/src/drivers/sqlite/mod.rs). That restores the oldtable_infobehavior for virtual tables while keeping generated columns visible.To Reproduce
CREATE VIRTUAL TABLE docs USING fts5(title, body);docstabledocsandrankare listed as editable fields, onlytitleandbodyshould be thereOS Version
Arch Linux
Tabularis Version
v0.19.0 (main, after #581)
Relevant Log Output