Rendering is the process of turning:
into:
Rendering returns a map like this:
{:sql "SELECT * FROM users WHERE id = ?"
:params [42]
:meta {}}
If declaration comments exist, :meta contains them.
WHERE id = /*$id*/1
{:id 42}
→
{:sql "WHERE id = ?"
:params [42]}
WHERE id IN /*$ids*/(1,2,3)
{:ids [10 20 30]}
→
{:sql "WHERE id IN (?, ?, ?)"
:params [10 20 30]}
WHERE
/*%if active */
active = true
/*%else => status = 'inactive' */
/*%end */
The rendered SQL depends on the truthiness of active.
DEFAULT and ALLbisql/DEFAULT and bisql/ALL are rendered as SQL keywords for scalar $ bindings.
{:status bisql/DEFAULT
:limit bisql/ALL}
Typical user-facing APIs are:
bisql.core/defrenderbisql.core/defqueryFor lower-level examples, see:
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |