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

Method new

ch_11/src/store.rs:20–30  ·  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) -> Result<Self, sqlx::Error> {
21 tracing::warn!("{}", db_url);
22 let db_pool = PgPoolOptions::new()
23 .max_connections(5)
24 .connect(db_url)
25 .await?;
26
27 Ok(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