use serenity::prelude::TypeMapKey; use sqlx::{ sqlite::{SqliteConnection, SqlitePool}, Error, Pool, }; use std::env; type DbPool = Pool; pub(crate) struct DbConnPool { pub pool: DbPool, } impl DbConnPool { pub async fn new() -> Result { Ok(Self { pool: SqlitePool::builder() .build(&env::var("DATABASE_URL").unwrap()) .await?, }) } } impl TypeMapKey for DbConnPool { type Value = Self; }