docbox_management/database.rs
1use docbox_database::{DbPool, DbResult};
2
3/// Provider to get database access for the management tool
4///
5/// Expects that the access granted to the database is sufficient
6/// for creation and deletion of tables
7pub trait DatabaseProvider: Send + Sync + 'static {
8 /// Connect to the provided `database` providing back a [DbPool]
9 fn connect(&self, database: &str) -> impl Future<Output = DbResult<DbPool>> + Send;
10}