How to get Korma to output the SQL code that it executed?

I am trying to get Korma to output the SQL that it executed so that I can debug the problem I have, but the docs are very brief on how to use the as-sql function. Can someone give me an example of how to get Korma to output SQL for an INSERT query?

+8
clojure korma
source share
2 answers

from: http://sqlkorma.com/api/0.3.0/korma.core.html

dry-run (dry-run & body) Wrap around a set of queries to print to the console all SQL that would be run and return dummy values instead of executing them. 
+8
source share

If you want to get SQL query as a string, there is also sql-only

 (println (sql-only (select users))) 
+5
source share

All Articles