INNER CODE UNIT · Rust
run_cli
gluesql/glues · server/src/lib.rs:117
pub async fn run_cli() -> Result<()> {
run(parse_args()).await
}
async fn build_backend(storage: StorageCommand) -> Result<Box<dyn CoreBackend + Send>> {
let backend: Box<dyn CoreBackend + Send> = match storage {
StorageCommand::Memory => Box::new(Db::memory().await?),
StorageCommand::File { path } => Box::new(Db::file(&path).await?),
StorageCommand::Redb { path } => Box::new(Db::redb(&path).await?),
StorageCommand::Git {
path,
remote,
branch,
} => Box::new(Db::git(&path, remote, branch).await?),
StorageCommand::Mongo { conn_str, db_name } => {
Box::new(Db::mongo(&conn_str, &db_name).await?)
}
};