Crate dynamodb_expression
source ·Expand description
A crate to help build DynamoDB condition, filter, key condition, and update expressions in a type-safe way.
Expression
is the type to use for a DynamoDB expression.
Path
represents a DynamoDB item attribute or document path, and has
many methods for building various expressions.
See the integration tests for querying and updating as a starting place.
An example showing a how to use this crate to perform a query:
use dynamodb_expression::{Expression, num_value, path::Path};
let client = aws_sdk_dynamodb::Client::new(&aws_config::load_from_env().await);
let query_output = Expression::builder()
.with_filter(
Path::name("name")
.attribute_exists()
.and(Path::name("age").greater_than_or_equal(num_value(2.5))),
)
.with_projection(["name", "age"])
.with_key_condition(Path::name("id").key().equal(num_value(42)))
.build()
.query(&client)
.table_name("your_table")
.send()
.await?;
Re-exports
pub use condition::Comparator;
pub use expression::Expression;
pub use path::Path;
pub use value::binary_set;
pub use value::binary_value;
pub use value::bool_value;
pub use value::null_value;
pub use value::num_set;
pub use value::num_value;
pub use value::ref_value;
pub use value::string_set;
pub use value::string_value;
pub use ::aws_sdk_dynamodb;
pub use ::num;
Modules
- Types related to DynamoDB update expressions. For more, see
Update
.