mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(dynamodb): use the AWS wording when Query or Scan rejects AttributesToGet with a Select (#5599)
* fix(dynamodb): use the AWS wording when Query or Scan rejects AttributesToGet with a Select * refactor(dynamodb): share the Select conflict check for ProjectionExpression and AttributesToGet
This commit is contained in:
1 parent
ddc0e0257b
commit
dd0f40fcbb
2 files changed
+34
-8
No files matched your search
+24
@@ -1159,6 +1159,30 @@ class NativeDynamoDbJsonHandlerTest {
|
||||
+ "when Querying using an IndexName", allProjected.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void scanNamesTheSelectWhenRejectingAttributesToGet() {
|
||||
createUsersTable("eu-west-1");
|
||||
|
||||
AwsException ex = expectValidationException("Scan", json("""
|
||||
{"TableName": "Users", "Select": "COUNT", "AttributesToGet": ["userId"]}
|
||||
"""));
|
||||
assertEquals("1 validation error detected: Cannot specify the AttributesToGet "
|
||||
+ "when choosing to get only the Count", ex.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void queryReportsTheAttributesToGetConflictBeforeTheMissingIndex() {
|
||||
createUsersTable("eu-west-1");
|
||||
|
||||
AwsException ex = expectValidationException("Query", json("""
|
||||
{"TableName": "Users",
|
||||
"KeyConditions": {"userId": {"ComparisonOperator": "EQ", "AttributeValueList": [{"S": "a"}]}},
|
||||
"Select": "ALL_PROJECTED_ATTRIBUTES", "AttributesToGet": ["userId"]}
|
||||
"""));
|
||||
assertEquals("1 validation error detected: Cannot specify the AttributesToGet "
|
||||
+ "when choosing to get ALL_PROJECTED_ATTRIBUTES", ex.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void scanAcceptsSegmentsAtTheBounds() throws Exception {
|
||||
createUsersTable("eu-west-1");
|
||||
|
||||
Reference in new issue
Block a user