diff --git a/src-tauri/src/dynamo/scan_table.rs b/src-tauri/src/dynamo/scan_table.rs index aac06f0..5542d35 100644 --- a/src-tauri/src/dynamo/scan_table.rs +++ b/src-tauri/src/dynamo/scan_table.rs @@ -1,4 +1,5 @@ use crate::dynamo::types::ApiResponse; +use aws_sdk_dynamodb::error::ProvideErrorMetadata; use aws_sdk_dynamodb::types::AttributeValue; use aws_sdk_dynamodb::Client; use serde_json::{json, Value}; @@ -185,10 +186,18 @@ pub async fn scan_table(client: &Client, input: ScanTableInput<'_>) -> Result Ok(ApiResponse { - status: 500, - message: format!("Failed to execute scan: {:?}", e), - data: None, - }), + Err(e) => { + let error_code = e.code().unwrap_or("UnknownError").to_string(); + let error_message = e.message().unwrap_or("UnknownError").to_string(); + + Ok(ApiResponse { + status: 500, + message: format!( + "Failed to execute scan!\n\nerrorCode: {}\nmessage: {}", + error_code, error_message + ), + data: None, + }) + } } } diff --git a/src/datasources/dynamoApi.ts b/src/datasources/dynamoApi.ts index 8cfc5a1..9bfb316 100644 --- a/src/datasources/dynamoApi.ts +++ b/src/datasources/dynamoApi.ts @@ -65,10 +65,10 @@ export type DynamoDBTableInfo = { export type QueryParams = { tableName: string; - indexName: string; + indexName: string | null; partitionKey: { name: string; - value: string; + value: string | null; }; sortKey?: { name: string; diff --git a/src/views/editor/dynamo-editor/components/create-item.vue b/src/views/editor/dynamo-editor/components/create-item.vue index 38b7696..85bd2e7 100644 --- a/src/views/editor/dynamo-editor/components/create-item.vue +++ b/src/views/editor/dynamo-editor/components/create-item.vue @@ -391,7 +391,6 @@ fetchIndices(activeConnection.value as Connection).then(() => { type: attributeType, })) .filter(({ key }) => ![partitionKey.name, sortKey?.name].filter(Boolean).includes(key)); - console.log('keyAttributes', dynamoRecordForm.value.keyAttributes); }); diff --git a/src/views/editor/dynamo-editor/components/ui-editor.vue b/src/views/editor/dynamo-editor/components/ui-editor.vue index 7214635..b3d8b2b 100644 --- a/src/views/editor/dynamo-editor/components/ui-editor.vue +++ b/src/views/editor/dynamo-editor/components/ui-editor.vue @@ -1,154 +1,177 @@