I want to log all SQL strings executed by HugSQL. I looked through the docs, but couldn't find anything. Whats the recommended way?
相关问题
- Better Sequence Duplicate Remover
- I want to trace logs using a Macro multi parameter
- Error message 'No handlers could be found for
- convert logback.xml to log4j.properties
- Django management command doesn't show logging
相关文章
- how do I log requests and responses for debugging
- Factor Clojure code setting many different fields
- Android Studio doesn't display logs by package
- Does learning one Lisp help in learning the other?
- Stacktrace does not print in Glassfish 4.1 Cluster
- Out of curiosity — why don't logging APIs impl
- Laravel log file based on date
- Java -How to get logger to work in shutdown hook?
Per the HugSQL doc:
So you could use the
sqlvec
version of the functions colocated with where you call your HugSQL functions to log out the SQL that would be executed.The doc actually provides the following example. Given that you've loaded HugSQL queries like so:
And given the following function call:
You can get at the generated sqlvec with the following:
Which would return something like:
I solved it myself by digging around the hugsql source. I works similar to converting the result set of a generated function (https://github.com/layerware/hugsql/issues/21):