0.3.1 • Published 12 months ago
@winglibs/dynamodb v0.3.1
dynamodb
Prerequisites
Installation
npm i @winglibs/dynamodbUsage
bring dynamodb;
let table = new dynamodb.Table(
attributes: [
{
name: "id",
type: "S",
},
],
hashKey: "id",
);
// Streams.
table.setStreamConsumer(inflight (record) => {
log("record processed = {Json.stringify(record)}");
});
// Put and query.
test "put and query" {
table.put(
Item: {
id: "1",
body: "hello",
},
);
let response = table.query(
KeyConditionExpression: "id = :id",
ExpressionAttributeValues: {":id": "1"},
);
assert(response.Count == 1);
assert(response.Items[0]["id"].asStr() == "1");
assert(response.Items[0]["body"].asStr() == "hello");
}In case you want to instantiate your own DynamoDB SDK, you can get the connection details like this:
table.connection.clientConfig.endpoint;
table.connection.clientConfig.credentials;
table.connection.clientConfig.region;
table.connection.tableName;So you can use the AWS SDK DynamoDB client like this:
new DynamoDB(table.connection.clientConfig);License
This library is licensed under the MIT License.
0.3.1
12 months ago
0.3.0
1 year ago
0.2.3
1 year ago
0.2.2
1 year ago
0.2.4
1 year ago
0.1.20
1 year ago
0.2.1
1 year ago
0.2.0
1 year ago
0.1.19
1 year ago
0.1.12
2 years ago
0.1.13
2 years ago
0.1.14
1 year ago
0.1.15
1 year ago
0.1.16
1 year ago
0.1.17
1 year ago
0.1.18
1 year ago
0.1.11
2 years ago
0.1.10
2 years ago
0.1.9
2 years ago
0.1.8
2 years ago
0.1.7
2 years ago
0.1.6
2 years ago
0.1.4
2 years ago
0.1.5
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.3
2 years ago
0.1.0
2 years ago
0.0.8
2 years ago
0.0.5
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago