simple-sqlite-viewer README
A VSCode extension that lets you read SQLite .db files as plain text. Double-click a database file and its tables and rows are laid out in a readable, scrollable view.
Features
Open any .db file from the Explorer and the extension shows the whole database as it exists in the file: the schema table (sqlite_master) first — listing every table, index, view, and trigger with its CREATE statement — then every table and every index as aligned text, in physical file order.
Index contents are decoded directly from the file's B-tree pages, so you see the actual stored entries (indexed values and rowids).
Each table is rendered with a banner, aligned columns separated by a column character (| by default), with header and border rules. By default it looks like this:
⧧===============⧧
| suppliers |
⧧===============⧧
⧧====⧧==============⧧========⧧
| id | company | rating |
+----+--------------+--------+
| 1 | Acme Ltd. | 5 |
| 2 | Globex Corp. | 3 |
| 3 | Initech | 1 |
⧧====⧧==============⧧========⧧
Empty values are shown as (null) by default.
Binary (BLOB) values are shown as a short hex preview tagged with their length, for example (binary, [4 bytes]: 89 50 4E 47).
Each table can be collapsed: fold the banner to hide its bottom border, and fold the header row to hide the data rows beneath it.
Because .db files are binary, VSCode briefly shows its "file is binary" warning before the formatted view replaces it. This flash is expected.
Requirements
None beyond VSCode itself. The SQLite engine is bundled with the extension (via sql.js), so there is nothing to install or configure.
Extension Settings
The display is configurable. Under Simple SQLite Viewer in Settings (search simpleSqliteViewer) you can change the frame characters, the column separators, the rules above and below each table, the banner around each table name, and the text shown for nulls and binary values. Changes apply live — edit a setting and any open database view re-renders immediately.
Most settings take a pattern rather than a single character. Patterns longer than one character are tiled to fill their space, which can make tables or the banner wider; the Advanced settings let you truncate patterns instead of widening. If two patterns that share the same space are both long, the extension shows a one-time note pointing you to those switches.
See the settings reference for a full explanation of every setting and how they interact.
Behavior & Design
- Read-only. The view displays data but does not save edits back to the database. This is by design.
- Brief binary-warning flash when opening a file, as described under Features. (I have no intention of fixing this since I need to trigger off that screen to open files cleanly)
- Security posture: database files are treated as untrusted binary input. The extension only reads a database and never runs anything stored in it as code (views and triggers are shown but not run); it does run read queries over the file to display it. The index B-tree parser validates sizes, offsets, and page references before use to reject malformed or malicious files. The bundled SQLite engine (sql.js) parses the rest, so updates to it are treated as security updates and shipped promptly.
Known Issues & Limitations
- Databases over 150 MB are refused before any reading happens, to prevent out-of-memory crashes of the extension host.
- VSCode's internal size limit. VSCode will refuse to open anything where the generated text document exceeds 50MB, meaning large databases under the 150 MB cap may still fail to display after processing. This is a restriction imposed on extensions by VSCode itself and can't be fixed.
- Very large databases open with folding and some editor features disabled (VSCode's large-file protection). Clicking "Forcefully Enable Features" on the notification turns them back on by changing the global setting
editor.largeFileOptimizations — it applies to all files, not just this one, and can be reset in Settings.
- Large integers beyond 2^53 (JavaScript's exact-integer limit) may display with their low-order digits altered — this affects both index keys and integer table cells. It applies to any genuinely large 64-bit integer, not only deliberately constructed files. This is a known limitation and a fix is planned for a future release.
- Folding under collision-prone display settings. Folding recognises tables by their separator lines. If you choose display settings that make ordinary data render identically to a separator, a table may fold at the wrong line. The displayed text is always correct; only the fold boundary is affected. See the settings reference for details.
Release Notes
See CHANGELOG.md for full details.
- 1.0.0 — Configurable display (frame, separators, banner, text) with live update; the reader is feature-complete.
- 0.0.3 — Index contents shown as tables; reworked table frame; parser hardened against malformed files.
- 0.0.2 — Full schema display (sqlite_master first), security hardening, 150 MB size cap.
- 0.0.1 — Initial release.
Source
github.com/JeremyNDev/simple-sqlite-viewer-VSCode
License
MIT — free to use, modify, and distribute; please keep the attribution.
Enjoy!