Back

for-query (clj)

(source)

function

(for-query table where-params opts)
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. Applies any `:table-fn` / `:column-fn` supplied in the options. Handles pagination options (`:top`, `:limit` / `:offset`, or `:offset` / `:fetch`) for SQL Server, MySQL / SQLite, ANSI SQL respectively. By default, this selects all columns, but if the `:columns` option is present the select will only be those columns. If `:suffix` is provided in `opts`, that string is appended to the `SELECT ...` statement.

Examples