@webiny/api-page-builder-so-ddb
Version:
The DynamoDB storage operations Webiny Page Builder API.
31 lines (29 loc) • 730 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createTable = void 0;
var _toolbox = require("@webiny/db-dynamodb/toolbox");
const createTable = ({
table,
documentClient
}) => {
const tableConfig = {
name: process.env.DB_PAGE_BUILDER || process.env.DB_TABLE,
partitionKey: "PK",
sortKey: "SK",
DocumentClient: documentClient,
indexes: {
GSI1: {
partitionKey: "GSI1_PK",
sortKey: "GSI1_SK"
}
},
autoExecute: true,
autoParse: true
};
const config = typeof table === "function" ? table(tableConfig) : tableConfig;
return new _toolbox.Table(config);
};
exports.createTable = createTable;
//# sourceMappingURL=table.js.map
;