refactor: remove DATABASE_URL auto-connection
This commit is contained in:
+3
-5
@@ -13,11 +13,9 @@ Usage:
|
|||||||
dbdash --sqlite PATH
|
dbdash --sqlite PATH
|
||||||
dbdash --help
|
dbdash --help
|
||||||
|
|
||||||
Run without a connection argument and without DATABASE_URL to connect in-app.
|
Run without a connection argument to open the in-app connection screen:
|
||||||
Otherwise DATABASE_URL supplies the PostgreSQL connection when no argument is given.
|
|
||||||
Prefer the environment variable to keep passwords out of process arguments:
|
|
||||||
export DATABASE_URL='postgresql://user@localhost:5432/database'
|
|
||||||
cargo run
|
cargo run
|
||||||
|
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):
|
Open an existing SQLite database file (read-only; missing files are not created):
|
||||||
cargo run -- --sqlite ./database.sqlite
|
cargo run -- --sqlite ./database.sqlite
|
||||||
@@ -78,7 +76,7 @@ fn run() -> Result<()> {
|
|||||||
.ok_or("--sqlite requires a database file path; see dbdash --help")?,
|
.ok_or("--sqlite requires a database file path; see dbdash --help")?,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
argument.or_else(|| std::env::var_os("DATABASE_URL"))
|
argument
|
||||||
};
|
};
|
||||||
if args.next().is_some() {
|
if args.next().is_some() {
|
||||||
return Err("unexpected extra arguments; see dbdash --help".into());
|
return Err("unexpected extra arguments; see dbdash --help".into());
|
||||||
|
|||||||
Reference in New Issue
Block a user