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