Liking cljdoc? Tell your friends :D

hugsql.parameters


apply-hugsql-parammultimethod

Implementations of this multimethod apply a hugsql parameter for a specified parameter type. For example:

(defmethod apply-hugsql-param :value [param data options] (value-param param data options)

  • the :value keyword is the parameter type to match on.
  • param is the parameter map as parsed from SQL (e.g., {:type :value :name "id"} )
  • data is the run-time parameter map data to be applied (e.g., {:id 42} )
  • options contain hugsql options (see hugsql.core/def-sqlvec-fns)

Implementations must return a vector containing any resulting SQL in the first position and any values in the remaining positions. (e.g., ["?" 42])

Implementations of this multimethod apply a hugsql parameter
for a specified parameter type.  For example:

(defmethod apply-hugsql-param :value
  [param data options]
  (value-param param data options)

- the :value keyword is the parameter type to match on.
- param is the parameter map as parsed from SQL
  (e.g., {:type :value :name "id"} )
- data is the run-time parameter map data to be applied
  (e.g., {:id 42} )
- options contain hugsql options (see hugsql.core/def-sqlvec-fns)

Implementations must return a vector containing any resulting SQL
in the first position and any values in the remaining positions.
(e.g., ["?" 42])
sourceraw docstring

deep-get-vec

(deep-get-vec nam)

Takes a param :name and returns a vector suitable for get-in lookups where the param :name starts with the form: :employees.0.id Names must be keyword keys in hashmaps in param data. Numbers must be vector indexes in vectors in param data.

Takes a param :name and returns a vector
suitable for get-in lookups where the
param :name starts with the form:
  :employees.0.id
Names must be keyword keys in hashmaps in
param data.
Numbers must be vector indexes in vectors
in param data.
sourceraw docstring

identifier-param-quote

(identifier-param-quote value
                        {:keys [quoting no-dot-split], :as options})

Quote the identifier value based on options.

Quote the identifier value based on options.
sourceraw docstring

IdentifierParamprotocol

Protocol to convert a Clojure value to SQL identifier

Protocol to convert a Clojure value to SQL identifier
identifier-param
(identifier-param param data options)
sourceraw docstring

IdentifierParamListprotocol

Protocol to convert a collection of Clojure values to SQL identifiers

Protocol to convert a collection of Clojure
values to SQL identifiers
identifier-param-list
(identifier-param-list param data options)
sourceraw docstring

SQLParamprotocol

Protocol to convert a Clojure value to raw SQL

Protocol to convert a Clojure value to raw SQL
sql-param
(sql-param param data options)
sourceraw docstring

SQLVecParamprotocol

Protocol to splice in an sqlvec (or snippet)

Protocol to splice in an sqlvec (or snippet)
sqlvec-param
(sqlvec-param param data options)
sourceraw docstring

SQLVecParamListprotocol

Protocol to splice in a collection of sqlvecs (or snippets)

Protocol to splice in a collection of sqlvecs (or snippets)
sqlvec-param-list
(sqlvec-param-list param data options)
sourceraw docstring

TupleParamprotocol

Protocol to convert a collection of Clojure values to an SQL tuple. Similar to a ValueParamList, but a TupleParam encloses its values in parentheses.

Protocol to convert a collection of Clojure
values to an SQL tuple. Similar to a ValueParamList,
but a TupleParam encloses its values in parentheses.
tuple-param
(tuple-param param data options)
sourceraw docstring

TupleParamListprotocol

Protocol to convert a collection of collections of Clojure values to an SQL list of tuples. This is used specifically for multiple-record SQL inserts.

Protocol to convert a collection of collections of
Clojure values to an SQL list of tuples.  This is
used specifically for multiple-record SQL inserts.
tuple-param-list
(tuple-param-list param data options)
sourceraw docstring

ValueParamprotocol

Protocol to convert Clojure value to SQL value

Protocol to convert Clojure value to SQL value
value-param
(value-param param data options)
sourceraw docstring

ValueParamListprotocol

Protocol to convert a collection of Clojure values to SQL values. Similar to a TupleParam, but a ValueParamList does NOT enclose its values in parentheses. Generally ValueParamList values are of the same type.

Protocol to convert a collection of Clojure
values to SQL values. Similar to a TupleParam,
but a ValueParamList does NOT enclose its values
in parentheses.  Generally ValueParamList values
are of the same type.
value-param-list
(value-param-list param data options)
sourceraw docstring

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

× close