#dynamo-db #expression #aws-sdk

dynamodb-expression

Types to build DynamoDB filter, condition, or update expressions

18 releases

0.2.0-beta.9 Jan 26, 2024
0.2.0-beta.8 Jan 17, 2024
0.2.0-beta.3 Dec 19, 2023
0.2.0-beta.2 Nov 28, 2023
0.1.0 Aug 18, 2023

#959 in Database interfaces

Download history 236/week @ 2024-06-17 180/week @ 2024-06-24 95/week @ 2024-07-01 200/week @ 2024-07-08 83/week @ 2024-07-15 260/week @ 2024-07-22 41/week @ 2024-07-29 133/week @ 2024-08-05 321/week @ 2024-08-12 53/week @ 2024-08-19 86/week @ 2024-08-26 22/week @ 2024-09-02 14/week @ 2024-09-09 19/week @ 2024-09-23 68/week @ 2024-09-30

101 downloads per month

Apache-2.0

320KB
5.5K SLoC

dynamodb-expression

A Rust crate to help build DynamoDB condition, filter, key condition, and update expressions in a type-safe way, including using expression attribute names and expression attribute values.

Crates.io Docs.rs

An example showing a how to use this crate to perform a query:

use aws_config::BehaviorVersion;
use aws_sdk_dynamodb::Client;
use dynamodb_expression::{Expression, Num, Path};

let client = Client::new(&aws_config::load_defaults(BehaviorVersion::latest()).await);

let query_output = Expression::builder()
    .with_filter(
        "name"
            .parse::<Path>()?
            .attribute_exists()
            .and("age".parse::<Path>()?.greater_than_or_equal(Num::new(2.5))),
    )
    .with_projection(["name", "age"])
    .with_key_condition("id".parse::<Path>()?.key().equal(Num::new(42)))
    .build()
    .query(&client)
    .table_name("people")
    .send()
    .await?;

For more, see the docs.

Dependencies

~15–22MB
~285K SLoC