feat(cli): migrate CLI to native Rust binary
This commit is contained in:
1 parent
fa5579a3f1
commit
4bcf618162
47 files changed
+2369
-1255
No files matched your search
@@ -8,6 +8,18 @@ use serde::Deserialize;
|
||||
use crate::error::AppError;
|
||||
use crate::state::WebState;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct MongoParseShellCommandRequest {
|
||||
source: String,
|
||||
}
|
||||
|
||||
pub async fn parse_shell_command(
|
||||
Json(req): Json<MongoParseShellCommandRequest>,
|
||||
) -> Result<Json<dbx_core::mongo_shell::MongoCommand>, AppError> {
|
||||
dbx_core::mongo_shell::parse(&req.source).map(Json).map_err(AppError)
|
||||
}
|
||||
|
||||
async fn run_cancellable<T, F>(state: &Arc<WebState>, execution_id: Option<String>, future: F) -> Result<T, AppError>
|
||||
where
|
||||
F: Future<Output = Result<T, String>>,
|
||||
|
||||
Reference in new issue
Block a user