AwsDynamoDB

AwsDynamoDB

new AwsDynamoDB()

AwsDynamoDB class.

Source:

Methods

(static) connect(opts) → {undefined}

Connect to the AWS. This connection will be set to the statement instances which this module will provides.

Source:
Parameters:
Name Type Description
opts object

The object specifying destination to connect such as { accessKeyId: 'AKID', secretAccessKey: 'SECRET', region: 'us-west-2' }. If this is omitted, the keys in local environment stored at '~/.aws/' is used.

Returns:
Type:
undefined

(static) DeleteItemStatement(sql) → {DynamoDbDeleteItemStatement}

create DynamoDbDeleteItemStatement.

SQL-ish Syntax:

DELETE FROM <table-name>
[WHERE <key-condition-expression>]
  • [] is representing that can be ommited.
  • <table-name> - DynamoDB table name.
  • <key-condition-expression> - Primary key conditional expression.
Source:
Parameters:
Name Type Description
sql string

SQL-ish statement

Returns:
Type:
DynamoDbDeleteItemStatement

SQL-ish DeleteItem statement object

(static) describeTable(tableName, callback) → {undefined}

Describe a table definition

Source:
Parameters:
Name Type Description
tableName string

Tabale name described

callback function

callback to receive result.

Returns:
Type:
undefined

(static) listTables(callback) → {undefined}

DynamoDB.listTables

Source:
Parameters:
Name Type Description
callback function

Callback function

Returns:
Type:
undefined

(static) PutItemStatement(sql) → {DynamoDbPutItemStatement}

create DynamoDbPutItemStatement.

SQL-ish Syntax:

INSERT INTO <table-name> ( <attribute-list> )
VALUES ( <value-list> )
[WHERE <key-condition-expression>]
  • [] is representing that can be ommited.
  • <table-name> - DynamoDB table name.
  • <attribute-list> - The comma separated attribute names.
  • <values-list> - The comma separated attribute values.
  • <key-condition-expression> - Primary key conditional expression.
Source:
Parameters:
Name Type Description
sql string

SQL-ish statement

Returns:
Type:
DynamoDbPutItemStatement

SQL-ish PutItem statement object

(static) QueryStatement(sql) → {DynamoDbQueryStatement}

create DynamoDbQueryStatement.

SQL-ish Syntax:

[SELECT <projection-expression>]
FROM <table-name>
WHERE <key-condition-expression>
[FILTER <filter-expression>]
[LIMIT <limit>]
  • [] is representing that can be ommited.
  • <projection-expression> - The comma separated attribute names to select.
  • <table-name> - DynamoDB table name.
  • <key-condition-expression> - Primary key conditional expression.
  • <filter-expression> - Filtering conditional expression.
  • <limit> - The number of items to scan.
Source:
Parameters:
Name Type Description
sql string

SQL-ish statement

Returns:
Type:
DynamoDbQueryStatement

SQL-ish Query statement object

(static) ScanStatement(sql) → {DynamoDbScanStatement}

create DynamoDbScanStatement.

SQL-ish Syntax:

[SELECT <projection-expression>]
FROM <table-name>
[WHERE <filter-expression>]
[LIMIT <limit>]
  • [] is representing that can be ommited.
  • <projection-expression> - The comma separated attribute names to select.
  • <table-name> - DynamoDB table name.
  • <filter-expression> - Filtering conditional expression.
  • <limit> - The number of items to scan.
Source:
Parameters:
Name Type Description
sql string

SQL-ish statement

Returns:
Type:
DynamoDbScanStatement

SQL-ish Scan statement object