v1.9.0
Major Feature Release
This release adds support to save the OneTable schema in the database along with any migrations. This permits a DynamoDB table to be self-describing without requiring external code or schemas. This enables support for better tooling such as entity level data browsers, schema designers, entity level monitoring and high level data migrations.
The goal is to make Single Table design much easier and more productive.
SenseDeep and other products are adding support for such OneTable integrations.
Features
- Support saving and persisting schema: Table.setSchema, readSchema, saveSchema
- Define Schema and Migration models internally
- Add schema.params to provide Table constructor params from persistent storage
Breaking Compatibility
- The type field is now hidden by default. Use {hidden: true} in the params to return it. If using
fetch
or groupByType, you will probably need to include {hidden: true} in the params to return items with the type. - Refactor transforms via:
- Deprecate Table.intercept and rename as Table.transform
- Remove Params.transform (was undocumented)
- Remove Schema Fields.transform and add Params.transform
Persisting Schemas
To assist better tooling for Single Table designs support is added to persist schemas in the table using the _Schema keys. The schema will also contain the Table constructor parameters including the typeField and delimiter. This permits auto-discovery of table items by reading the schema and from there, the item keys can be decoded.
Refactored Transforms
The previous ad-hoc scheme of transformers has been cleaned up and centralized as the Table params.transform and general API params.transform. Performing Schema field.transform is problematic if persisting schemas. So this functionality should be moved to the Table transformer which operates on the entire item rather than per field.
Enhanced metrics with:
- Add metrics.env for dynamic control via the LOG_FILTER env var
- Add metrics.enable to control emission of metrics
- Add metrics.queries to enable query profiling
- Add Tenant dimension
- Add metrics.dimensions for configurable dimensions
- Add metrics.properties for additional properties to add to the EMF record.
Fixes
- Stop doing a get and transaction on unique property updates.
- Nested unique properties inside transactions. #134
- Optimize handling of unique property updates. #129
- Make the typeField hidden by default.
- Convert Date objects when writing without a schema.