Skip to content

Instantly share code, notes, and snippets.

@mike820324
Created September 27, 2021 16:21
Show Gist options
  • Save mike820324/91086d2c6761a128408a751ce8329384 to your computer and use it in GitHub Desktop.
Save mike820324/91086d2c6761a128408a751ce8329384 to your computer and use it in GitHub Desktop.
pub type DbPool = sqlx::postgres::PgPool;
pub async fn connection_builder() -> Result<DbPool, sqlx::Error> {
let connectspec = dotenv::var("DATABASE_URL").unwrap();
sqlx::postgres::PgPool::connect(&connectspec).await
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment