#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

#477 in Database interfaces

Download history 119/week @ 2024-01-23 84/week @ 2024-01-30 19/week @ 2024-02-06 186/week @ 2024-02-13 312/week @ 2024-02-20 274/week @ 2024-02-27 100/week @ 2024-03-05 182/week @ 2024-03-12 41/week @ 2024-03-19 174/week @ 2024-03-26 141/week @ 2024-04-02 227/week @ 2024-04-09 24/week @ 2024-04-16 97/week @ 2024-04-23 124/week @ 2024-04-30 18/week @ 2024-05-07

289 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
~276K SLoC