Liking cljdoc? Tell your friends :D
Clojure only.

toucan2.tools.identity-query


identity-queryclj

(identity-query reducible-rows)

A queryable that returns reducible-rows as-is without compiling anything or running anything against a database. Good for mocking stuff.

(def parrot-query
  (identity-query [{:id 1, :name "Parroty"}
                   {:id 2, :name "Green Friend"}]))

(select/select ::parrot parrot-query)
=>
[(instance ::parrot {:id 1, :name "Parroty"})
 (instance ::parrot {:id 2, :name "Green Friend"})]
A queryable that returns `reducible-rows` as-is without compiling anything or running anything against a database.
Good for mocking stuff.

```clj
(def parrot-query
  (identity-query [{:id 1, :name "Parroty"}
                   {:id 2, :name "Green Friend"}]))

(select/select ::parrot parrot-query)
=>
[(instance ::parrot {:id 1, :name "Parroty"})
 (instance ::parrot {:id 2, :name "Green Friend"})]
```
sourceraw docstring

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

× close