feat(mongo): add collection clone
This commit is contained in:
1 parent
e80942de17
commit
5fe3b5b435
34 files changed
+1217
-21
No files matched your search
@@ -98,6 +98,25 @@ pub async fn mongo_rename_collection(
|
||||
dbx_core::mongo_ops::mongo_rename_collection_core(&state, &connection_id, &database, &collection, &new_name).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn mongo_clone_collection(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
database: String,
|
||||
source_collection: String,
|
||||
target_collection: String,
|
||||
) -> Result<dbx_core::db::mongo_driver::MongoCloneCollectionResult, String> {
|
||||
ensure_connection_writable(&state, &connection_id, "Clone collection").await?;
|
||||
dbx_core::mongo_ops::mongo_clone_collection_core(
|
||||
&state,
|
||||
&connection_id,
|
||||
&database,
|
||||
&source_collection,
|
||||
&target_collection,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn mongo_find_documents(
|
||||
|
||||
@@ -1869,6 +1869,7 @@ pub fn run() {
|
||||
commands::mongo_cmd::mongo_drop_database,
|
||||
commands::mongo_cmd::mongo_drop_collection,
|
||||
commands::mongo_cmd::mongo_rename_collection,
|
||||
commands::mongo_cmd::mongo_clone_collection,
|
||||
commands::docs::docs_collect_snapshot,
|
||||
commands::docs::docs_load_annotations,
|
||||
commands::docs::docs_apply_annotations,
|
||||
|
||||
Reference in new issue
Block a user