fix: expand SQLite home and environment paths

This commit is contained in:
Valdemar Lorenzen
2026-10-19 12:59:46 +02:00
parent 38fb0d261a
commit 415e5c2718
4 changed files with 79 additions and 1 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ use crate::Result;
pub(super) fn open(path: &Path) -> Result<Connection> {
// An absolute existing path also prevents SQLite's special :memory: filename from creating a database.
let path = path.canonicalize()?;
let path = shellexpand::path::full(path)?.canonicalize()?;
let connection = Connection::open_with_flags(
path,
OpenFlags::SQLITE_OPEN_READ_ONLY | OpenFlags::SQLITE_OPEN_NO_MUTEX,
+2
View File
@@ -20,6 +20,8 @@ Use the in-app password field to keep credentials out of process arguments.
Open an existing SQLite database file (read-only; missing files are not created):
cargo run -- --sqlite ./database.sqlite
SQLite paths can be relative or absolute; quote paths containing spaces.
SQLite paths expand leading ~, $VAR, and ${VAR}; undefined variables are errors.
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.