Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Feature Tests

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
featureTests:
name: FeatureTests
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Create dynamo db for tests
run: docker compose -f ./dynamo-feature-tests.yml up -d

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Run Cucumber Tests
run: npm run test:features
31 changes: 31 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Quality

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
quality:
name: Quality
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install

- name: Prettier
run: npm run prettier:check

- name: Eslint
run: npm run eslint
7 changes: 4 additions & 3 deletions .github/workflows/ut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ on:
branches: [master]

jobs:
build:
tests:
name: Tests
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -24,7 +25,7 @@ jobs:
run: npm install
- name: Run Unit Tests
run: npm test
- run: npm run coverage
- run: npm run test:coverage

- name: Coveralls
uses: coverallsapp/github-action@master
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@

![Unit Tests](https://github.com/monolithst/functional-models-orm-dynamo/actions/workflows/ut.yml/badge.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/monolithst/functional-models-orm-dynamo/badge.svg?branch=master)](https://coveralls.io/github/monolithst/functional-models-orm-dynamo?branch=master)
Provides an functional-models-orm datastore provider for AWS Dynamo.
Provides an functional-models datastore adapter for AWS Dynamo.

# Important Notes - Don't Skip

Dynamodb is great for the one thing that its good at (being a key->value store). But any searching is a bad idea.

While this datastore adapter absolutely 100% works and works well in production (from years of experience), it should never ever
be used for searching in production. This isn't a limitation of the adapter, it's a limitation of the datastore itself.

Our implementation of `search` is deliberately unoptimized and will indeed pull the entire database across the wire one section at a time.

`save`, `retrieve`, `bulkInsert`, `delete` work great, but `search` should only be used for <i>limited</i> development purposes.

You have been warned.

## AWS SDK 3.0

Expand Down
36 changes: 36 additions & 0 deletions dynamo-feature-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: '3'

services:
dynamodb-local:
command: '-jar DynamoDBLocal.jar -sharedDb -dbPath ./data'
image: 'amazon/dynamodb-local:latest'
user: root
ports:
- '42514:8000'
volumes:
- './docker/dynamodb:/home/dynamodblocal/data'
working_dir: /home/dynamodblocal
healthcheck:
test:
[
'CMD-SHELL',
'[ "$(curl -s -o /dev/null -I -w ''%{http_code}'' http://localhost:8000)" == "400" ]',
]
interval: 10s
timeout: 10s
retries: 10
dynamodb-local-setup:
container_name: dynamodb-local-setup
depends_on:
dynamodb-local:
condition: service_healthy
image: amazon/aws-cli
volumes:
- './features/schemas:/tmp/dynamo'
environment:
AWS_ACCESS_KEY_ID: 'FAKEID'
AWS_SECRET_ACCESS_KEY: 'FAKEKEY'
AWS_REGION: 'us-east-1'
entrypoint:
- bash
command: '-c "for f in /tmp/dynamo/*.json; do aws dynamodb create-table --endpoint-url "http://dynamodb-local:8000" --cli-input-json file://"$${f#./}"; done"'
Loading