(&self)
| 55 | } |
| 56 | |
| 57 | pub fn get_postgres_url(&self) -> Option<String> { |
| 58 | self.postgresql.as_ref().and_then(|c| { |
| 59 | c.url.clone().map(Into::into).or_else(|| { |
| 60 | match (&c.host, &c.port, &c.user, &c.password, &c.database) { |
| 61 | (Some(host), Some(port), Some(user), Some(password), Some(database)) => { |
| 62 | Some(format!( |
| 63 | "postgres://{}:{}@{}:{}/{}", |
| 64 | user, password, host, port, database |
| 65 | )) |
| 66 | } |
| 67 | _ => None, |
| 68 | } |
| 69 | }) |
| 70 | }) |
| 71 | } |
| 72 | |
| 73 | pub fn get_mysql_url(&self) -> Option<String> { |
| 74 | self.mysql.as_ref().and_then(|c| { |
no test coverage detected