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
[NFR] Query\Builder support INSERT/UPDATE/DELETE #1925
Comments
+1 Looks really nice. |
+1 |
2 similar comments
👍 |
+1 |
😍 |
+1 Would be amazingly useful for batch processing! |
+1 |
2 similar comments
+1 |
+1 |
how to collect this issue? |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
delete() and update() are already implemented, right? $this->modelsManager->createBuilder()
->from('Cars')
->where('type = :type:', array('type' => 'Sedan'))
->getQuery()
->execute() // This returns Phalcon\Mvc\Model\Resultset
->delete(); The above is equivalent to the following PHQL. $phql = 'DELETE FROM Car WHERE type = :type:';
$query = new Query($phql, Di::getDefault());
$query->execute(['type' => 'Sedan']); Both of 2 got same SQL statements. (PHQL also calls SELECT `car`.`id`, `car`.`type` FROM `car` WHERE `car`.`type` = :0
SAVEPOINT PHALCON_SAVEPOINT_2
DELETE FROM `car` WHERE `id` = ?
DELETE FROM `car` WHERE `id` = ?
DELETE FROM `car` WHERE `id` = ?
...
RELEASE SAVEPOINT PHALCON_SAVEPOINT_2 refer |
this above delete and update not working for non primary key. |
Damn I was just looking for this feature. Seems it doesn't exist. I was looking to update using inWhere() |
It's not implemented, is just selecting first and then deleting. I think there shouldn't be selecting. |
+1 |
Laravel support similar function。 |
Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues |
I tried to think of a new method, but how about you??
Method return is Phalcon\Mvc\Model\Query\Status.
I'm afraid my expressions may be rude or hard to read, because I'm not so good at English.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: