Liking cljdoc? Tell your friends :D

cumin.core


defscopedcljmacro

(defscoped [name parent] & body)

Define entity name that merges all properties of parent before applying body

Define entity `name` that merges all properties of `parent` before applying `body`
sourceraw docstring

includecljmacro

(include query sub-ent m & body)

Eager load records with custom relationship mapping

(select person
  (include email {:id :email_id :as person_emails}
    (where {:valid true})))
```'
Eager load records with custom relationship mapping

```
(select person
  (include email {:id :email_id :as person_emails}
    (where {:valid true})))
```'
sourceraw docstring

post-orderclj

(post-order query f coll)

Setup post-query to order results based on f and coll any record where (f record) is not in coll will be appended in their original SQL ordering.

(select person
  (post-order :id [5 4 3 2 1]))
Setup post-query to order results based on `f` and `coll`
 any record where (f record) is not in `coll` will be appended
 in their original SQL ordering.

```
(select person
  (post-order :id [5 4 3 2 1]))
```
sourceraw docstring

re-orderclj

(re-order query field & [dir])

Remove any order clause from a query map and replace with [field dir]

(-> (select* person)
    (order :name)
    (re-order :id))
Remove any `order` clause from a query map and replace with `[field dir]`

```
(-> (select* person)
    (order :name)
    (re-order :id))
```
sourceraw docstring

scopecljmacro

(scope ent & body)

Apply a default query body for all queries executed for entity ent

(defentity teenager
  (table :person)
  (scope
    (where {:age [between [13 19]]})
    (order :name :desc)))
Apply a default query body for all queries executed for entity `ent`

```
(defentity teenager
  (table :person)
  (scope
    (where {:age [between [13 19]]})
    (order :name :desc)))
```
sourceraw docstring

scoped?clj

(scoped? ent)

Return true if Korma entity has a default scope applied

Return true if Korma entity has a default scope applied
sourceraw docstring

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

× close