MCPcopy Create free account
hub / github.com/aiscriptdev/aiscript / get_mysql_url

Method get_mysql_url

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

Source from the content-addressed store, hash-verified

71 }
72
73 pub fn get_mysql_url(&self) -> Option<String> {
74 self.mysql.as_ref().and_then(|c| {
75 c.url.clone().map(Into::into).or_else(|| {
76 match (&c.host, &c.port, &c.user, &c.password, &c.database) {
77 (Some(host), Some(port), Some(user), Some(password), Some(database)) => {
78 Some(format!(
79 "mysql://{}:{}@{}:{}/{}",
80 user, password, host, port, database
81 ))
82 }
83 _ => None,
84 }
85 })
86 })
87 }
88
89 pub fn get_redis_url(&self) -> Option<String> {
90 self.redis.as_ref().and_then(|c| {

Callers

nothing calls this directly

Calls 2

as_refMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected