Skip to main content

dynamodb_execute_query

Function dynamodb_execute_query 

Source
pub async fn dynamodb_execute_query<TD: TableDefinition>(
    builder: QueryFluentBuilder,
) -> Result<Vec<Item<TD>>>
Expand description

Executes a DynamoDB Query request, collecting all pages into a Vec.

Automatically follows LastEvaluatedKey pagination tokens until all matching items have been retrieved. This is the low-level function used by QueryRequest::all. Prefer using DynamoDBItemOp::query or QueryRequest directly unless you are working with a raw QueryFluentBuilder.

§Errors

Returns Err if any DynamoDB page request fails.

§Examples

use dynamodb_facade::dynamodb_execute_query;

let builder = client
    .query()
    .table_name("platform")
    .key_condition_expression("PK = :pk")
    .expression_attribute_values(
        ":pk",
        aws_sdk_dynamodb::types::AttributeValue::S("USER#user-1".into()),
    );
let items = dynamodb_execute_query::<PlatformTable>(builder).await?;