()
| 130 | } |
| 131 | |
| 132 | pub 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 | |
| 144 | pub async fn get_sqlite_connection() -> Option<SqlitePool> { |
| 145 | let config = Config::get(); |
no test coverage detected