From f8c446ce74329fc5844e0fc1fd82e618242196f4 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Thu, 28 Mar 2019 03:33:14 -0500 Subject: migrate and revert executable, query insert and delete test --- src/math.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/math.rs') 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, -- cgit v1.2.3