Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial working version of dynamodb driver
- Loading branch information
1 parent
d1ea78d
commit 6cad955
Showing
7 changed files
with
99 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
import { Driver } from "./DriverTypes"; | ||
|
||
type DriverBuilder = <T>( | ||
params: T, | ||
logger: (message: string) => void | ||
) => Driver; | ||
type DriverBuilder<T> = (params: T, logger: (message: string) => void) => Driver; | ||
|
||
export default DriverBuilder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import Driver from "./Driver"; | ||
import { Observable } from "rxjs"; | ||
|
||
export default interface RDS extends Driver { | ||
query: <T>(query: string, params: Array<any>) => Promise<Array<T>>; | ||
query<T>(query: string, params: Array<any>): Observable<T>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Welcome to dm-driver-dynamodb 👋 | ||
|
||
[![Build Status](https://travis-ci.org/theBenForce/data-migration.svg?branch=master)](https://travis-ci.org/theBenForce/data-migration) | ||
[![NPM Package](https://img.shields.io/npm/v/dm-driver-dynamodb)](https://www.npmjs.com/package/dm-driver-dynamodb) | ||
[![Maintainability](https://api.codeclimate.com/v1/badges/89a0c1976c9b89979635/maintainability)](https://codeclimate.com/github/theBenForce/data-migration/maintainability) | ||
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/) | ||
|
||
> A [Data Migration](https://www.npmjs.com/package/data-migration) driver to load/create DynamoDB entries. | ||
# Configuration | ||
|
||
## Parameters | ||
|
||
The DynamoDB driver accepts the following parameters as part of its configuration: | ||
|
||
| Name | Type | Required | Description | | ||
| --------------- | ------ | -------- | -------------------------------------------------------------------------------------- | | ||
| region | string | Yes | The AWS Region where this table exists | | ||
| TableName | string | Yes | The name of the DynamoDB table to connect to | | ||
| accessKeyId | string | No | AWS Credentials, if not provided data-migration will use the default AWS configuration | | ||
| secretAccessKey | string | No | | ||
|
||
## Sample Configuration | ||
|
||
```javascript | ||
module.exports = { | ||
defaultStage: "prod", | ||
migrationDirectory: "migrations", | ||
stages: { | ||
prod: { | ||
users: { | ||
driver: require("dm-driver-dynamodb"), | ||
params: { | ||
region: "us-east-1", | ||
TableName: { | ||
// Use this processor to get values from CloudFormation | ||
processor: require("dm-processor-cf"), | ||
params: { | ||
stack: "some-stack-name", | ||
output: "SomeOutputName", | ||
region: "us-east-1", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; | ||
``` |