-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Add write transaction #468
base: master
Are you sure you want to change the base?
Conversation
Looks pretty good 👍 . The only issue I see is that The only reason why transactions aren't added yet is that I am not sure what API should be. I have following thoughts:
I considered following interface: # Dyhamoid::Document.transaction or User.transaction
Dynamoid::Document.transaction do |txn|
txn.create(User, attributes)
txn.update(User, attributes)
txn.update_fields(User, attributes, conditions)
txn.upsert(User, attributes)
txn.delete(User, id)
end So please let me know what do you think about it. |
Hey thanks for the response. I admit i did this PR with a specific business case in mind. I like your suggestion for the new api design. Will work on it over the next few days. |
Great. I believe that proposed above approach isn't as good and consistent as it could be so there is room for improvement. For instance |
@andrykonchin what's the status on transact write support, is it planned? any help needed? |
Transactions aren't supported right now. The main issue is that it isn't clear to me how the transactions API should look. Any opinion/proposition is welcomed. |
Have there been any more thoughts on this? Below is an alternate API idea using an array of arrays. An array of hashes could work too. Personally I prefer single table usage of DynamoDB so don't have a need to span tables but I see why it should be supported.
|
Add transaction write feature to DynamoId.