summaryrefslogtreecommitdiff
path: root/src/math.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2019-03-28 03:33:14 -0500
committertom barrett <spalf0@gmail.com>2019-03-28 07:24:51 -0500
commitf8c446ce74329fc5844e0fc1fd82e618242196f4 (patch)
tree02319b823da4888c6d4e2faa9f482be11caad353 /src/math.rs
parentca5ee0b32b616fb8fa5e7e44c74acecefab719c3 (diff)
migrate and revert executable, query insert and delete test
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,