Basic functions, Home and Community Tab
This commit is contained in:
10
src/backend/db.rs
Normal file
10
src/backend/db.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
#[cfg(feature = "ssr")]
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
pub async fn build_db_pool() -> SqlitePool {
|
||||
let database_url = "sqlite:community.db";
|
||||
let pool = SqlitePool::connect(database_url).await.expect("DB Fehler");
|
||||
sqlx::migrate!("./migrations").run(&pool).await.expect("Migration Fehler");
|
||||
pool
|
||||
}
|
||||
Reference in New Issue
Block a user