mockersf / serde_dynamodb

Talk with dynamodb using your existing structs thanks to serde

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

serde_dynamodb License: MIT Release Doc Crate

Warning

This repository is archived as there is now an official SDK for dynamodb, which this crate doesn't use.

Library to de/serialize an object to an HashMap of AttributeValues used by rusoto_dynamodb to manipulate objects saved in dynamodb using serde

Example

#[derive(Serialize, Deserialize)]
struct Todo {
    id: uuid::Uuid,
    title: &'static str,
    done: bool,
}

let todo = Todo {
    id: uuid::Uuid::new_v4(),
    title: "publish crate",
    done: false,
};

let put_item = PutItemInput {
    item: serde_dynamodb::to_hashmap(&todo).unwrap(),
    table_name: "todos".to_string(),
    ..Default::default()
};

let client = DynamoDbClient::simple(Region::UsEast1);
client.put_item(&put_item).unwrap();

About

Talk with dynamodb using your existing structs thanks to serde

License:MIT License


Languages

Language:Rust 99.2%Language:Shell 0.8%