feat(dynamodb): support querying, editing, and exporting
This commit is contained in:
73 files changed
+4493
-134
No files matched your search
@@ -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()) };
|
||||
|
||||
@@ -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>>,
|
||||
|
||||
@@ -147,6 +147,7 @@ pub async fn mongo_find_documents(
|
||||
projection,
|
||||
sort,
|
||||
collation,
|
||||
None,
|
||||
execution_id,
|
||||
)
|
||||
.await
|
||||
|
||||
Reference in new issue
Block a user