Viggo Meesters21 downloadsOpen SQLite database files as read-only schema, preview, and query views.
SQL Viewer is a read-only Obsidian plugin for inspecting local SQLite database files with .sqlite, .sqlite3, and .db extensions.
It is intentionally narrow: table and view browsing, schema/source inspection, capped row previews, metadata, refresh, filtering, and a constrained read-only query runner. It is not a database editor, migration tool, export tool, charting app, or general SQL IDE.
.sqlite, .sqlite3, and .db files in a dedicated view.sqlite_master.SELECT or WITH queries with a row cap and elapsed-time guard.INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, VACUUM, ATTACH, and PRAGMA.The query runner accepts only one statement that starts with SELECT or WITH. It rejects multi-statement SQL and blocks keywords associated with mutation, attachment, transactions, maintenance, and pragmas.
Every opened in-memory database receives PRAGMA query_only = ON, and rendered results are wrapped with an outer LIMIT. The default query cap is 200 rendered rows. Table previews are capped at 100 rendered rows.
The elapsed-time guard is a UI responsiveness guard around statement iteration. Because sql.js executes synchronously in WebAssembly, a single expensive SQLite step cannot be interrupted mid-step. For that reason, SQL Viewer keeps the runner deliberately small and documents it as an inspection aid, not as an analytical query engine.
SQL Viewer uses sql.js, SQLite compiled to WebAssembly. The WASM bytes are bundled into main.js via esbuild instead of being fetched as a sidecar file at runtime. This keeps the plugin self-contained and local-only, with the tradeoff that main.js is much larger than a plain text viewer plugin.
This plugin exists only as a minimal, stricter read-only variant. Current community options already cover broader SQLite workflows:
sql.js and describes broader query/edit/visualization behavior.SQL Viewer does not try to replace those broader tools. It deliberately omits editing, exports, charting, note generation, server databases, and general .sql script viewing.
main.js, manifest.json, and styles.css from the latest release..obsidian/plugins/sql-viewer/.For beta testing, install the plugin with BRAT using this repository URL:
https://github.com/viggomeesters/obsidian-sql-viewer
Open any .sqlite, .sqlite3, or .db file in your vault. Obsidian will open it with SQL Viewer.
Use the object list to choose a table or view. The main panel shows schema, source SQL, and a capped preview. Use the filter field to narrow object names and rendered preview rows. Use Refresh database after replacing a database file on disk.
The query runner is for small read-only inspection queries:
SELECT * FROM my_table LIMIT 20
WITH recent AS (
SELECT *
FROM my_table
ORDER BY id DESC
LIMIT 20
)
SELECT * FROM recent
npm install
npm run build
npx tsc --noEmit
npm test
npm run community:check
For local development, copy or symlink this repository into .obsidian/plugins/sql-viewer/ inside an Obsidian vault.
The test suite covers:
.sqlite, .sqlite3, and .db fixturesSELECT and WITH queriesObsidian installs community plugin files from GitHub releases. For each release:
manifest.json, package.json, and versions.json.npm install, npm run build, npx tsc --noEmit, and npm test.manifest.json.version.main.js, manifest.json, and styles.css as release assets.This repository is prepared for Obsidian Community plugin submission.
Submit this repository URL:
https://github.com/viggomeesters/obsidian-sql-viewer
Before submitting:
manifest.json.version.main.js, manifest.json, and styles.css.npm run community:check.