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

Function get_pg_connection

aiscript-runtime/src/lib.rs:132–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

130}
131
132pub async fn get_pg_connection() -> Option<PgPool> {
133 let config = Config::get();
134 match config.database.get_postgres_url() {
135 Some(url) => PgPoolOptions::new()
136 .max_connections(5)
137 .connect(&url)
138 .await
139 .ok(),
140 None => None,
141 }
142}
143
144pub async fn get_sqlite_connection() -> Option<SqlitePool> {
145 let config = Config::get();

Callers 2

mainFunction · 0.85
run_serverFunction · 0.85

Calls 2

getFunction · 0.85
get_postgres_urlMethod · 0.80

Tested by

no test coverage detected