Liking cljdoc? Tell your friends :D

kameleon.queries


add-query-limitclj

(add-query-limit select_query limit_val)

Returns select_query with a LIMIT clause added if limit_val is more than 0; otherwise the original select_query is returned.

Returns select_query with a LIMIT clause added if limit_val is more than 0;
otherwise the original select_query is returned.
raw docstring

add-query-offsetclj

(add-query-offset select_query offset_val)

Returns select_query with an OFFSET clause added if offset_val is 0 or more; otherwise the original select_query is returned.

Returns select_query with an OFFSET clause added if offset_val is 0 or more;
otherwise the original select_query is returned.
raw docstring

add-query-sortingclj

(add-query-sorting select_query sort-field sort-dir)

Returns select_query with an ORDER BY clause added if sort-field is not nil; otherwise the original select_query is returned.

Returns select_query with an ORDER BY clause added if sort-field is not nil;
otherwise the original select_query is returned.
raw docstring

conditional-wherecljmacro

(conditional-where query condition-form clause-form)

Adds a where clause to a query only if the specified condition is met. For example, suppose that you have a function that lists orders, optionally filtering orders by customer ID. Something like this might work for that:

(defn list-orders [customer-id] (-> (select* :orders) (conditional-where customer-id {:customer_id customer-id}) select))

Adds a where clause to a query only if the specified condition is met. For example, suppose
that you have a function that lists orders, optionally filtering orders by customer ID.
Something like this might work for that:

  (defn list-orders [customer-id]
    (-> (select* :orders)
        (conditional-where customer-id {:customer_id customer-id})
        select))
raw docstring

current-db-versionclj

(current-db-version)

Determines the current database version.

Determines the current database version.
raw docstring

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

× close