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

Method new

ch_08/src/store.rs:17–30  ·  view source on GitHub ↗
(db_url: &str)

Source from the content-addressed store, hash-verified

15
16impl 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,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected