dynamodb-schema v0.3.3
dynamodb-schema
Dynamodb plugin to improve schema creation and manipulation, we can use as you can.
Social us:
A Typescript Node.js package that create schemas on dynamoDb.
Installation
First, install the package using npm:
npm install dynamo-schema --save
Getting Started
You will need to import the node module into your file:
import dynamodbSchema from 'dynamodb-schema';
Usage
schema
dynamodbSchema.schema([
{
name: 'tableName',
attributtes: [
{ name: 'columnKey', type: 'String' },
{ name: 'column2Key', type: 'String' }
],
keys: [
{ name: 'columnKey', type: 'HASH' },
{ name: 'column2Key', type: 'RANGE' }
],
throughput: {
read: 1,
write: 1
}
}
]);
createSchema
if you have been loaded informacion schema you only need to execute the following command to create schema.
dynamodbSchema.createSchema();
dropSchema
if you have been loaded informacion schema you only need to execute the following command to drop schema.
dynamodbSchema.dropSchema();
config
you can set config parameter into dynamodbSchema Object like the following example:
dynamodbSchema.config({
override?: Boolean,
preffix?: String,
subffix?: String,
schema: Array<Schema>,
});
override
override property could have been used it in order to set into dynamodb-schema object if you want to overried tables if exist or not.
preffix
you can use this property to assign schema preffix table, dynamodbSchema joins string before the table name into Schema object.
subffix
you can use this property to assign schema subffix table, dynamodbSchema joins string after the table name into Schema object.
schema
you can use this property to assign schema information to the dynamodbSchema object.
Data types schema support
Type | Dynamo Type |
---|---|
String | S |
Boolean | S |
Number | Number |
Array | Map |
Links
License
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago