DynamoDB Corona Module
The DynamoDB module provides access to the low-level AWS DynamoDB API.
Prerequisites
To properly use this module it is assumed that you:
- Have a current AWS account.
- Understand how to use DynamoDB.
- Know where to find documentation.
- Can set up IAM users, as well as their permissions.
Get the Module
You can download the module from the DynamoDB CoronaSDK repo.
Click the green "Clone or download" button and select "Download ZIP" from the pop-up.
Expand the dynamodb-coronasdk-master.zip file.
Copy the dynamodb directory found inside to your Corona project.
Important
Be sure to copy over the actual dynamodb directory, not the files inside.
Your project tree should look something like:
CoronaProjectFolder
-- dynamodb
-- main.lua
-- ...
Add the Module
local db = require("dynamodb.client")
Initialize
db:init( config )
See init() for configuration options.
Make a Request
local function dbListener( evt )
if not evt.error then
print(evt.result.some_key)
end
end
db.events:addEventListener("DynamoDBEvent", dbListener)
db:request( action, payload )
See request() for more details.