feat(dynamodb): support querying, editing, and exporting

This commit is contained in:
zipg authored and GitHub committed 2026-08-17 03:27:44 +08:00
1 parent 92ab9bb0dc
commit e97c9ab5d7
73 files changed
+4493 -134

No files matched your search

+11
View File
@@ -1105,6 +1105,12 @@ async fn test_connection_with_info_inner(
Err(native_err)
}
}
DatabaseType::DynamoDb => {
let client = db::dynamodb_driver::connect(&config, &host, port)?;
db::dynamodb_driver::test_connection(&client, connect_timeout)
.await
.map(|_| "Connection successful".to_string())
}
DatabaseType::ClickHouse => {
let username = if config.username.is_empty() { None } else { Some(config.username.clone()) };
let password = if config.password.is_empty() { None } else { Some(config.password.clone()) };
@@ -1518,6 +1524,11 @@ pub async fn connect_db(
}
}
}
DatabaseType::DynamoDb => {
let client = db::dynamodb_driver::connect(&db_config, &host, port)?;
db::dynamodb_driver::test_connection(&client, connect_timeout).await?;
PoolKind::DynamoDb(client)
}
DatabaseType::ClickHouse => {
let username = if db_config.username.is_empty() { None } else { Some(db_config.username.clone()) };
let password = if db_config.password.is_empty() { None } else { Some(db_config.password.clone()) };
+33
View File
@@ -58,6 +58,7 @@ pub async fn document_find_documents(
projection: Option<String>,
sort: Option<String>,
collation: Option<String>,
cursor: Option<String>,
execution_id: Option<String>,
) -> Result<DocumentQueryResult, String> {
let app = state.inner().clone();
@@ -75,11 +76,43 @@ pub async fn document_find_documents(
projection.as_deref(),
sort.as_deref(),
collation.as_deref(),
cursor.as_deref(),
),
)
.await
}
#[tauri::command]
pub async fn document_count_documents(
state: State<'_, Arc<AppState>>,
connection_id: String,
collection: String,
filter: Option<String>,
execution_id: Option<String>,
) -> Result<u64, String> {
let app = state.inner().clone();
run_cancellable(
&app,
execution_id,
dbx_core::document_ops::count_document_store_documents_core(
&app,
&connection_id,
&collection,
filter.as_deref(),
),
)
.await
}
#[tauri::command]
pub async fn dynamodb_describe_table(
state: State<'_, Arc<AppState>>,
connection_id: String,
table: String,
) -> Result<dbx_core::db::dynamodb_driver::DynamoDbTableDescription, String> {
dbx_core::document_ops::describe_dynamodb_table_core(&state, &connection_id, &table).await
}
#[tauri::command]
pub async fn elasticsearch_count_documents(
state: State<'_, Arc<AppState>>,
+1
View File
@@ -147,6 +147,7 @@ pub async fn mongo_find_documents(
projection,
sort,
collation,
None,
execution_id,
)
.await
+2
View File
@@ -2003,6 +2003,8 @@ pub fn run() {
commands::document_cmd::document_list_databases,
commands::document_cmd::document_list_collections,
commands::document_cmd::document_find_documents,
commands::document_cmd::document_count_documents,
commands::document_cmd::dynamodb_describe_table,
commands::document_cmd::elasticsearch_count_documents,
commands::document_cmd::document_list_gridfs_buckets,
commands::document_cmd::document_create_gridfs_bucket,