Liking cljdoc? Tell your friends :D

hugsql.parameters


apply-hugsql-paramcljmultimethod

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 an sqlvec: a vector containing the resulting SQL string 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 an sqlvec: a vector containing the resulting
SQL string in the first position and any values in the remaining positions.
(e.g., `["?" 42]`)
raw docstring

deep-get-vecclj

(deep-get-vec nam)

Takes a parameter name and returns a vector suitable for get-in lookups where the 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 parameter name and returns a vector
suitable for get-in lookups where the 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.
raw docstring

identifier-param-quoteclj

(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.
raw docstring

IdentifierParamcljprotocol

Protocol to convert a Clojure value to SQL identifier

Protocol to convert a Clojure value to SQL identifier

identifier-paramclj

(identifier-param param data options)
raw docstring

IdentifierParamListcljprotocol

Protocol to convert a collection of Clojure values to SQL identifiers

Protocol to convert a collection of Clojure
values to SQL identifiers

identifier-param-listclj

(identifier-param-list param data options)
raw docstring

SQLParamcljprotocol

Protocol to convert a Clojure value to raw SQL

Protocol to convert a Clojure value to raw SQL

sql-paramclj

(sql-param param data options)
raw docstring

SQLVecParamcljprotocol

Protocol to splice in an sqlvec (or snippet)

Protocol to splice in an sqlvec (or snippet)

sqlvec-paramclj

(sqlvec-param param data options)
raw docstring

SQLVecParamListcljprotocol

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

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

sqlvec-param-listclj

(sqlvec-param-list param data options)
raw docstring

TupleParamcljprotocol

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-paramclj

(tuple-param param data options)
raw docstring

TupleParamListcljprotocol

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-listclj

(tuple-param-list param data options)
raw docstring

ValueParamcljprotocol

Protocol to convert Clojure value to SQL value

Protocol to convert Clojure value to SQL value

value-paramclj

(value-param param data options)
raw docstring

ValueParamListcljprotocol

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-listclj

(value-param-list param data options)
raw docstring

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

× close