Skip to content

TableTransactWrite

Table-level command to perform an atomic write transaction across multiple entity types.

Unlike TransactWrite which operates on a single entity type, this command accepts operations from multiple entities via entity.prepare([...]) and executes them as a single all-or-nothing DynamoDB transaction.

await table.send(new TableTransactWrite({
transactions: [
userEntity.prepare([
new Put({ item: { userId: 'u1', name: 'Alice' } }),
new Delete({ key: { userId: 'u2', name: 'Bob' } }),
]),
orderEntity.prepare([
new Update({ key: { orderId: 'o1' }, update: { status: 'shipped' } }),
]),
],
}))

new TableTransactWrite(config): TableTransactWrite;

TableTransactWriteConfig

TableTransactWrite

execute(table): Promise<TableTransactWriteResult>;

DynamoTable

Promise<TableTransactWriteResult>

TableCommand.execute