This commit is contained in:
+18
-2
@@ -1,3 +1,19 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use std::{env, error::Error, fs};
|
||||
|
||||
use db_connection::{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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user