-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Update doc dql-custom-walkers.rst with an output walker to interpolate parameters into SQL
#12060
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
base: 3.5.x
Are you sure you want to change the base?
Conversation
|
Sorry for inadvertently closing your other PR yesterday, it was because I deleted the target branch. Please kindly squash your commits together. If you don't, we'll try to remember to do it for you but it's best if you save us this trouble. How to do that?
|
|
There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
|
bump |
| Modify the Output Walker to get the raw SQL with interpolated parameters | ||
| -------------------------------------------------------- | ||
|
|
||
| Sometimes we may want to log or trace the raw SQL being generated from its DQL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should elaborate here. I think your need is to get a SQL statement that you can replay yourself, with an SQL client. If so, please say so explicitly and clearly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me there's two main usage of raw SQL: log the SQL being executed to debug possible slow queries in future, and UNION results of multiple DQL with WHERE as only DBAL query supports UNION as in https://stackoverflow.com/questions/4155288/how-to-write-union-in-doctrine-2-0/79647475#79647475 and https://github.com/n0099/open-tbm/blob/c960f09242097937403880a6ebd02ef4946ce3a8/be/src/PostsQuery/QueryResult.php#L219-L237.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Sometimes we may want to log or trace the raw SQL being generated from its DQL, | |
| Sometimes we may want to log or trace the raw SQL being generated from its DQL | |
| for profiling slow queries in the future or audit queries that changed many rows |
Co-authored-by: Grégoire Paris <[email protected]>
Co-authored-by: Grégoire Paris <[email protected]>
#11959