Liking cljdoc? Tell your friends :D

honeysql.core


buildclj/s

(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
: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
    :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
sourceraw docstring

callclj/s≠

clj
(call name & args)

Represents a SQL function call. Name should be a keyword.

Represents a SQL function call. Name should be a keyword.
cljs
source (clj)source (cljs)raw docstring

formatclj/s≠

clj
(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. :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 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]
cljs
source (clj)source (cljs)raw docstring

format-predicateclj/s≠

clj
(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.
cljs
source (clj)source (cljs)raw docstring

inlineclj/s≠

clj
(inline value)

Prevents parameterization

Prevents parameterization
cljs
source (clj)source (cljs)raw docstring

paramclj/s≠

clj
(param name)

Represents a SQL parameter which can be filled in later

Represents a SQL parameter which can be filled in later
cljs
source (clj)source (cljs)raw docstring

qualifyclj/s

(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
sourceraw docstring

quote-identifierclj/s≠

clj
(quote-identifier x & {:keys [style split] :or {split true}})
cljs
source (clj)source (cljs)

rawclj/s≠

clj
(raw s)

Represents a raw SQL string

Represents a raw SQL string
cljs
source (clj)source (cljs)raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close