dynamodb-toolbox icon indicating copy to clipboard operation
dynamodb-toolbox copied to clipboard

Add option to return `payoad` for `transactWrite`

Open shellscape opened this issue 1 year ago • 0 comments

Currently, if we want to inspect the payload and its auto-generated values, we have to step outside of the Table.transactWrite method and use something like this:

    const payload = table.transactWriteParams(batch);
    await table.DocumentClient!.transactWrite(payload).promise();

I propose we add an alternative return type that would include the payload generated by transacteWriteParams so we could inspect values like sort keys with a default, generated value. e.g. payload.TransactItems[0].Put!.Item.sk.

shellscape avatar Feb 23 '23 02:02 shellscape