@stately-cloud/schema
v0.34.4
Published
Schema Language for StatelyDB, a document database built on top of DynamoDB with Elastic Schema that allows you to change your data model any time with automatic backwards compatibility.
Readme
StatelyDB Schema Language
StatelyDB is a document database built on top of DynamoDB. It uses Elastic Schema to allow you to update your data model at any time, with automatic backwards and forwards compatibility.
This is a TypeScript domain-specific language (DSL) for generating StatelyDB Schemas. You use schemas to define the shape of your data model in StatelyDB, including validation, types, and other database configuration such as key paths and indexes. You can also use migrations to change your data model, automatically preserving backwards and forwards compatibility with existing schema versions. It is meant to be used with the stately CLI, e.g. stately schema put index.ts.
How it's used
- Follow our Getting Started guide to install the Stately CLI.
- Run
stately schema init myschemato create a new schema in the foldermyschema. - Develop your schema in TypeScript (
.ts) files. These import from@stately-cloud/schemato get types and builder functions. - Run
stately schema validate myschema/index.tsto check your schema. - Run
stately schema put --schema-id 12345 --message "an update message" myschema/index.tsto upload the schema to your store. - Run
stately schema generate --language typescript --schema-id 12345 <output-dir>to generate typed models for your schema.
