#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

#421 in Database interfaces

Download history 12/week @ 2023-12-18 84/week @ 2024-01-08 144/week @ 2024-01-15 87/week @ 2024-01-22 116/week @ 2024-01-29 4/week @ 2024-02-05 178/week @ 2024-02-12 272/week @ 2024-02-19 280/week @ 2024-02-26 143/week @ 2024-03-04 186/week @ 2024-03-11 32/week @ 2024-03-18 123/week @ 2024-03-25 528/week @ 2024-04-01

871 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

~17MB
~273K SLoC