Skip to main content

build_admin_config

Function build_admin_config 

Source
fn build_admin_config() -> Result<Config, String>
Expand description

构建 postgres 维护库的连接配置:复用目标 URL 的 host/port/user/password, 仅把 dbname 换成 postgres

tokio_postgres::Config 未实现 Clone,故逐字段拷贝到新的 Config::new()host()/port()&mut self 的借用式 builder,故按 host 逐个追加并配对端口。