fix: expand SQLite home and environment paths
This commit is contained in:
+1
-1
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user