Releases: sensedeep/dynamodb-onetable
v2.3.2
Minor Feature Release
Features
Fixes
- Fix params.set with binary data. #267
- Merge pull request to fix Typescript def for Set types. #268
- Fix transaction error handling of code vs name properties. #278
- Fix doc for LSI creation. #277
- Expose child() API for typescript. #279
- Fix Error undefined context. #282
- Fix transforming nested schemas. #265
- Fix execute calls not including properties arg. #280
Thanks
Thanks in particular to @onhate, @KristianLake, @jean343, @dibell, @shishkin, @smacker
See
v2.3.1
v2.3.0
Major Feature Release
This release has compatibility issues. See below.
Features
- Public and improved OneTableError class. #240.
- Separate the Table constructor params and Schema params.
- Add schema field properties "isoDates", client to override the Table defaults.
- Add schema field property "ttl" to support DynamoDB TTL attributes. #233.
- Update schema documentation to 1.1.0.
- Refactor how UUIDs were defined.
- A collection of good fixes.
Compatibility Issues
Updating Items with Unique Attributes
The fix for #245 clarifies the return values for update(). Updates that use transactions (including updating items with unique attributes) will throw an exception if params.return requests a result be returned. DynamoDB does not support returning results from transactions. If no params.return are supplied, the current behavior is preserved and update() returns the client supplied properties but warns to say this will throw an exception in 2.4. Added support for params {return: 'get'} to do a transparent full get request. Normal non-transactional update() path remains the same.
Updating Indexes
The params updateIndexes
has been removed. Previously when this param was false (default), updates to key attributes were silently omitted to prevent creating new items on an update. Due to the attribute-exists checks that update performs, this param is no longer needed. If you specify params.exists: null, then an update may perform a create when changing key attributes. Note this can also happen if you change attributes that are ingredients in key value templates. Note also that there is no default attribute_exists protection when modifying attributes that are used in GSI keys.
Error Class
The OneTableError and OneTableArgError classes are now exported and public. The stack
property while present is now not rendered by the error toString() method.
See #240 for details.
LSIs
Previously when defining LSIs in the schema index section, you could either omit the hash key or set the hash key to that of the primary index. Now, you must include "type": "local"
to request a LSI index.
UUID
The Schema field uuid
property has been renamed generate
and must be set to 'ulid', 'uuid' or true. If true, a custom ID generator must be supplied to the Table constructor. The Table params constructor uuid
is renamed generate
and will now only take a custom ID generator function as a value. The Table.setMakeID is renamed setGenerator. You can use this function as an alternative to providing the generator to the Table constructor. The documentation regarding the UUID is updated to not that it is not fully UUIDv4 compliant and that ULIDs should be used by default.
See #191 for more details.
Table Constructor Parameters
The following table constructor parameters have been removed and moved to the Schema.params.
+ createdField?: string, // Name of "created" timestamp attribute. Default to 'created'.
+ hidden?: boolean, // Hide key attributes in Javascript properties. Default false.
+ isoDates?: boolean, // Set to true to store dates as Javascript ISO Date strings. Default false.
+ nulls?: boolean, // Store nulls in database attributes. Default false.
+ timestamps?: boolean, // Make "created" and "updated" timestamps. Default true.
+ typeField?: string, // Name of model type attribute. Default "_type".
+ updatedField?: string, // Name of "updated" timestamp attribute. Default 'updated'.
Fixes
- Extend wait port timeout for unit tests
- Remove "tunnel" from doc as TypeScript now supports begins etc directly.
- Fix typescript find with empty parameters
- Fix where clauses with newlines in values
- Fix transforming read items with nulls
- Fix partial properties in TypeScript find #232
- Fix #239 using type as hash or sort
- Fix #241 timestamps not created if not specified in schema params.
- Fix #242 with reserved words in create
- Fix #244 where update does not update indexed properties. Removed updateIndexes param.
- Fix #245 return value from update with unique attributes
- BatchWrite will retry unprocessed items with exponential delay (with jitter) if the update fails. Set params.reprocess to false to disable retries.
- Documentation improvements
Thanks
Thanks in particular to @rjmackay, @AndrewCathcart, @kujtimiihoxha, @BDQ, @onhate who raised issues and provided great feedback.
See
v2.2.1
Minor Feature Release
This release include the PR from @markandrus that improves TypeScript checking for find params.
Features
- Improve TS type checking for find params with Begins*, Between*, Less*, Equal*, Greater*. Thanks to the TS wizardry of @markandrus.
Fixes
- Fix using nulls as default values.
- Fix exception in Expression with params.fields for unknown field names.
- Fix unit test wait port
See
v2.2.0
Minor Patch Release
Features
- Improve validation error messages
Fixes
- Numeric key types
- Update README (thanks @BDQ)
- Fix batch params.fields projection. #212
- FIX ULID must not contain letter 'I' by spec. Update validation RegExp as well.
- Fix schema.indexes type in schema. Make Object.
- Fix validating updates with required fields set to null
- Fix update/create with array fields passed a string. Will cast as [value]. Note: TS already catches this at compile time.
- Throw exception if using nested schemas on Array types.
- Fix batch processing of unprocessed items.
See
v2.1.4
Minor Patch Release
Features
Fixes
- Revise TypeScript declaration to workaround TS build error
See
v2.1.3
Minor Patch Release
Features
Fixes
- Fix mistake in TypeScript declarations to support required fields. (Sorry).
- Fix support for tables without sort key.
See
v2.1.2
Minor Patch Release
Features
Fixes
- Fix TypeScript types for required properties. #185.
- Fix init() methods to always create all defined attributes.
- Fix value template expansion for properties set to null instead of undefined.
- Prevent removal of required fields via {remove}.
- Fix updating items with unchanging unique properties. #206
- Add updateTable to TS types. #201.
- Fix params.limit was using result.ScannedCount vs Count.
See
v2.1.1
Minor Patch Release
Breaking Compatibility
This probably should have been a 2.2 version (SemVer) due to the change in UUID format to be spec compliant. This does can impact code that uses validations on the UUID format. Recommended to delete the schema field validations for UUID generated values if you have old and new format UUIDs.
Features
- Add params to groupByType to support not returning hidden items
- Expose request trace in OneError for transactional errors (Thanks Kujtim)
- Add Error.d.ts (Thanks Ruben)
Fixes
- Fix unique attribute keys #180
- Doc updates
- Make UUID spec compliant. #191
- Fix Expression.js missing .js on Error import (Thanks Robbie)
- Fix OneArgError references
- Cleanup some unreferenced vars and imports
See
v2.1.0
Minor Feature Release
Features
- Add Table transform, value and validate callbacks. See #173
Breaking Changes
- Deprecate Model params.transform, params.validate in favor of the Table transform and validate functions.
- Moved OneError code from context.code to the top level. The code includes the suffix 'Error'.
Fixes
- Fix duplicate references in filterExpressions for generic queries
- Fix unique attributes not using actual key names. #169. Thanks @kujtimiihoxha
- Fix Doc. #168. Thanks @kujtimiihoxha
- Fix Table.readSchema to use : delimiter
- Document nested schemas
- Rename schema
ref
toreference
and document