(sql :select :* :from :t \;)
(sql [:select :* :from :t \;])
(sql '[select * from t\;])
How to write SQL statements as sequences of tokens.
The README introduced you to this way of writing SQL. I find it pretty easy to use, but there are a few tricks you’ll need to know.
sql FunctionTo create raw SQL, just call the sql function with one or more arguments.
If for some reason your first token represents a string literal, wrap it in a vector.
Otherwise, sql will assume it’s verbatim SQL, not a string literal.
In practice this almost never happens because SQL statements always start with a SQL keyword.
|
It’s usually easiest to pass a quoted vector, so you can type symbols instead of keywords.
(sql :select :* :from :t \;)
(sql [:select :* :from :t \;])
(sql '[select * from t\;])
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 |