HeadspaceMeditation / beyonce

Type-safe DynamoDB query builder for TypeScript. Designed with single-table architecture in mind.
Apache License 2.0
6 stars 5 forks source link

[Beyonce]: Add executeTransaction method / deprecate batchPutWithTransaction #54

Closed jcarver989 closed 3 years ago

jcarver989 commented 3 years ago

What's in this PR?

This PR adds a new executeTransaction method that allows callers to put and delete a set of records within the same transaction. We had a narrower method, batchPutWithTransaction which is now redundant and is thus marked as deprecated and will soon be removed.

DynamoDB supports a wider range of transaction operations (e.g. conditions on the transaction and updating records), so we'll want to extend executeTransaction to handle these use cases as well. But that is left to future PRs.

I snuck in a few small changes as separate commits -- fixing a test, and swapping several type definitions to interfaces (which allows for using the extends keyword).

How to review? Commit-by-commit