summaryrefslogtreecommitdiff
path: root/src/math.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/math.rs')
-rw-r--r--src/math.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/math.rs b/src/math.rs
index 4f0558c..5ba7981 100644
--- a/src/math.rs
+++ b/src/math.rs
@@ -13,6 +13,19 @@ pub fn rand_name() -> String {
.collect()
}
+pub fn get_db_url() -> String {
+ let mut db_url = String::new();
+ db_url.push_str("postgres://");
+ db_url.push_str(constants::POSTGRES_USERNAME);
+ db_url.push_str(":");
+ db_url.push_str(constants::POSTGRES_PASSWORD);
+ db_url.push_str("@");
+ db_url.push_str(constants::POSTGRES_IP);
+ db_url.push_str("/");
+ db_url.push_str(constants::POSTGRES_DB_NAME);
+ db_url
+}
+
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct ControlSystem {
previous_error: f64,