20 lines
548 B
Rust
20 lines
548 B
Rust
use std::{env, error::Error, fs};
|
|
|
|
use db::{DeploymentConfig, connect};
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), Box<dyn Error>> {
|
|
let config = match env::var_os("BEDROCK_DB_CONFIG") {
|
|
Some(path) => serde_json::from_slice::<DeploymentConfig>(&fs::read(path)?)?,
|
|
None => DeploymentConfig::default(),
|
|
};
|
|
let db = connect(&config).await?;
|
|
println!(
|
|
"Bedrock storage ready ({:?}, revision {}, read-only: {})",
|
|
db.driver(),
|
|
db.revision().await?,
|
|
db.is_read_only()
|
|
);
|
|
Ok(())
|
|
}
|