cdf97fcb96
Co-authored-by: Steve Fan <29133953+stevefan1999-personal@users.noreply.github.com>
25 lines
597 B
Rust
25 lines
597 B
Rust
use crate::cli::abstraction::DatabaseConnectionArguments;
|
|
use crate::err::Error;
|
|
use clap::Args;
|
|
use surrealdb::engine::any::connect;
|
|
|
|
#[derive(Args, Debug)]
|
|
pub struct IsReadyCommandArguments {
|
|
#[command(flatten)]
|
|
conn: DatabaseConnectionArguments,
|
|
}
|
|
|
|
pub async fn init(
|
|
IsReadyCommandArguments {
|
|
conn: DatabaseConnectionArguments {
|
|
endpoint,
|
|
},
|
|
}: IsReadyCommandArguments,
|
|
) -> Result<(), Error> {
|
|
// Initialize opentelemetry and logging
|
|
crate::o11y::builder().with_log_level("error").init();
|
|
// Connect to the database engine
|
|
connect(endpoint).await?;
|
|
println!("OK");
|
|
Ok(())
|
|
}
|