(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.
(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.
(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.
(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))
(current-db-version)Determines the current database version.
Determines the current database version.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |