feat(vector): support renaming Milvus collections
This commit is contained in:
1 parent
4b75334164
commit
52c892676c
16 files changed
+461
-102
No files matched your search
@@ -56,6 +56,7 @@ pub mod transfer;
|
||||
pub mod tunnel_profiles;
|
||||
pub mod update;
|
||||
mod update_portable;
|
||||
pub mod vector_cmd;
|
||||
pub mod window_controls;
|
||||
pub mod xlsx_export;
|
||||
pub mod zookeeper_cmd;
|
||||
@@ -45,16 +45,6 @@ pub async fn mongo_list_collections(
|
||||
dbx_core::mongo_ops::mongo_list_collections_core(&state, &connection_id, &database).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn vector_collection_detail(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
database: String,
|
||||
collection: String,
|
||||
) -> Result<dbx_core::db::vector_driver::CollectionInfo, String> {
|
||||
dbx_core::schema::get_vector_collection_detail_core(&state, &connection_id, &database, &collection).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn mongo_create_database(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
@@ -86,27 +76,6 @@ pub async fn mongo_drop_collection(
|
||||
dbx_core::mongo_ops::mongo_drop_collection_core(&state, &connection_id, &database, &collection).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn vector_drop_database(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
database: String,
|
||||
) -> Result<(), String> {
|
||||
ensure_connection_writable(&state, &connection_id, "Drop database").await?;
|
||||
dbx_core::schema::drop_vector_database_core(&state, &connection_id, &database).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn vector_drop_collection(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
database: String,
|
||||
collection: String,
|
||||
) -> Result<(), String> {
|
||||
ensure_connection_writable(&state, &connection_id, "Drop collection").await?;
|
||||
dbx_core::schema::drop_vector_collection_core(&state, &connection_id, &database, &collection).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn mongo_rename_collection(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use tauri::State;
|
||||
|
||||
use crate::commands::connection::{ensure_connection_writable, AppState};
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn vector_collection_detail(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
database: String,
|
||||
collection: String,
|
||||
) -> Result<dbx_core::db::vector_driver::CollectionInfo, String> {
|
||||
dbx_core::schema::get_vector_collection_detail_core(&state, &connection_id, &database, &collection).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn vector_drop_database(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
database: String,
|
||||
) -> Result<(), String> {
|
||||
ensure_connection_writable(&state, &connection_id, "Drop database").await?;
|
||||
dbx_core::schema::drop_vector_database_core(&state, &connection_id, &database).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn vector_drop_collection(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
database: String,
|
||||
collection: String,
|
||||
) -> Result<(), String> {
|
||||
ensure_connection_writable(&state, &connection_id, "Drop collection").await?;
|
||||
dbx_core::schema::drop_vector_collection_core(&state, &connection_id, &database, &collection).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn vector_rename_collection(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
database: String,
|
||||
collection: String,
|
||||
new_name: String,
|
||||
) -> Result<(), String> {
|
||||
ensure_connection_writable(&state, &connection_id, "Rename collection").await?;
|
||||
dbx_core::schema::rename_vector_collection_core(&state, &connection_id, &database, &collection, &new_name).await
|
||||
}
|
||||
@@ -2012,12 +2012,13 @@ pub fn run() {
|
||||
commands::sqlite_backup::backup_sqlite_database,
|
||||
commands::mongo_cmd::mongo_list_databases,
|
||||
commands::mongo_cmd::mongo_list_collections,
|
||||
commands::mongo_cmd::vector_collection_detail,
|
||||
commands::vector_cmd::vector_collection_detail,
|
||||
commands::mongo_cmd::mongo_create_database,
|
||||
commands::mongo_cmd::mongo_drop_database,
|
||||
commands::mongo_cmd::mongo_drop_collection,
|
||||
commands::mongo_cmd::vector_drop_database,
|
||||
commands::mongo_cmd::vector_drop_collection,
|
||||
commands::vector_cmd::vector_drop_database,
|
||||
commands::vector_cmd::vector_drop_collection,
|
||||
commands::vector_cmd::vector_rename_collection,
|
||||
commands::mongo_cmd::mongo_rename_collection,
|
||||
commands::mongo_cmd::mongo_clone_collection,
|
||||
commands::docs::docs_collect_snapshot,
|
||||
|
||||
Reference in new issue
Block a user