-
Notifications
You must be signed in to change notification settings - Fork 370
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
Update/Delete many records at once? #22
Comments
No, unfortunately this won't work at the moment.
I'm aware that this isn't ideal, as it generates n queries. This problem has been discussed before, and it's on my roadmap. Ideally, I'd want the syntax to be:
Similarly, the following should be possible:
This should issue This will require quite a lot of refactoring, but I think (in principle) it should be possible. I'll keep this ticket open as a feature request. Unfortunately, I'm very busy at the moment so I can't give an ETA. Jamie |
Hi Jamie, No stress at all! Big thanks for both your initiative with idiorm as well as your fantastic support! Take care! EDIT: |
No problem, I reopened it. |
#38 resolves the delete part of the feature request. |
To delete multiple records you should use the |
Hi. Is it possible to update many records at once? Something like UPDATE table SET foo='bar' WHERE id IN (1,2,3) ? |
You can do this with |
lol, I can do any query with raw_execute, but then why we need ORM? ) I meant something like for_table()->where_in('id',array(1,2,3))->set('foo','bar')->save(); |
Hmm, yes, I know what you meant. My answer still stands though, but there are two other less appealing options:
Idiorm is deliberately simple and this is one of those features that has been deliberately omitted. If you have a good idea of how to implement it (whilst supporting PHP 5.2) then please do open a pull request. |
Hi again Jamie,
I tried the following, which didn't work. Is there any current solution to my issue?
Thanks
The text was updated successfully, but these errors were encountered: