MCPcopy Create free account
hub / github.com/block/buzz / setup_pool

Function setup_pool

crates/buzz-db/src/thread.rs:821–829  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

819 const TEST_DB_URL: &str = "postgres://buzz:buzz_dev@localhost:5432/buzz";
820
821 async fn setup_pool() -> PgPool {
822 let database_url = std::env::var("BUZZ_TEST_DATABASE_URL")
823 .or_else(|_| std::env::var("DATABASE_URL"))
824 .unwrap_or_else(|_| TEST_DB_URL.to_owned());
825
826 PgPool::connect(&database_url)
827 .await
828 .expect("connect to test DB")
829 }
830
831 fn make_stream_event(keys: &Keys, content: &str) -> nostr::Event {
832 EventBuilder::new(Kind::Custom(9), content)

Calls 1

connectFunction · 0.85

Tested by

no test coverage detected