#serde #dynamodb #rusoto

bin+lib dynamodb_data

Serde based serialization support and misc utilities for working with Dynamodb via the rusoto_dynamodb crate

9 releases

✓ Uses Rust 2018 edition

0.1.8 Sep 23, 2019
0.1.7 Sep 21, 2019

#327 in Encoding

Download history 273/week @ 2019-12-08 9/week @ 2019-12-22 73/week @ 2020-01-12 25/week @ 2020-01-19 2/week @ 2020-01-26 9/week @ 2020-02-09 9/week @ 2020-02-16 37/week @ 2020-02-23 18/week @ 2020-03-08 10/week @ 2020-03-15 36/week @ 2020-03-22

197 downloads per month

MIT license

18KB
226 lines

Serde based serialization support and misc utilities for working with Dynamodb via the rusoto_dynamodb crate.

Features:

  • Automatically convert your types to/from rusoto_dynamodb data types VIA serde_json. This is an alternative to serde_dynamodb (which is mostly unimplemented).
  • Query/Conversion Macros

API Example:

use dynamodb_data::*;
use std::collections::HashMap;

let payload: HashMap<String, rusoto_dynamodb::AttributeValue> = fields!{
    id => ::uuid::Uuid::new_v4(),
    name => "user name",
    counter => 0
};
let get_item_query = rusoto_dynamodb::GetItemInput {
    key: fields!{
        id => ::uuid::Uuid::new_v4()
    },
    ..Default::default()
};

WARNING:

As we all know and love, DynamoDB rejects empty strings in favor of null without any metadata as to what the original type is… As a workaround I’m experimenting with encoding emptying strings VIA the ASCII null character (unless anyone has a better idea).

This should presumably be more robust than using e.g. the suggested idea here. I haven’t read about this anywhere so perhaps I’m the first to use such a workaround. If the null encoding causes issues I can add a feature to disable the default behavior.

Dependencies

~12MB
~259K SLoC