Skip to content

fix: dynamo db ui query issues fix #206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src-tauri/src/dynamo/scan_table.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -185,10 +186,18 @@ pub async fn scan_table(client: &Client, input: ScanTableInput<'_>) -> Result<Ap
})),
})
}
Err(e) => 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,
})
}
}
}
4 changes: 2 additions & 2 deletions src/datasources/dynamoApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/views/editor/dynamo-editor/components/create-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
</script>

Expand Down
Loading