entity-schema-dynamodb
entity-schema-dynamodb utilizes entitys-schema to wrap the DynamoDB class in the AWS SDK allowing you to easily manage DynamoDB tables from an entity schema.
Installation
yarn add entity-schema-dynamodb
or npm i --save entity-schema-dynamodb
Usage
Create/Delete a table
const Table = ;const rawSchema = ;const personTable = // table name 'person' // raw schema json rawSchema // configuration // The sort key is also called a "RANGE" key by the AWS API. It makes up the // primary key on your table in combination with the "HASH" key which will // always be "id" in your entity schema. sortKey: 'age' // Configuration for entity-schema. schemaConfig: deref: baseFolder: "./schema" // AWS configuration. Unless overridden here, AWS will use your active AWS // CLI credentials profile. awsConfig: region: 'us-east-2' ; // Create a table.personTable ; // Delete a table.personTable ;