Postgraphile: Output executed Postgres queries?

Created on 12 Jan 2017  路  6Comments  路  Source: graphile/postgraphile

Forgive me if there's an answer for this somewhere, but it might be nice to have an option to show the SQL that gets sent to Postgres from PostGraphQL. Any idea how this might be done?

馃搫 add-to-docs

Most helpful comment

We use the debug module, so you can run export DEBUG="postgraphql:*" (assuming bash shell) before running postgraphql to see various output. For postgres queries specifically you want DEBUG=postgraphql:postgres; but DEBUG=postgraphql:postgres:explain is also handy.

All 6 comments

We use the debug module, so you can run export DEBUG="postgraphql:*" (assuming bash shell) before running postgraphql to see various output. For postgres queries specifically you want DEBUG=postgraphql:postgres; but DEBUG=postgraphql:postgres:explain is also handy.

Excellent. Thank you @benjie! This works perfectly :)

@benjie this should be mentioned in document

@lcjnil I totally agree. Pull requests are welcome 馃憤

FYI: It should now be export DEBUG="postgraphile:*" in case anyone is looking at this issue in 2018.

This is now documented here: https://www.graphile.org/postgraphile/debugging/#step-4-viewing-the-generated-sql

Was this page helpful?
0 / 5 - 0 ratings

Related issues

srghma picture srghma  路  3Comments

CarlFMateus picture CarlFMateus  路  4Comments

outsidenote picture outsidenote  路  4Comments

ssomnoremac picture ssomnoremac  路  5Comments

jwdotjs picture jwdotjs  路  5Comments