summaryrefslogtreecommitdiffstats
path: root/src/db/connection.rs
AgeCommit message (Collapse)Author
2021-11-19Update Copyright string to 2020-2022Matthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-08-17Revert "Add spinner for establishing database connection"Matthias Beyer
This reverts commit ab04d88ae84c33f3577870c10378f0166adf27bc. Having a progress bar for establishing the database connection was just too much noise visually. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-24Add spinner for establishing database connectionMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-17Fix: Do not print database password in debug logMatthias Beyer
We have to manually implement Debug here, because otherwise we would print the database password in the debug output, which is CLEARLY a bad idea. Hence, change the debug!() call in the establish_connection() function to (debug-)print `self` and hand-implement the `Debug` trait. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-11Refactor: Parsing and connection establishing should be member functionsMatthias Beyer
This refactors the parsing of the `DbConnectionConfig` object and the establishing of the connection to be member functions of the type, rather than free functions. Way more idomatic. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-11Refactor: Simplify by removing Into<String> implementationMatthias Beyer
This is actually an antipattern, because one should rather implement `ToString` (or rather `Display`). But because our type is nothing that would be displayed anyways, remove it entirely. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-11Refactor: Database connection setup codeMatthias Beyer
This patch refactors the database connection setup code to involve less copying of data in memory. It also changes the configuration value type of the database port and the database connection timeout setting to be `u16` instead of `String`, which is another improvement. Because the `DbConnectionConfig` type no longer holds owned values, it must be annotated with a lifetime. Usages were adapted. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-04-26Add support for database connection timeoutMatthias Beyer
This patch adds support for a database connection timeout, giving the user the option to configure one, but hardcoding a default timeout to 30 seconds. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-18Run `cargo fmt`Matthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-13Add LICENSE file and license headersMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-07Deny macro_use from external crateMatthias Beyer
Diesel is an exception here, because the generated src/schema.rs file does not automatically contain the necessary imports. All imports were added where necessary. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-26Update dependency: clap: 3.0.0-beta.1 -> 3.0.0-beta.2Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-08Remove unused imports, sort importsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-03Add DB connection establishingMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>