Documentation
¶
Overview ¶
Package tobira is the root of tobira, a terminal client for every database ("Every database, one terminal.").
The root module never depends on a database SDK. Each database lives behind the driver model defined in the driver package, and concrete drivers ship as separate modules so that importing tobira does not pull in any client library. See package driver for the contract drivers implement and package drivertest for the conformance kit.
The tobira binary (module cmd/tobira) wires the drivers, the terminal UI, the AI assistant and the MCP server together; this root module holds the driver contract, the shared helpers and the internal packages they use.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package api is tobira's stable surface for driver plugins and embedders.
|
Package api is tobira's stable surface for driver plugins and embedders. |
|
cmd
|
|
|
tobira
module
|
|
|
Package driver defines the model every tobira database driver implements, and the registry that finds drivers.
|
Package driver defines the model every tobira database driver implements, and the registry that finds drivers. |
|
drivers
|
|
|
sqlite
module
|
|
|
Package drivertest is the conformance kit every tobira driver must pass.
|
Package drivertest is the conformance kit every tobira driver must pass. |
|
driverutil
|
|
|
netpolicy
Package netpolicy holds the transport rules every network driver applies before it sends a credential: what counts as this machine, which hosts are a TLS-only cloud service, when plain (unencrypted) transport is allowed, and how redirects are refused.
|
Package netpolicy holds the transport rules every network driver applies before it sends a credential: what counts as this machine, which hosts are a TLS-only cloud service, when plain (unencrypted) transport is allowed, and how redirects are refused. |
|
sqlcomplete
Package sqlcomplete is a dependency-free SQL completion engine shared by the SQL drivers.
|
Package sqlcomplete is a dependency-free SQL completion engine shared by the SQL drivers. |
|
sqlitecore
Package sqlitecore is the SQLite dialect logic shared by the SQLite-family drivers (sqlite, libsql, d1): the read-only and single-statement guards with the PRAGMA allow-list, declared-type mapping and value conversion, rowid-alias detection from the CREATE TABLE text, catalog row parsing, mutation and browse SQL building, and EXPLAIN QUERY PLAN trees.
|
Package sqlitecore is the SQLite dialect logic shared by the SQLite-family drivers (sqlite, libsql, d1): the read-only and single-statement guards with the PRAGMA allow-list, declared-type mapping and value conversion, rowid-alias detection from the CREATE TABLE text, catalog row parsing, mutation and browse SQL building, and EXPLAIN QUERY PLAN trees. |
|
sqlscan
Package sqlscan is the SQL tokenizer shared by the SQL drivers' read-only guards and by driverutil/sqlcomplete.
|
Package sqlscan is the SQL tokenizer shared by the SQL drivers' read-only guards and by driverutil/sqlcomplete. |
|
internal
|
|
|
assistant
Package assistant defines the AI assistant the TUI and the CLI program against.
|
Package assistant defines the AI assistant the TUI and the CLI program against. |
|
assistant/assistanttest
Package assistanttest provides a scriptable assistant.Assistant for the CLI and TUI tests.
|
Package assistanttest provides a scriptable assistant.Assistant for the CLI and TUI tests. |
|
cli
Package cli implements the tobira command-line interface.
|
Package cli implements the tobira command-line interface. |
|
config
Package config loads the tobira connection list from the YAML config file (~/.config/tobira/config.yaml by default).
|
Package config loads the tobira connection list from the YAML config file (~/.config/tobira/config.yaml by default). |
|
connio
Package connio moves connections in and out of tobira: it prepares the connections `tobira connections export` prints, with every password removed, and reads the connection lists of other tools (DBeaver, pgpass, TablePlus) and of export itself into an import plan.
|
Package connio moves connections in and out of tobira: it prepares the connections `tobira connections export` prints, with every password removed, and reads the connection lists of other tools (DBeaver, pgpass, TablePlus) and of export itself into an import plan. |
|
export
Package export streams a query result or a whole collection into a csv, json or ndjson file, in constant memory, through internal/query's row writers.
|
Package export streams a query result or a whole collection into a csv, json or ndjson file, in constant memory, through internal/query's row writers. |
|
federate
Package federate runs one query over several connections: each source is staged with its own native query, read-only, into a scratch SQLite database, and a final SQLite statement joins them there.
|
Package federate runs one query over several connections: each source is staged with its own native query, read-only, into a scratch SQLite database, and a final SQLite statement joins them there. |
|
history
Package history keeps a local log of the queries tobira ran.
|
Package history keeps a local log of the queries tobira ran. |
|
mcphttp
Package mcphttp is the network policy of `tobira mcp --http`: which addresses it may bind, and the guard every request passes before it reaches the MCP server (DNS-rebinding defence, bearer token, body limit).
|
Package mcphttp is the network policy of `tobira mcp --http`: which addresses it may bind, and the guard every request passes before it reaches the MCP server (DNS-rebinding defence, bearer token, body limit). |
|
plugininstall
Package plugininstall puts a driver plugin binary into the plugins directory for `tobira driver install`: from an http(s) URL or a local path, only once its sha256 matches, through a temporary file renamed into place.
|
Package plugininstall puts a driver plugin binary into the plugins directory for `tobira driver install`: from an http(s) URL or a local path, only once its sha256 matches, through a temporary file renamed into place. |
|
query
Package query runs one native query against a driver.Conn and renders the result as a table, JSON, NDJSON or CSV.
|
Package query runs one native query against a driver.Conn and renders the result as a table, JSON, NDJSON or CSV. |
|
secrets
Package secrets turns a config.Connection into a driver.ConnConfig with its password resolved.
|
Package secrets turns a config.Connection into a driver.ConnConfig with its password resolved. |
|
secrets/keyring
Package keyring resolves keyring:<name> password references from the OS keyring (macOS Keychain, Windows Credential Manager, the Secret Service on Linux).
|
Package keyring resolves keyring:<name> password references from the OS keyring (macOS Keychain, Windows Credential Manager, the Secret Service on Linux). |
|
session
Package session manages the lazily opened database connections of one tobira run.
|
Package session manages the lazily opened database connections of one tobira run. |
|
sshtunnel
Package sshtunnel reaches a database through an SSH server: it opens an SSH session, listens on a loopback port and forwards each connection to the host and port the DSN names, as seen from the SSH server.
|
Package sshtunnel reaches a database through an SSH server: it opens an SSH session, listens on a loopback port and forwards each connection to the host and port the DSN names, as seen from the SSH server. |
|
sshtunnel/sshtest
Package sshtest is an in-process SSH server for tests: it accepts one public key and an optional password, and serves direct-tcpip channels, which is all a tunnel needs.
|
Package sshtest is an in-process SSH server for tests: it accepts one public key and an optional password, and serves direct-tcpip channels, which is all a tunnel needs. |
|
textutil
Package textutil holds small string helpers shared by internal packages.
|
Package textutil holds small string helpers shared by internal packages. |
|
tui
Package tui is the Bubble Tea terminal UI for tobira.
|
Package tui is the Bubble Tea terminal UI for tobira. |
|
tui/async
Package async runs driver calls off the Bubble Tea update goroutine.
|
Package async runs driver calls off the Bubble Tea update goroutine. |
|
tui/chart
Package chart draws a time series as text: a sparkline on a narrow pane, an ASCII line chart with min, max and last labels otherwise.
|
Package chart draws a time series as text: a sparkline on a narrow pane, an ASCII line chart with min, max and last labels otherwise. |
|
tui/click
Package click recognises double-clicks for the grid and the sidebar: a second click on the same target within a short window.
|
Package click recognises double-clicks for the grid and the sidebar: a second click on the same target within a short window. |
|
tui/connform
Package connform is the add/edit connection form: a charm.land/huh/v2 form wrapped as a component the TUI embeds as an overlay and the CLI runs standalone.
|
Package connform is the add/edit connection form: a charm.land/huh/v2 form wrapped as a component the TUI embeds as an overlay and the CLI runs standalone. |
|
tui/detail
Package detail is the full-pane row view: the row's columns as key/value pairs, with Object, List and JSON values as an expandable tree.
|
Package detail is the full-pane row view: the row's columns as key/value pairs, with Object, List and JSON values as an expandable tree. |
|
tui/editor
Package editor is the query editor: a multi-line text buffer with a grapheme-aware cursor, a selection and chroma highlighting.
|
Package editor is the query editor: a multi-line text buffer with a grapheme-aware cursor, a selection and chroma highlighting. |
|
tui/filter
Package filter is the grid's filter bar: a one-line input parsed into a driver.Filter.
|
Package filter is the grid's filter bar: a one-line input parsed into a driver.Filter. |
|
tui/grid
Package grid is the virtualised data grid: a table of rows held in pages of 200, drawn with cost proportional to the visible cells only.
|
Package grid is the virtualised data grid: a table of rows held in pages of 200, drawn with cost proportional to the visible cells only. |
|
tui/help
Package help renders the help overlay: the key bindings of the active keymap, then the palette commands.
|
Package help renders the help overlay: the key bindings of the active keymap, then the palette commands. |
|
tui/keymap
Package keymap maps named actions to key bindings.
|
Package keymap maps named actions to key bindings. |
|
tui/palette
Package palette is the ":" command line.
|
Package palette is the ":" command line. |
|
tui/sidebar
Package sidebar is the connection tree: connection, then namespace, then collection.
|
Package sidebar is the connection tree: connection, then namespace, then collection. |
|
tui/statusbar
Package statusbar renders the one-line bar at the bottom of the screen: breadcrumb, row position and load time, read-only badge, connection status dot and key hints.
|
Package statusbar renders the one-line bar at the bottom of the screen: breadcrumb, row position and load time, read-only badge, connection status dot and key hints. |
|
tui/theme
Package theme defines tobira's colour palettes and the lipgloss styles derived from them.
|
Package theme defines tobira's colour palettes and the lipgloss styles derived from them. |
|
tui/tuitest
Package tuitest holds assertions shared by the view packages' tests.
|
Package tuitest holds assertions shared by the view packages' tests. |
|
plugin
|
|
|
convert
Package convert translates between the driver types and the plugin protocol messages in plugin/proto/tobira/plugin/v1.
|
Package convert translates between the driver types and the plugin protocol messages in plugin/proto/tobira/plugin/v1. |
|
host
Package host runs external driver plugins: tobira-driver-<name> binaries that speak the tobira.plugin.v1 protocol through hashicorp/go-plugin (see plugin/sdk for the plugin side).
|
Package host runs external driver plugins: tobira-driver-<name> binaries that speak the tobira.plugin.v1 protocol through hashicorp/go-plugin (see plugin/sdk for the plugin side). |
|
shared
Package shared holds what both ends of a tobira driver plugin must agree on: the go-plugin handshake (protocol version and magic cookie) and the name under which the Driver service is dispensed.
|
Package shared holds what both ends of a tobira driver plugin must agree on: the go-plugin handshake (protocol version and magic cookie) and the name under which the Driver service is dispensed. |
Click to show internal directories.
Click to hide internal directories.