stch.sql.format documentation
Format query and DML statements. Use with stch.sql.
*fn-context?*
*input-params*
*param-counter*
*param-names*
*params*
Will be bound to an atom-vector that accumulates SQL parameters across possibly-recursive function calls
*quote-identifier-fn*
*subquery?*
ToSQL
fn-aliases
fn-handler
format
(format sql-map & params-or-opts)
Takes a SQL map and optional input parameters and returns a vector of a SQL string and parameters, as expected by clojure.java.jdbc. Input parameters will be filled into designated spots according to name (if a map is provided) or by position (if a sequence is provided). Instead of passing parameters, you can use keyword arguments: :params - input parameters :quoting - quote style to use for identifiers; one of :ansi (PostgreSQL), :mysql, :sqlserver, or :oracle. Defaults to no quoting. :return-param-names - when true, returns a vector of [sql-str param-values param-names]
format-predicate
(format-predicate pred & {:keys [quoting]})
Formats a predicate (e.g., for WHERE, JOIN, or HAVING) as a string.