refactor: bootstrap crate, thin server/worker binaries
This commit is contained in:
@@ -75,6 +75,13 @@ pub async fn wire(database_url: &str) -> anyhow::Result<SqliteWireOutput> {
|
||||
.await
|
||||
.context("Failed to connect to SQLite database")?;
|
||||
|
||||
wire_pool(pool).await
|
||||
}
|
||||
|
||||
/// Migrates an already-connected pool and builds every repository on it.
|
||||
pub async fn wire_pool(pool: SqlitePool) -> anyhow::Result<SqliteWireOutput> {
|
||||
use anyhow::Context;
|
||||
|
||||
migrate(&pool)
|
||||
.await
|
||||
.map_err(|e| anyhow::anyhow!("{e}"))
|
||||
|
||||
Reference in New Issue
Block a user