Skip to content

[Bug]: hidden columns of virtual tables show up as editable fields in the New Row modal #622

Description

@debba

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

  1. Create a SQLite db with a virtual table: CREATE VIRTUAL TABLE docs USING fts5(title, body);
  2. Open it in Tabularis and select the docs table
  3. Open the New Row modal
  4. 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

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions