-
Notifications
You must be signed in to change notification settings - Fork 128
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
Feature Request: Transactions #176
Comments
Hahah, I love this! Maybe we can have something like:
|
I do want to get this feature in. Let's see if I can find sometime during the holiday to work on this. |
Very happy to help if I can! |
Thanks @baopham for your work! This package is awesome! |
This is not official, but this is what I have in mind:
What do you think? /cc @zoul0813 |
Will take a closer look this week, haven’t had time to read up on the latest announcements from re:Invent yet :( With that said, syntax looks clean and intuitive though. May have more thoughts after I’ve read up on the new features though. |
I've looked into it a bit, and I'm not sure I like the Can we have DynamoDBTransaction support a
As far as I understand, the We should also implement the We can also drop the // Just my "two cents" ... |
@zoul0813 Since |
We’d have to implement all of that ourselves, so it would be available at any version the project supports. I’m simply proposing we follow the way that laravel is doing it. |
Yes, that'd simplify things. That is a good idea. As for your suggestion for using Btw, if we use the Eloquent syntax for this, how would you translate the TransactItem |
@baopham as far as I understand it, the ConditionCheck is just a standard expression, but requires a Key... allowing you to check if the item with Perhaps something like this:
Note, these are chained because they all return a reference to the We can take the logic from We could also make this more verbose by requiring the user to request a new TransactItem, such as |
Let's not talk about implementation details yet. I think we are not talking about the same ConditionCheck. There is a separate ConditionCheck that doesn't have any operation bound to it, but rather a condition for the entire transaction.
If we are sticking to Eloquent. We will need to invent our own conventions
Or:
Or sticking to Transaction object to avoid global flag for transaction (my preferred way) and just some modifications away from your proposal:
|
Wait, I missed addressing a few bits of your comment: I think I misread the docs, actually
So essentially anything in the closure will be grouped in |
Actually, I misread the docs myself ... I thought the TransactWriteItem object was a combination of ConditionCheck and Put/Delete/Update ... looks like it's a FIFO style queue and TransactWriteItem only contains one of either Condition, Put, Delete or Update ... and if any of the TransactWriteItems fail, the transaction is rolled back... I like the idea of creating a Transaction object (preferred way above), and chaining everything off of that. If we implement it so that a call that comes directly off of the
Would create three TransactWriteItem objects, one ConditionCheck, one Put/Update (determined by whether or not it is a 'new' or 'existing' model), and one Delete ... processed in that order? |
I like that. Sounds good. Thanks for your input @zoul0813. I'll take the retry into consideration too. I'll work on this around end of year so if anyone else has any input, please feel free to put them in your comments. |
Sorry all, been super busy. I already have some WIP code but need more time to finish it. I don't have an ETA unfortunately. |
I know this news has been out less than 24 hours 🤣
Wanted to start the conversation around transactions and if it’s possible to integrate them with Eloquent’s transactions.
I don’t know Eloquent well enough to understand how it works with transactions. Do you think this might be possible to implement?
The text was updated successfully, but these errors were encountered: