MCPcopy Create free account
hub / github.com/Rust-Web-Development/code / new

Method new

ch_09/src/store.rs:20–33  ·  view source on GitHub ↗
(db_url: &str)

Source from the content-addressed store, hash-verified

18
19impl 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,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected