{"id":50828826,"url":"https://github.com/viggomeesters/obsidian-sql-viewer","last_synced_at":"2026-06-13T21:01:31.699Z","repository":{"id":364499302,"uuid":"1262620543","full_name":"viggomeesters/obsidian-sql-viewer","owner":"viggomeesters","description":"Read-only SQLite database viewer for Obsidian.","archived":false,"fork":false,"pushed_at":"2026-06-13T07:56:19.000Z","size":1004,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-13T09:26:14.258Z","etag":null,"topics":["obsidian","obsidian-plugin","read-only","sql","sqlite","viewer"],"latest_commit_sha":null,"homepage":"https://github.com/viggomeesters/obsidian-sql-viewer#readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/viggomeesters.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-08T06:52:42.000Z","updated_at":"2026-06-13T07:56:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/viggomeesters/obsidian-sql-viewer","commit_stats":null,"previous_names":["viggomeesters/obsidian-sql-viewer"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/viggomeesters/obsidian-sql-viewer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viggomeesters%2Fobsidian-sql-viewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viggomeesters%2Fobsidian-sql-viewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viggomeesters%2Fobsidian-sql-viewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viggomeesters%2Fobsidian-sql-viewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viggomeesters","download_url":"https://codeload.github.com/viggomeesters/obsidian-sql-viewer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viggomeesters%2Fobsidian-sql-viewer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34300116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["obsidian","obsidian-plugin","read-only","sql","sqlite","viewer"],"created_at":"2026-06-13T21:01:14.098Z","updated_at":"2026-06-13T21:01:31.693Z","avatar_url":"https://github.com/viggomeesters.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/hero.svg\" alt=\"SQL Viewer for Obsidian\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/viggomeesters/obsidian-sql-viewer/releases/latest\"\u003e\u003cimg alt=\"Latest release\" src=\"https://img.shields.io/github/v/release/viggomeesters/obsidian-sql-viewer?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg alt=\"MIT license\" src=\"https://img.shields.io/badge/license-MIT-green?style=flat-square\"\u003e\u003c/a\u003e\n  \u003cimg alt=\"Obsidian 1.5.0+\" src=\"https://img.shields.io/badge/Obsidian-1.5.0%2B-7c3aed?style=flat-square\"\u003e\n  \u003cimg alt=\"Read-only\" src=\"https://img.shields.io/badge/mode-read--only-0f766e?style=flat-square\"\u003e\n\u003c/p\u003e\n\n# SQL Viewer\n\nSQL Viewer is a read-only Obsidian plugin for inspecting local SQLite database files with `.sqlite`, `.sqlite3`, and `.db` extensions. It also catches SQLite sidecar files such as `.sqlite-wal`, `.sqlite-shm`, `.db-wal`, and `.db-shm` so they do not fail silently when shown by hidden-file plugins.\n\nIt 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.\n\n![SQL Viewer preview](assets/screenshot.svg)\n\n## Features\n\n- Opens `.sqlite`, `.sqlite3`, and `.db` files in a dedicated view.\n- Shows a read-only sidecar explanation for `.sqlite-wal`, `.sqlite-shm`, `.db-wal`, and `.db-shm` files, with an **Open base database** action when the matching database exists.\n- Shows database metadata: page count, page size, encoding, schema version, user version, and application id.\n- Lists tables, views, and indexes from `sqlite_master`.\n- Shows table/view schema through safe SQLite metadata calls.\n- Shows source SQL for tables, views, and indexes when SQLite stores it.\n- Renders a capped row preview with lazy per-object loading.\n- Filters objects and preview rows.\n- Runs single-statement read-only `SELECT` or `WITH` queries with a row cap and elapsed-time guard.\n- Blocks mutating SQL keywords including `INSERT`, `UPDATE`, `DELETE`, `DROP`, `ALTER`, `CREATE`, `VACUUM`, `ATTACH`, and `PRAGMA`.\n- Stays local-only: no network APIs, no clipboard APIs, and no database write-back.\n\n## SQLite sidecar files\n\nSQLite can create runtime sidecars next to the main database:\n\n- `x.sqlite-wal` and `x.db-wal` are write-ahead log files.\n- `x.sqlite-shm` and `x.db-shm` are shared-memory index files.\n\nThese files are not standalone databases. SQL Viewer registers those extensions only to avoid dead clicks or parse errors in vaults where hidden/runtime files are visible. It does not replay WAL data, checkpoint, repair, vacuum, or write to the database. When the matching base database is present, the sidecar view offers an **Open base database** action:\n\n- `x.sqlite-wal` -\u003e `x.sqlite`\n- `x.sqlite-shm` -\u003e `x.sqlite`\n- `x.db-wal` -\u003e `x.db`\n- `x.db-shm` -\u003e `x.db`\n\n## Read-only query behavior\n\nThe 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.\n\nEvery 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.\n\nThe 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.\n\n## Dependency and bundle tradeoff\n\nSQL Viewer uses [`sql.js`](https://github.com/sql-js/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.\n\n## Existing plugin overlap\n\nThis plugin exists only as a minimal, stricter read-only variant. Current community options already cover broader SQLite workflows:\n\n- [SQLite Explorer](https://community.obsidian.md/plugins/sqlite-explorer) is close to this scope and offers table selection, schema inspection, and a read-only SQL runner.\n- [SQLite DB Viewer](https://community.obsidian.md/plugins/sqlite-db-viewer) uses `sql.js` and describes broader query/edit/visualization behavior.\n- [SQLite DB](https://community.obsidian.md/plugins/sqlite-db) focuses on queries, charts, and exports from notes.\n\nSQL Viewer does not try to replace those broader tools. It deliberately omits editing, exports, charting, note generation, server databases, and general `.sql` script viewing.\n\n## Installation\n\n### Manual installation\n\n1. Download `main.js`, `manifest.json`, and `styles.css` from the latest release.\n2. Create this folder in your vault: `.obsidian/plugins/sql-viewer/`.\n3. Put the downloaded files in that folder.\n4. Reload Obsidian.\n5. Enable **SQL Viewer** in **Settings -\u003e Community plugins**.\n\n### BRAT installation\n\nFor beta testing, install the plugin with [BRAT](https://github.com/TfTHacker/obsidian42-brat) using this repository URL:\n\n```text\nhttps://github.com/viggomeesters/obsidian-sql-viewer\n```\n\n## Usage\n\nOpen any `.sqlite`, `.sqlite3`, or `.db` file in your vault. Obsidian will open it with SQL Viewer.\n\nIf hidden-file tooling exposes `.sqlite-wal`, `.sqlite-shm`, `.db-wal`, or `.db-shm` files, opening them shows a sidecar explanation instead of trying to parse them as databases.\n\nUse 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.\n\nThe query runner is for small read-only inspection queries:\n\n```sql\nSELECT * FROM my_table LIMIT 20\n```\n\n```sql\nWITH recent AS (\n  SELECT *\n  FROM my_table\n  ORDER BY id DESC\n  LIMIT 20\n)\nSELECT * FROM recent\n```\n\n## Development\n\n```bash\nnpm install\nnpm run build\nnpx tsc --noEmit\nnpm test\nnpm run community:check\n```\n\nFor local development, copy or symlink this repository into `.obsidian/plugins/sql-viewer/` inside an Obsidian vault.\n\n## Security checks\n\nThe test suite covers:\n\n- valid `.sqlite`, `.sqlite3`, and `.db` fixtures\n- `.sqlite-wal`, `.sqlite-shm`, `.db-wal`, and `.db-shm` sidecar mapping fixtures\n- multiple tables\n- view and index discovery\n- large table row caps\n- malformed database rejection\n- allowed `SELECT` and `WITH` queries\n- blocked write and maintenance statements\n- source-level checks for network, clipboard, process, dynamic execution, and vault mutation APIs\n\n## Release process\n\nObsidian installs community plugin files from GitHub releases. For each release:\n\n1. Update `manifest.json`, `package.json`, and `versions.json`.\n2. Run `npm install`, `npm run build`, `npx tsc --noEmit`, and `npm test`.\n3. Create a GitHub release whose tag exactly matches `manifest.json.version`.\n4. Attach `main.js`, `manifest.json`, and `styles.css` as release assets.\n\n## Community directory submission\n\nThis repository is prepared for Obsidian Community plugin submission.\n\nSubmit this repository URL:\n\n```text\nhttps://github.com/viggomeesters/obsidian-sql-viewer\n```\n\nBefore submitting:\n\n- Make sure the latest GitHub release tag exactly matches `manifest.json.version`.\n- Make sure release assets include `main.js`, `manifest.json`, and `styles.css`.\n- Run `npm run community:check`.\n- Sign in to [community.obsidian.md](https://community.obsidian.md), link GitHub, open **Plugins -\u003e New plugin**, enter the repository URL, and submit.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviggomeesters%2Fobsidian-sql-viewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviggomeesters%2Fobsidian-sql-viewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviggomeesters%2Fobsidian-sql-viewer/lists"}