OneTable Schema Specification v1.0.0 Overview
mainThe OneTable Schema is a JSON-based specification used to define application entities, their fields, and DynamoDB index structures for single-table designs. It allows the database to be self-describing, where schemas can be stored within the data table itself. This specification is used by the dynamodb-onetable library to map application models to physical DynamoDB attributes and keys.
{
"version": "0.1.0",
"format": "onetable:1.0.0",
"indexes": {
"primary": { "hash": "PK", "sort": "SK" },
"GSI1": { "hash": "GS1PK", "sort": "GS1SK" }
},
"params": {
"typeField": "_type"
},
"models": {
"Account": {
"PK": { "type": "string", "value": "account#${name}" },
"SK": { "type": "string", "value": "account#" },
"name": { "type": "string", "required": true }
}
}
}