hugsql.parameters

apply-hugsql-param

multimethod

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])

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.

identifier-param-quote

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

IdentifierParam

protocol

Protocol to convert a Clojure value to SQL identifier

members

identifier-param

(identifier-param param data options)

IdentifierParamList

protocol

Protocol to convert a collection of Clojure
values to SQL identifiers

members

identifier-param-list

(identifier-param-list param data options)

SQLParam

protocol

Protocol to convert a Clojure value to raw SQL

members

sql-param

(sql-param param data options)

SQLVecParam

protocol

Protocol to splice in an sqlvec (or snippet)

members

sqlvec-param

(sqlvec-param param data options)

SQLVecParamList

protocol

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

members

sqlvec-param-list

(sqlvec-param-list param data options)

TupleParam

protocol

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

members

tuple-param

(tuple-param param data options)

TupleParamList

protocol

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.

members

tuple-param-list

(tuple-param-list param data options)

ValueParam

protocol

Protocol to convert Clojure value to SQL value

members

value-param

(value-param param data options)

ValueParamList

protocol

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.

members

value-param-list

(value-param-list param data options)