-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
SqlConsoleCommand
should show results of queries containing RETURNING
#871
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DBAL-1250 We use Jira to track the state of pull requests and the versions they got |
Also detecting a SELECT statement by looking at the first SELECT does not always work. E.g. if one is using CTE:
|
Rather than this nonsense of detecting strings inside queries, I'd rather just create an option that specifies this behavior. Maybe --force-fetch? |
ee737d5
to
b346106
Compare
@zeroedin-bill I've rewritten the code to your suggestion! |
And the tests are only failing because of composer timeouts :( |
SqlConsoleCommand: Showing results of queries containing RETURNING
Merged manually, renamed |
👍 |
SqlConsoleCommand
should show results of queries containing RETURNING
PostgreSQL supports returning values after they are inserted or updated which is especially handy if one wants to get the value of an used sequence. (See http://www.postgresql.org/docs/9.4/static/sql-insert.html) Those returned values are currently omitted but could be displayed.
Currently (with symfony):
After the patch the output is the following:
Looking directly for 'returning' is a bit direct in my eyes but as there is no sql parser present, there is no other easy way to do so. If someone has a better implementation or any suggestion, feel free to comment :)