Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocumentClient: inconsistant requirement of conditional expressions vs Dynamodb, for transact writes #439

Open
seba-i opened this issue Sep 20, 2024 · 0 comments

Comments

@seba-i
Copy link

seba-i commented Sep 20, 2024

Hi, it is frustrating that DocumentClient transactWrite forces you to use a 'conditional expression', whereas the underlying Dynamodb transactWriteItem does not.

DocumentClient TransactWrite uses class Operation, where the field expression is a required field, even though it then gets translated into a Dynamodb TransactWriteItem, whose conditionExpression is not required.

Its inconvenient to always have to use a conditional expression, eg just PUT an object into db.

Happy to submit a PR if there's agreement (to change Option.expression type to nullable String)

// workaround...
TransactWrite(
      put: Operation(
          value: {'pk': '123', 'sk': '456'},
          tableName: 'my-table',
          expression: 'attribute_not_exists(arrrgghhhh)')), // :-(
@seba-i seba-i changed the title Inconsistant requirement of conditional expressions in DocumentClient vs Dynamodb for transact writes DocumentClient: inconsistant requirement of conditional expressions vs Dynamodb, for transact writes Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant