Code Monkey home page Code Monkey logo

meteor's Introduction

meteor

build Download

A Scala wrapper for AWS SDK 2 DynamoDB library using cats effect and fs2.

Install

Add Bintray resolver:

resolvers += Resolver.bintrayRepo("d2a4u", "meteor")

Add the following to your build.sbt, see the badge above for latest version. Supports Scala 2.12 and 2.13.

libraryDependencies += "meteor" %% "meteor-awssdk" % "LATEST_VERSION"
libraryDependencies += "meteor" %% "meteor-scanamo" % "LATEST_VERSION"

Usage and Examples

Codec

The library provides codec for some primitives out of the box: String, UUID, Boolean, Long, Int, Instant, Option[A] and Map[String, A].

Encoder

def write(a: A): AttributeValue

A type class defines how to encode type A to a Java AttributeValue.

Decoder

def read(av: AttributeValue): Either[DecoderFailure, A]

A type class defines how to decode a Java AttributeValue to either a DecoderFailure or a value of type A.

API

The library supports the following DynamoDB's API:

  • Get
  • Query
  • Put
  • Update
  • Delete
  • Scan (use fs2 Stream to scan table)
  • Batch Update
  • Batch Delete

Usage

Please see integration tests for more usage example.

Modules

  • awssdk the main module for DynamoDB client
  • scanamo module which provides auto conversion to and from Scanamo's DynamoFormat and meteor's Encoder/Decoder

Note: meteor uses Scanamo's version 1.0.0-M11 instead of latest because in my experience, this is the most stable version. However, because it is an older version when DynamoDB's did not support empty String, this version of Scanamo serializes these cases: "", None and Some("") to Dynamo's NULL. This is problematic because once the value is written down, reading it back is difficult.

Credit

The project is inspired by comms-deduplication project. Thanks @filosganga for his contribution and permission to use his code in this project.

meteor's People

Contributors

d2a4u avatar filosganga avatar keirlawson avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.