feat: persist configured databases and connect from sidebar

This commit is contained in:
Valdemar Lorenzen
2026-10-19 13:10:27 +02:00
parent d8d7c1f2fc
commit 11647e0a8a
3 changed files with 325 additions and 74 deletions
+13 -8
View File
@@ -13,7 +13,7 @@ Usage:
dbdash --sqlite PATH
dbdash --help
Run without a connection argument to open the in-app connection screen:
Run without a connection argument to open the saved database list:
cargo run
Use the in-app password field to keep credentials out of process arguments.
@@ -26,23 +26,28 @@ Expansion never runs shell commands. Quote CLI paths to let dbdash expand them.
PostgreSQL URLs and libpq-style key=value strings are accepted.
Use sslmode=require for mandatory TLS; certificates and hostnames are verified.
Use sslmode=disable only for trusted local connections.
The inspector needs 70×12 terminal cells; the PostgreSQL form needs 70×16.
The inspector needs 70×12 terminal cells; the PostgreSQL window needs 74×20.
Navigation:
Tab / Esc Switch focus / return to relations
Up/Down, j/k Move selection (Enter opens a relation)
Tab/Shift-Tab Cycle focus: databases, relations, rows (Esc returns to databases)
Up/Down, j/k Move selection (Enter connects to a database or opens a relation)
Home/End, g/G First / last item
s Toggle rows and column schema
Left/Right Scroll columns (h/l also work)
n/p, PgDn/Up Next / previous 100-row page
c Open the connection screen (Esc keeps the current database)
c Add a configured database in a floating window
r Refresh relations and the active relation
q / Ctrl-C Quit
Connection screen: Up/Down chooses a provider; Enter starts editing.
New database window: Up/Down chooses a provider; Enter starts editing.
Tab/Shift-Tab changes fields; Left/Right changes TLS when that field is focused.
Enter connects; Esc cancels; Ctrl-U clears a field. Pasting is supported.
Form details are session-only. Passwords clear after connecting or cancelling.
Enter saves without connecting, including when the database is offline.
Select a saved database and press Enter to connect. PostgreSQL prompts for a
password; Esc cancels. Passwords are masked, never saved, and clear on success
or cancellation. Ctrl-U clears a field; pasting is supported.
Enter the database user explicitly; the operating-system username is not used.
Configurations persist in $XDG_CONFIG_HOME/dbdash/connections.sqlite3, falling
back to ~/.config/dbdash/connections.sqlite3. SQLite paths are saved absolute.
CLI connections are not saved. Failed switches keep the current database open.
PostgreSQL reads are enforced read-only and have a 5-second query timeout.
SQLite files are opened read-only, with a 5-second lock wait but no query timeout.