Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

⚡🦀 🧨 make your rust types fit DynamoDB and visa versa

License

NotificationsYou must be signed in to change notification settings

softprops/dynomite

Repository files navigation

🦀🧨

dynomite makes DynamoDB fit your types (and visa versa)


Overview

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.

📦 Install

In your Cargo.toml file, add the following under the[dependencies] heading

dynomite ="0.10"

🤸 Examples

You can find some example application code underdynomite/examples

DynamoDB local

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

Resources

Doug Tangren (softprops) 2018-2020

About

⚡🦀 🧨 make your rust types fit DynamoDB and visa versa

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

    Packages

    No packages published

    Contributors13

    Languages


    [8]ページ先頭

    ©2009-2025 Movatter.jp