Skip to content

Commit

Permalink
feat: expose a way to get the Transaction write items
Browse files Browse the repository at this point in the history
This can be helpful for when you want to manipulate the transaction
request directly, or debug/log the requested transact items.
  • Loading branch information
benhutchins committed Nov 16, 2023
1 parent 074fe81 commit d0d0c6a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ export class Transaction {
return this
}

/**
* Get the list of pending transact items.
*/
public getTransactItems(): TransactWriteItem[] {
return this.list
}

/**
* Commit all the pending transact items to DynamoDB.
*/
public async commit(): Promise<TransactWriteItemsOutput> {
return await transactWrite(this.dynamo, this.list)
}
Expand Down

0 comments on commit d0d0c6a

Please sign in to comment.