Closed
Description
With the scaffolded yesod site, the log output for SQL queries looks like this:
20/Feb/2015:11:18:22 -0500 [Debug#SQL] "SELECT \"draft_sales_order_line\".\"id\", \"draft_sales_order_line\".\"draft_id\", ...
I have truncated the line because it is very long. However, my point is that is it a Haskell-escaped string. This would be great if I was planning on sticking it in GHCi to replay the query, but I never do that. Moreover, I feel pretty confident that almost no one is doing that. I open up psql and copy the queries into that (after having to run a script to unescape C-style strings). It would be nice if the logs just printed the actual query. I'd like to see either one of two things:
- Persistent's logging behavior being changed (I think this would be trivial).
- The same thing but with optional buy-in.
The line causing this behavior is right here: https://hackage.haskell.org/package/persistent-2.1.1.4/docs/src/Database-Persist-Sql-Raw.html#rawSql
In the definition ofrawQueryRes
where we callshow sql
. Thanks for any feedback or consideration of this proposal.
Metadata
Metadata
Assignees
Labels
No labels