Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork52
⚡🦀 🧨 make your rust types fit DynamoDB and visa versa
License
softprops/dynomite
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
dynomite makes DynamoDB fit your types (and visa versa)
Goals
- ⚡ make writingdynamodb applications inrust a productive experience
- 🦀 exploit rust's type safety features
- 👩💻 leverage existing work of therusoto rust project
- ☔ commitment to supporting applications built using stable rust
- 📚 commitment to documentation
Features
- 💌 less boilerplate
- ♻️ automatic async pagination
- 🕶️ client level retry interfaces forrobust error handling
From this
use std::collections::HashMap;use rusoto_dynamodb::AttributeValue;use uuid::Uuid;letmut item =HashMap::new();item.insert("pk".to_string(),AttributeValue{s:Some(Uuid::new_v4().to_hyphenated().to_string()), ..AttributeValue::default()});item.insert(// 🤬typos anyone?"quanity".to_string(),AttributeValue{n:Some("whoops".to_string()), ..AttributeValue::default()});
To this
use dynomite::Item;use uuid::Uuid;#[derive(Item)]structOrder{#[dynomite(partition_key)]pk:Uuid,quantity:u16}let item =Order{pk:Uuid::new_v4(),quantity:4}.into();
Please see theAPI documentation for howto get started. Enjoy.
In your Cargo.toml file, add the following under the[dependencies]
heading
dynomite ="0.10"
You can find some example application code underdynomite/examples
AWS providesa convenient way to host a local instance of DynamoDB fortesting.
Here is a short example of how to get up a testing locally quickly with both dynomite as well asrusoto_dynamodb
.
In one terminal spin up a Docker container forDynamoDB local listening on port8000
$ docker run --rm -p 8000:8000 amazon/dynamodb-local
In another, run a rust binary with a client initialized like you see the thelocal.rs example
Doug Tangren (softprops) 2018-2020
About
⚡🦀 🧨 make your rust types fit DynamoDB and visa versa
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors13
Uh oh!
There was an error while loading.Please reload this page.