Jira issue originally created by user tcm:
$db = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
$qb = $db->createQueryBuilder();
this QueryBuilder I'm able to do SELECT, UPDATE and DELETE. However, INSERT is not possible. Are there any good reasons for this?
Attached you find a patch that until now works fine for me. I don't know, however, if there are any side effects.
Comment created by @ocramius:
Insert is not supported by DQL
Comment created by tcm:
Well, that was quick and not helpful. I have read about the QueryBuilder in the ORM package. For some reason with persistence (that other libraries don't have), insert cannot be supported. However, I'm talking about DBAL here. What good reason is there not to support INSERT??
see previous comment, I'd appreciate some clarification
[~tcm] Ouch, no, it was my fault, sorry.
I confused the project related to the issue.
This is actually valid (even the patch, though it needs to adds tests)
Glad to hear there seems to be no fundamental problem with this. Can I somehow help this patch go into the code? I'm not familiar with the tests here. If you give me some pointer, maybe I can come up with something useful. On the other hand, it could be a good idea for some more involved people to have a look at this before.
You'd need to add tests in https://github.com/doctrine/dbal/blob/master/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php (to be included in your patch or in a github pull request)
A Github PR is also the fastest way to get your code reviewed since not everyone visits the issue tracker.
Here's the PR: #184
Comment created by @doctrinebot:
A related Github Pull-Request [GH-184] was closed:
Comment created by @deeky666:
Fixed in commit: 7502dae
Issue was closed with resolution "Fixed"