Created
September 27, 2021 16:21
-
-
Save mike820324/91086d2c6761a128408a751ce8329384 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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