@ocap/indexdb-dynamodb

OCAP indexdb adapter that uses DynamoDB as backend

Usage no npm install needed!

<script type="module">
  import ocapIndexdbDynamodb from 'https://cdn.skypack.dev/@ocap/indexdb-dynamodb';
</script>

README

@ocap/indexdb-dynamodb

styled with prettier

OCAP indexdb adapter that stores data in dynamodb

Install

npm install @ocap/indexdb-dynamodb
// or
yarn add @ocap/indexdb-dynamodb

Usage

const DynamoIndexDB = require('@ocap/indexdb-dynamodb');

const indexdb = new DynamoIndexDB({
  clientOptions: {
    region: 'us-west-2',
    endpoint: 'http://localhost:8000',
    credentials: {
      accessKeyId: 'xxx',
      secretAccessKey: 'yyy',
    },
  },
});

Examples

./examples 是一些列子, 默认使用的是本地实例,可以修改 ./examples/.env 中的配置, 运行方法:

node transactions.js insert # 插入数据
node transactions.js read # 读取一条数据
node transactions.js read [id] # 读取一条数据
# ...