API Platform: Inspect the SQL query that runs for a given endpoint
9 December 2022 (Updated 9 December 2022)
Suppose you have a Client
entity and a corresponding /v1/clients
endpoint that should return the list of clients. You might have enabled several filters and added some custom extensions, potentially affecting the SQL query that executes against your client
table.
To view what SQL query gets generated for a given request, you can open the Symfony Profiler, go to the Doctrine
panel and use your browser’s find shortcut (e.g., Cmd + F
for Chrome on macOS) to search for something like from <database_table>
.
Once you locate the relevant query, click on the View runnable query
button to get a runnable SQL query that you can paste and execute in an app like TablePlus.
Tagged:
API Platform
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment