diff options
| author | Fuwn <[email protected]> | 2021-03-25 22:20:21 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-03-25 22:20:21 +0000 |
| commit | 5fc28bfb2851441893ef2ad5f72e0feb8a0a22cc (patch) | |
| tree | f39b7bccc486298b1b7f4945cad37b4839817b73 /src/utils/db.rs | |
| parent | feature: Byte utilities (diff) | |
| download | whirl-5fc28bfb2851441893ef2ad5f72e0feb8a0a22cc.tar.xz whirl-5fc28bfb2851441893ef2ad5f72e0feb8a0a22cc.zip | |
major: Publish work-in-progress
Diffstat (limited to 'src/utils/db.rs')
| -rw-r--r-- | src/utils/db.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/utils/db.rs b/src/utils/db.rs index adc11d3..e6e1946 100644 --- a/src/utils/db.rs +++ b/src/utils/db.rs @@ -1,15 +1,16 @@ -use sqlx::sqlite::{SqlitePool, SqlitePoolOptions}; -use std::env; +use sqlx::sqlite::SqlitePoolOptions; +use std::error::Error; +use sqlx::SqlitePool; -pub async fn get_pool() -> Result<SqlitePool, Box<dyn std::error::Error>> { +pub async fn get_pool() -> Result<SqlitePool, Box<dyn Error>> { let pool = SqlitePoolOptions::new() .max_connections(20) - .connect(&env::var("DATABASE_URL")?) + .connect(&std::env::var("DATABASE_URL")?) .await?; debug!( "connected to database at url '{}'", - &env::var("DATABASE_URL")? + &std::env::var("DATABASE_URL")? ); Ok(pool) |