Skip to content

Releases: sensedeep/dynamodb-onetable

v2.7.2

30 Apr 04:50
Compare
Choose a tag to compare

Minor Patch Release

Features

  • None

Fixes

  • Fix module imports for ESM
  • Fix batchGet type
  • Fix getCurrentSchema type
  • Some doc updates

Thanks

Thanks to all who contributed issues and patches. Much appreciated.

See

v2.7.1

15 Sep 21:17
Compare
Choose a tag to compare

Minor Path Release

Features

  • None

Fixes

  • Async declarations in Model.d.ts

Thanks

Thanks to all who contributed issues and patches. Much appreciated.

See

v2.7.0

11 Sep 06:20
Compare
Choose a tag to compare

Minor Feature Release

This release includes a solid refactor of the partial update support in Expression.js. Please report any issues with partial and nested updates. For this reason, we've incremented the minor version number to indicate the risk.

It also adds support for CustomMetrics](https://www.npmjs.com/package/custom-metrics). Previously the single table metrics (Metrics.js) could create a lot of CloudWatch metrics which are quite expensive (~$4 per metric / year). CustomMetrics stores metrics in the dynamoDB table. When used with buffering, you can get high resolution DynamoDB metrics with a small additional DynamoDB load.

Features

Fixes

  • Partial array updates
  • Suppress annoying AWS SDK v2 warning
  • Fix AWS SDK V3 missing TTL support
  • Update all dependencies
  • Remove Node 14 tests
  • Fix ESM distribution generation
  • Add metric flush on lambda termination (requires a lambda layer)

Thanks

Thanks to all who contributed issues and patches. Much appreciated.

See

v2.6.4

18 Aug 03:14
Compare
Choose a tag to compare

Minor Patch Release

Fixes

  • #479 - Batched get with incomplete keys
  • #477 - Match sample code with release
  • #490 - Add missing metric types
  • Add table.metrics to TS definitions
  • Add profile to OneParams
  • Fix partial nested update expression
  • #489 - Metrics not including namespace
  • #488 - Fix conditional boolean in Table.d.ts
  • #470 Fix batchWrite unprocessed items
  • Fix encoded nested properties
  • Fix mapped nested put operations

Thanks

Thanks to all who contributed issues and patches. Much appreciated.

See

v2.6.3

03 Jul 00:02
Compare
Choose a tag to compare

Minor Patch Release

Fixes

  • Fix missing quoting on where clause for filter queries
  • Fix #476 Template value throw type error when using nested property that is undefined
  • Fix #480 Create on create result for typescript
  • Fix README regarding ASW SDK V3 init
  • Fix import Buffer
  • Exclude Stream unit test
  • Fix hard dep on AWS SDK
  • Change default SDK to AWS V3
  • Improve Table constructor to not require Dynamo for AWS SDK V3
  • Updated README for typescript
  • Add options to getModel for "nothrow"
  • Fix #454 init() exception on deps

Thanks

Thanks to all who contributed issues and patches. Much appreciated.

See

v2.6.2

30 Mar 21:35
Compare
Choose a tag to compare

Minor Patch Release

Fixes

  • TypeScript fixes #458 (Missing array def)
  • Lint fixes
  • Propagate parent schema partial overrides

Thanks

Thanks to all who contributed issues and patches. Much appreciated.

See

v2.6.1

15 Feb 20:45
Compare
Choose a tag to compare

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

15 Feb 02:53
Compare
Choose a tag to compare

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

13 Oct 23:19
Compare
Choose a tag to compare

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

26 Sep 23:37
Compare
Choose a tag to compare

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