next.jdbc.sql.builder
(source)Some utility functions for building SQL strings.
These were originally private functions in `next.jdbc.sql` but
they may prove useful to developers who want to write their own
'SQL sugar' functions, such as a database-specific `upsert!` etc.
For more info about this library see:
https://cljdoc.org/d/com.github.seancorfield/next.jdbc/1.3.909/doc/readmePublic Variable | Short Description |
---|---|
as-? (clj) | Given a hash map of column names and values, or a vector of column names, return a string of `?` placeholders for them. |
as-cols (clj) | Given a sequence of raw column names, return a string of all the formatted column names. |
as-keys (clj) | Given a hash map of column names and values, return a string of all the column names. |
by-keys (clj) | Given a hash map of column names and values and a clause type (`:set`, `:where`), return a vector of a SQL clause and its parameters. |
for-delete (clj) | Given a table name and either a hash map of column names and values or a vector of SQL (where clause) and its parameters, return a vector of the full `DELETE` SQL string and its parameters. |
for-insert (clj) | Given a table name and a hash map of column names and their values, return a vector of the full `INSERT` SQL string and its parameters. |
for-insert-multi (clj) | Given a table name, a vector of column names, and a vector of row values (each row is a vector of its values), return a vector of the full `INSERT` SQL string and its parameters. |
for-order (clj) | Given an `:order-by` vector, return an `ORDER BY` clause. |
for-order-col (clj) | Given a column name, or a pair of column name and direction, return the sub-clause for addition to `ORDER BY`. |
for-query (clj) | Given a table name and either a hash map of column names and values or a vector of SQL (where clause) and its parameters, return a vector of the full `SELECT` SQL string and its parameters. |
for-update (clj) | Given a table name, a vector of column names to set and their values, and either a hash map of column names and values or a vector of SQL (where clause) and its parameters, return a vector of the full `UPDATE` SQL string and its parameters. |