Releases: sensedeep/dynamodb-onetable
v2.6.1
Minor Patch Release
Breaking Changes
- Temporarily disabling processing DynamoDB streams for the AWS SDK V2. The streams support created a hard dependency on the V3 SDK.
Fixes
- Fix hard dependency on AWS SDK V2 #446
Thanks
Thanks to all who contributed issues and patches. Much appreciated.
See
v2.6.0
Major Feature Release
Breaking Changes
- Changed the Table.params.partial default to be true
Features
- Omit storing attributes that are encoded in value templates via the encode property.
- Code formatted using prettier
- Allow params.timestamps overrides
- Allow schema and params partial overrides
- Documentation improvements
Fixes
- Set default schema properties for Tables
- Fix per field "hidden" overrides and clarify doc regarding use of "hidden"
- Fix cherry pick required index properties from next/prev params
- Find next/prev with GSIs (was missing primary index fields)
- Fix type conversions for untyped fields inside arrays for dates
- Get consistent timestamps inside transactions
- Fix handling null nested schema objects #417
- Fix handling for nested schema arrays nulls
- Fix TypeScript types for nested schema array nulls.
- Fix build badge
- Fix missing scope property to OneModel typescript definition. #412
- Fix saveSchema when supporting RegExp for encode. #408
- Add support for ConditionCheck transaction items. #409
- Fix OneField.encode typescript definition needs to allow for (string|number). #405
- Fix return consumed capacity for write operations. #444
- Fix updateTable not a function for V3 SDK. #441
- Fix invalid prep value when paginating GSIs. #443
- Fix encode in schemas. #423
Thanks
Thanks to all who contributed issues and patches. Much appreciated.
See
v2.5.1
Minor Feature Release
Features
- Added UID support. This permits generation of unique identifiers of arbitrary length.
- Omit storing attributes that are encoded in value templates via the encode property.
UID
Schema fields can generate property values using "generate: 'uuid'" or "generate: 'ulid'". These generate long, highly unique identifiers. Sometimes, where space is at a premium, you can use a shorter, somewhat less unique identifier.
The "generate: 'uid'" and "generate: 'uid(NN)'" supports the use case for shorter, less unique identifiers. A UID by default is ten letters long and supports a similar charset as the ULID (Uppercase and digits, base 32 excluding I, L, O and U.). So a 10 character UID is 32^10 which is over 1 quintillion possibilities. You can supply the length to the generate value to get an arbitrary length. For example:
generate: 'uid(16)'
When used with encoding and mapping, this helps reduce the size of items.
Note: UIDs are not time sortable like ULIDs are .
Encoding
If you have an attribute that is used in value template, it is redundant to store that attribute separately. For example:
User: {
pk: { type: 'string', value: 'account#${accountId}' },
sk: { type: 'string', value: 'user#${id}' },
accountId: { type: 'string', generate: 'uid' },
id: { type: 'string', generate: 'uid' },
}
In this example, the accountId and user ID are encoded in the PK and SK and are also stored redundantly in accountId and id.
To save space, use encode:
User: {
pk: { type: 'string', value: 'account#${accountId}' },
sk: { type: 'string', value: 'user#${id}' },
accountId: { type: 'string', generate: 'uid', encode: ['pk', '#', 1] },
id: { type: 'string', generate: 'uid', encode: ['sk', '#', 1] },
}
The encode property specifies the attribute name encoding the property, what is the separator delimiting the portions of the value template and the index of the attribute (when split at the delimiters). i.e. the accountId is encoded in pk which when split with the # delimiter, the accountId is found at the 1st index. This schema results in only the pk and sk attributes being created. But when data items are create or queried, you can provide and access the accountId and id as per usual. The encoding is transparent.
Don't forget to use mapping if you want to further compress your items by mapping the property name to a shorter on-disk attribute name. Again, mapping is transparent.
Fixes
- #399 Fix expanding strings in properties
- Fix metrics to be emitted on the 'dbmetrics' senselogs channel
- Fix pagination next/prev cursors
- Remove error for LSI projections
Thanks
Thanks to all who contributed issues and patches. Much appreciated.
See
v2.5.0
Minor Feature Release
Features
- Improved TypeScript support
- Partial Updates
Improved TypeScript support
Partial Updates
A new "partial" table parameter controls how nested properties are handled. If set to true and nested schemas are defined for those properties, nested properties will be processed accordingly. At each level of the properties:
- If the property is present at a given level, use it. For find, use a filter expression. For update, create a properly nested update expression for that property.
- If the property is set to null in an update, (and Table.nulls is false), then remove the property alone.
- If property siblings are not present in an update, don't remove them.
The "partial" parameter currently defaults to be false. This ensures backwards compatibility. The warning helps with forwards compatibility should we change the default to true in the future.
See #384 for background.
Fixes
- #386 Fix handling required property in schema fields
- #372 Fix create() typings
- #376 Aggregate scan count results
Thanks
Thanks to all who contributed issues and patches. Much appreciated.
See
v2.4.0
Minor Feature Release
Unique Attributes
Unique attribute scopes permit defining an item attribute to be unique within a specific domain. For example: making a User's project name unique within a user, but not over all users.
See the updated doc at:
Granular Timestamp Control
You can now create only "created" or only "updated" timestamps instead of both by setting the "timestamps" schema param to "update" or "create".
See the updated doc at:
Features
- #321 Added scopes for unique properties
- Support creating only "created" or "updated" timestamps by setting "timestamps" in the schema to "create" or "update".
Fixes
- #354 Merge PR to fix transactions with remove by many
- #350 Only create empty value if field is required
- #356 Fix recursion limit and boost to 1K.
Thanks
Thanks to all who contributed issues and patches. Much appreciated.
- @rehmanvirani-10p
- @mikkel-pearl
- @kujtimiihoxha
See
v2.3.8
v2.3.7
Minor Feature Release
Fixes
- #311 FIX batchGet unprocessed items
- #322 Fix returning array for transactional updates
- #326 Fix nested schemas with required and default fields
- #334 Fix template missing argument
- #336 Add Table.setParams typedef
- #342 Fix params.execute for update with unique fields
- #343 Type safety for array attributes
Thanks
Thanks to all who contributed issues and patches. Much appreciated.
huntharo
phstc
sweepy84
dj-rabel
simondean
dmcd
calebwilson706
See
v2.3.6
v2.3.5
Minor Feature Release
Fixes
- #297 Find returning items of a different type
- #312 Ignoring where clause for create
- #305 Using ?. breaks Terser
- #302 Buffer type constructors
- #314 Support optional unique values
- #313 Improve error handling for unique errors
- #302 Fix Buffer type in schema
- #289 Fix recursive loops in log data
Thanks
Special thanks to: @rjmackay, @jpmtrabbold, @banderon1, @revmischa
See
v2.3.4
Minor Feature Release
Features
- New doc site: https://docs.onetable.io
Thanks
MksDocs and https://squidfunk.github.io/mkdocs-material/