문제

I'm trying to get Korma to output the SQL it would execute so I can debug a problem I'm having, but the docs are very terse on how to use the as-sql function. Can anyone give me an example of how to make Korma output the SQL for an INSERT query?

도움이 되었습니까?

해결책

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.

다른 팁

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

(println     
    (sql-only
        (select users)))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top