Skip to content

Hide SQLite virtual table internals - #624

Merged
debba merged 2 commits into
TabularisDB:mainfrom
DhruvShah-Dev:fix/sqlite-hidden-virtual-columns
Aug 24, 2026
Merged

Hide SQLite virtual table internals#624
debba merged 2 commits into
TabularisDB:mainfrom
DhruvShah-Dev:fix/sqlite-hidden-virtual-columns

Conversation

@DhruvShah-Dev

Copy link
Copy Markdown
Contributor

Summary

  • Filters SQLite table_xinfo rows with hidden = 1 out of column metadata.
  • Keeps generated columns visible by continuing to expose hidden = 2 and hidden = 3 as generated metadata.
  • Adds FTS5 coverage for direct and batch SQLite column metadata lookups.

Root Cause

PRAGMA table_xinfo includes hidden virtual-table columns that table_info did not return. Those rows were mapped as normal writable columns and surfaced in the New Row modal.

Fixes #622

Validation

  • git diff --check
  • cargo test test_get_columns_excludes_hidden_virtual_table_columns --lib -- --nocapture timed out locally after 3 minutes during Rust execution/build.

@DhruvShah-Dev
DhruvShah-Dev marked this pull request as ready for review August 11, 2026 17:30
@kilo-code-bot

kilo-code-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • src-tauri/src/drivers/sqlite/mod.rs
  • src-tauri/src/drivers/sqlite/tests.rs

Reviewed by glm-5.2 · Input: 102.8K · Output: 7.8K · Cached: 96.4K

@debba debba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed this locally, checked out the branch and tested against a real db. LGTM.

What I checked

  • The hidden = 1 filter is applied in sqlite_column_from_row and all three call sites (get_columns, get_all_columns_batch, get_view_columns) now use filter_map. Grepped the branch, there are no other places mapping table_xinfo rows, so nothing was missed.
  • Confirmed the premise against a real database. On an fts5 table, PRAGMA table_xinfo returns the internal docs and rank columns with hidden = 1, while generated columns report 2 (virtual) and 3 (stored). So the filter removes exactly the fts5 internals and keeps generated columns visible with is_generated: true, same as before.
  • This is more than cosmetic btw: in fts5 the column named after the table is a command interface, so having it in the New Row modal meant a user could accidentally run commands like 'delete-all'. Good catch on #622.

Tests

You mentioned the test timed out on your machine. It runs fine here on the branch:

cargo test --lib drivers::sqlite::tests
12 passed; 0 failed (0.02s after build)

That includes the new test_get_columns_excludes_hidden_virtual_table_columns, which covers both the direct and the batch lookup against a real fts5 table.

Manual testing

Seeded a db with an fts5 table, a table with virtual + stored generated columns, a plain table and a view:

  • fts5 New Row modal: only title and body, no docs or rank anymore
  • generated columns: still shown and still flagged as generated, not writable
  • plain table and view: unchanged

Notes (non blocking)

  • PRAGMA table_xinfo('{}') with the raw table name predates this PR, but a table name containing ' would break the query. Worth a separate issue.

@debba
debba merged commit 284207e into TabularisDB:main Aug 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants