Documentation
¶
Overview ¶
Package dbview assembles the Databases surface: which installed services are database engines, the databases inside each one with their sizes, the site that owns each database, and the snapshots it holds. The web UI and the TUI both render from here so the two can never disagree about what a database belongs to.
Index ¶
Constants ¶
const TestingSuffix = "_testing"
TestingSuffix names the paired testing database lerd creates alongside every project database.
Variables ¶
This section is empty.
Functions ¶
func InstalledEngines ¶
func InstalledEngines() []string
InstalledEngines returns the installed database-engine service names, both default-stack (mysql, postgres) and add-on (mariadb, mongo, postgres-pgvector). sqlite is a file-based engine with no container, so it is excluded.
func IsEngine ¶
IsEngine reports whether a service belongs on the Databases surface: a family lerd wires as a project database, or any engine whose preset declares databases it can enumerate. The second half is what lets the store publish an engine outside the wired families (an analytics column store, say) and have it appear with the operations it declares.
func SiteIndexes ¶
SiteIndexes maps each engine to the databases owned in it, keyed by database name, resolved through each site's framework declaration and from the isolated databases worktrees have registered. A "<db>_testing" database maps to the same owner as "<db>", so both link to the same place. When a group shares one database across a main site and its secondaries, the database belongs to the group main, so a secondary that merely shares it never wins over the main.
Every engine is answered from one pass over the sites: resolving a site's targets detects its framework, which is far too much work to repeat per engine on every poll of the Databases tab.
Types ¶
type Engine ¶
type Engine struct {
Service string
Family string
Running bool
SupportsSnapshot bool
Databases []Entry
Error string
}
Engine is one database engine with the databases it holds. Error carries an introspection failure so the surface can say why an engine came back empty.