Skip to content

Add db-browser - #23

Merged
geodro merged 3 commits into
mainfrom
add-db-browser
Nov 14, 2026
Merged

geodro merged 3 commits into
mainfrom
add-db-browser

Conversation

@geodro

@geodro geodro commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Plugin

What it does

A Database tab on each site that lists its tables, pages through rows with sort and filter, shows a table's structure, runs SQL with results as a table, JSON, text or CSV, and edits rows with the changes shown and committed in one transaction. MySQL, MariaDB and PostgreSQL go through lerd db:shell and SQLite through PHP in the site's container, so it needs no database client and no credentials.

What it adds to Lerd

A site tab, with when: database so it shows only on sites that have a database, and one API endpoint, db, marked loopback only. No commands, hooks, MCP tools, notifications, services or frameworks.

What it reads, changes and sends

  • Reads: Lerd's /api/sites and /api/databases, the site's database, and the site's .env only to find a SQLite file
  • Changes: the site's database, only when the user commits edits or confirms a statement that writes; its settings, the engine of each service and each site's query history in its data folder
  • Sends over the network: nothing

Requirements

Lerd 1.38 or newer and Node, on Linux and macOS. Showing the tab only on sites with a database, and the picker between a site's databases, need lerd-env/lerd#2559; on an older Lerd the tab shows everywhere and opens the database lerd db:shell picks.

Images

A table's rows with a JSON value opened in the panel under them
The SQL editor with a joined query and its result
A table's structure: columns, indexes and foreign keys

Checklist

  • The repository is public and has an open source license.
  • The README says what the plugin adds, reads, changes and sends.
  • plugin.yaml declares lerd as a lower bound, and platforms if it runs on only one.
  • Everything it runs is readable source in the commit, in shell, Python, Node or similar but not PHP: no binaries, no minified code without its source, nothing downloaded and run.
  • It asks for no privilege and writes only to its own folder, its data folder and the sites it is run against, changing Lerd only through its API.
  • It reads no secrets it has no stated need for, and a site's .env only when the README says why.
  • Lerd's token never leaves the machine and is never written outside the plugin's data folder.
  • Hooks finish quickly and fail without leaving a site, service or database half changed.
  • Nothing leaves the machine without an opt-in the user turns on, and there are no analytics, tracking, ads or mining.
  • Any notifications are declared in plugin.yaml and only tell the user something they need to know or act on.
  • Pages bundle their own assets, nothing loads from third-party servers, and page scripts talk only to the plugin's own endpoints.
  • Any service image comes from a public registry, is pinned to a version tag or a digest, never latest, and is named in the README with its source.
  • No service or framework reuses a name Lerd, its stores or another plugin already has.
  • The name, description and images describe what it actually does.
  • The images show the plugin itself, are mine to publish, and are at most 6, each a PNG, JPEG or WebP under 1 MB and at most 2560 px wide.

@geodro
geodro requested a review from a team as a code owner November 14, 2026 23:02
@geodro

geodro commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Repinned to d29aa9d after running it through the review in a VM, a refused request like a query with two statements or SQL the database rejects was showing up as a plugin failure on its card, it now answers with the reason instead and only a real fault exits non zero.

@geodro

geodro commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Repinned to c703777, the screenshots now show the current layout with paging in a status bar under the rows, nothing else changed besides keeping the History picker narrow in the SQL bar.

@geodro
geodro merged commit 61cc921 into main Nov 14, 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.

1 participant