2023-03-07 09:53:56 +00:00
|
|
|
use crate::err::Error;
|
|
|
|
use surrealdb::engine::any::connect;
|
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
pub async fn init(matches: &clap::ArgMatches) -> Result<(), Error> {
|
2023-03-29 18:16:18 +00:00
|
|
|
// Initialize opentelemetry and logging
|
|
|
|
crate::o11y::builder().with_log_level("error").init();
|
2023-03-07 09:53:56 +00:00
|
|
|
// Parse all other cli arguments
|
|
|
|
let endpoint = matches.value_of("conn").unwrap();
|
|
|
|
// Connect to the database engine
|
2023-04-24 09:50:03 +00:00
|
|
|
connect(endpoint).await?;
|
2023-03-07 09:53:56 +00:00
|
|
|
println!("OK");
|
|
|
|
Ok(())
|
|
|
|
}
|