Skip to content

✨ Add a read-only SQLite viewer - #60

Merged
juftin merged 9 commits into
juftin:mainfrom
jufty-bot:panicky-bear
Oct 28, 2026
Merged

juftin merged 9 commits into
juftin:mainfrom
jufty-bot:panicky-bear

Conversation

@jufty-bot

@jufty-bot jufty-bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Opening a SQLite database now shows a read-only data table directly beneath the table selector instead of trying to decode the file as text.

  • Recognize .db, .db3, .sqlite, and .sqlite3 files.
  • Select user tables and views from the dropdown or with [ (previous) and ] (next). Table navigation wraps and starts each selected object on its first page.
  • Page through rows using buttons or { / } for previous/next page. --max-lines controls page size. All six SQLite navigation and copy shortcut hints appear only in the ? help popup, including when the file tree or another overlay has focus; they are hidden from the footer.
  • Limit column headers and cell previews to 40 terminal cells, with ellipses for long values and single-line previews for multiline text.
  • Copy the selected cell with c as full plain text (NULL as NULL, BLOBs as hex), or copy its row with Shift+C as JSON. Copied contents are not truncated. Both actions use the system clipboard with a terminal clipboard fallback.
  • Preserve NULL values, preview BLOBs, and render cell contents literally.
  • Support remote databases through temporary local copies, with connections and downloads cleaned up when switching files or exiting.
  • Handle empty databases, invalid files, and unreadable views inside the viewer. Preserve viewer state around existing overlays.

Includes usage documentation, regression tests, and screenshots.

Validation

  • env -u NO_COLOR uv run pytest --no-cov β€” 44 passed, including all existing screenshot tests.
  • uv run ruff check .
  • uv run ruff format --check .
  • uv run mypy browsr
  • git diff --check

The shell sets NO_COLOR; removing it for screenshot tests preserves the colors expected by the existing snapshots.

Screenshots

Captured from the actual Textual app with App.run_test(size=(140, 30)) and App.save_screenshot(), using a sample bookshop database. PNGs were rendered from Textual's SVG exports.

Table data β€” bounded column widths, first page

SQLite data viewer

Table data β€” next page

SQLite data viewer, next page

SQLite help β€” copy cell, copy row, page navigation, and table navigation

SQLite keyboard shortcuts

@juftin
juftin merged commit fccc16f into juftin:main Oct 28, 2026
6 checks passed
juftin pushed a commit that referenced this pull request Oct 28, 2026
# [v1.26.0](v1.25.0...v1.26.0) (2026-10-28)

## ✨ New Features
- [`fccc16f`](fccc16f)  Add a read-only SQLite viewer (#60) (Issues: [`#60`](#60))

[skip ci]
@juftin

juftin commented Oct 28, 2026

Copy link
Copy Markdown
Owner

πŸŽ‰ This PR is included in version 1.26.0 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants