MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / get_postgres_url

Method get_postgres_url

aiscript-runtime/src/config/db.rs:57–71  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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| {

Callers 1

get_pg_connectionFunction · 0.80

Calls 2

as_refMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected