(db_url: &str)
| 15 | |
| 16 | impl Store { |
| 17 | pub async fn new(db_url: &str) -> Self { |
| 18 | let db_pool = match PgPoolOptions::new() |
| 19 | .max_connections(5) |
| 20 | .connect(db_url) |
| 21 | .await |
| 22 | { |
| 23 | Ok(pool) => pool, |
| 24 | Err(e) => panic!("Couldn't establish DB connection: {}", e), |
| 25 | }; |
| 26 | |
| 27 | Store { |
| 28 | connection: db_pool, |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | pub async fn get_questions( |
| 33 | self, |
nothing calls this directly
no outgoing calls
no test coverage detected