All Projects → truora → minidyn

truora / minidyn

Licence: MIT license
A go library for testing Amazon DynamoDB.

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to minidyn

aiodynamo
Asynchronous, fast, pythonic DynamoDB Client
Stars: ✭ 51 (+131.82%)
Mutual labels:  dynamodb
dynamolock
DynamoDB Lock Client for Go
Stars: ✭ 100 (+354.55%)
Mutual labels:  dynamodb
aws-certified-developer-associate-udemy-notes
AWS Certified Developer Associate Udemy Notes
Stars: ✭ 20 (-9.09%)
Mutual labels:  dynamodb
amazon-ivs-ugc-web-demo
This repository shows how you can build a compelling user-generated content (UGC) live streaming webapp with Amazon IVS.
Stars: ✭ 14 (-36.36%)
Mutual labels:  dynamodb
dynocsv
Exports DynamoDB table into CSV
Stars: ✭ 34 (+54.55%)
Mutual labels:  dynamodb
dynamodb-onetable
DynamoDB access and management for one table designs with NodeJS
Stars: ✭ 508 (+2209.09%)
Mutual labels:  dynamodb
serde dynamodb
Talk with dynamodb using your existing structs thanks to serde
Stars: ✭ 28 (+27.27%)
Mutual labels:  dynamodb
dynamo-node
DynamoDB mapper
Stars: ✭ 12 (-45.45%)
Mutual labels:  dynamodb
parser
arc.app, .arc, arc.json, arc.yaml, and arc.toml support
Stars: ✭ 20 (-9.09%)
Mutual labels:  dynamodb
aws-serverless-prototype
Serverless Frameworkを使ったAWS Lambdaプロジェクトの試作品
Stars: ✭ 16 (-27.27%)
Mutual labels:  dynamodb
serverless-websockets-chat
Realtime chat app based on AWS Lambda, API Gateway, DynamoDB, Websockets, React in TS
Stars: ✭ 19 (-13.64%)
Mutual labels:  dynamodb
graphql-ttl-transformer
♻ Enable DynamoDB's time-to-live feature to auto-delete old entries in your AWS Amplify API!
Stars: ✭ 75 (+240.91%)
Mutual labels:  dynamodb
lockbot
🔒 Coordinate use of your team's shared resources, in Slack 🤝
Stars: ✭ 47 (+113.64%)
Mutual labels:  dynamodb
jarvis-workshop
Amazon re:Invent workshop - "Alexa, Ask Jarvis to Create a Serverless App for Me" -
Stars: ✭ 14 (-36.36%)
Mutual labels:  dynamodb
photo-sharing-website
Static pre-rendered photo-sharing website
Stars: ✭ 33 (+50%)
Mutual labels:  dynamodb
akka-persistence-dynamodb
DynamoDBJournal for Akka Persistence
Stars: ✭ 85 (+286.36%)
Mutual labels:  dynamodb
sam-python-crud-sample
This project is an example about lambda, SAM, dynamodb. This repository contains source code and supporting files for a serverless application that you can deploy with the SAM CLI. It includes the following files and folders.
Stars: ✭ 71 (+222.73%)
Mutual labels:  dynamodb
aiohttp-client-cache
An async persistent cache for aiohttp requests
Stars: ✭ 63 (+186.36%)
Mutual labels:  dynamodb
laravel-dynamodb-session-driver
DynamoDB Session Driver for Laravel 5
Stars: ✭ 15 (-31.82%)
Mutual labels:  dynamodb
data
[deprecated] Generate a DynamoDB data access layer from an .arc file. Automatically disambiguates testing (in memory) from deployment staging and production tables
Stars: ✭ 20 (-9.09%)
Mutual labels:  dynamodb

minidyn

Amazon DynamoDB testing library written in Go.

Goals

  • Make local testing for DynamoDB as accurate as possible.
  • Run DynamoDB tests in a CI without external dependencies.
  • Identify errors caused by DynamoDB restrictions.

Usage

Create the dynamodb client:

client := minidyn.NewClient()

Define the tables and indexes schemas,you can use the SDKs methods to create tables.

client.CreateTable(&dynamodb.CreateTableInput{
  TableName: aws.String("pokemons"),
  AttributeDefinitions: []*dynamodb.AttributeDefinition{
    {
      AttributeName: aws.String("id"),
      AttributeType: aws.String("S"),
    },
  },
  BillingMode: aws.String("PAY_PER_REQUEST"),
  KeySchema: []*dynamodb.KeySchemaElement{
    {
      AttributeName: aws.String("id"),
      KeyType:       aws.String("HASH"),
    },
  },
})

Or you can use the AddTable and AddIndex method helper.

err := client.AddTable("pokemons", "id", "primary_type")
if err != nil {
  return err
}

err = client.AddIndex("pokemons", "type_index", "primary_type", "")
if err != nil {
  return err
}

NOTE these methods only support string attributes.

Language interpreter

This library has an interpreter implementation for the DynamoDB Expressions.

Conditional Expressions

Types

Name Type Short Supported?
Number scalar N y
String scalar S y
Binary scalar B y
Bool scalar BOOL y
Null scalar NULL y
List document L y
Map document M y
StringSet set SS y
NumberSet set NS y
BinarySet set BS y

Expressions

Syntax Supported?
operand comparator operand = <> < <= > and >= y
operand BETWEEN operand AND operand N,S,B y
operand IN ( operand (',' operand (, ...) )) y
function attribute_exists, attribute_not_exists, attribute_type, begins_with, contains, size y
condition AND condition y
condition OR condition y
NOT condition y

Update Expressions

Expressions

Syntax Supported?
SET SET action [, action] ... y
REMOVE REMOVE action [, action] ... y
ADD ADD action [, action] ... y
DELETE DELETE action [, action] ... y
function list_append, if_not_exists y

What to do when the interpreter does not work properly?

When it happens you can override the intepretation using like this:

client.ActivateNativeInterpreter()

client.GetNativeInterpreter().AddUpdater(table, "SET secondary_type = :secondary_type", func(item map[string]*dynamodb.AttributeValue, updates map[string]*dynamodb.AttributeValue) {
   item["secondary_type"] = updates[":secondary_type"]
})

Note: Please, report us the issue with the interpreter through https://github.com/truora/minidyn/issues

License

The MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].