(build & clauses)
Takes a series of clause+data pairs and returns a SQL map. Example:
(build :select [:a :b]
:from :bar)
Clauses are defined with the honeysql.helpers/build-clause multimethod. Built-in clauses include:
:select, :merge-select, :un-select
:from, :merge-from
:join, :merge-join
:left-join, :merge-left-join
:right-join, :merge-right-join
:full-join, :merge-full-join
:cross-join, :merge-cross-join
:where, :merge-where
:group-by, :merge-group-by
:having, :merge-having
:limit
:offset
:modifiers, :merge-modifiers
:insert-into
:columns, :merge-columns
:values, :merge-values
:query-values
:update
:set
:delete-from
Takes a series of clause+data pairs and returns a SQL map. Example: (build :select [:a :b] :from :bar) Clauses are defined with the honeysql.helpers/build-clause multimethod. Built-in clauses include: :select, :merge-select, :un-select :from, :merge-from :join, :merge-join :left-join, :merge-left-join :right-join, :merge-right-join :full-join, :merge-full-join :cross-join, :merge-cross-join :where, :merge-where :group-by, :merge-group-by :having, :merge-having :limit :offset :modifiers, :merge-modifiers :insert-into :columns, :merge-columns :values, :merge-values :query-values :update :set :delete-from
(call name & args)
Represents a SQL function call. Name should be a keyword.
Represents a SQL function call. Name should be a keyword.
(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 next.jbc
and
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. :parameterizer - style of parameter naming, :postgresql, :jdbc or :none. Defaults to :jdbc. :return-param-names - when true, returns a vector of [sql-str param-values param-names]
Takes a SQL map and optional input parameters and returns a vector of a SQL string and parameters, as expected by `next.jbc` and `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. :parameterizer - style of parameter naming, :postgresql, :jdbc or :none. Defaults to :jdbc. :return-param-names - when true, returns a vector of [sql-str param-values param-names]
(format-predicate pred
&
{:keys [quoting parameterizer] :or {parameterizer :jdbc}})
Formats a predicate (e.g., for WHERE, JOIN, or HAVING) as a string.
Formats a predicate (e.g., for WHERE, JOIN, or HAVING) as a string.
(inline value)
Prevents parameterization
Prevents parameterization
(param name)
Represents a SQL parameter which can be filled in later
Represents a SQL parameter which can be filled in later
(qualify & qualifiers+name)
Takes one or more keyword or string qualifers and name. Returns a keyword of the concatenated qualifiers and name separated by periods.
(qualify :foo "bar" :baz) => :foo.bar.baz
Takes one or more keyword or string qualifers and name. Returns a keyword of the concatenated qualifiers and name separated by periods. (qualify :foo "bar" :baz) => :foo.bar.baz
(quote-identifier x & {:keys [style split] :or {split true}})
(raw s)
Represents a raw SQL string
Represents a raw SQL string
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close