kwrooijen / gungnir

A fully featured, data-driven database library for Clojure.

Home Page:https://kwrooijen.github.io/gungnir/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support non model building queries

kwrooijen opened this issue · comments

(-> (q/select :%count.*)
    (q/from :app)
    (q/all!))
;; ERROR: {:type :malli.core/invalid-schema, :data {:schema nil}}

The reason this breaks is because the default row builder expects rows to be returned from a query. In our selection we just want to count the amount of rows that have matched, returning an int. How can we solve this?

One option would be to add "raw" query functions. e.g. q/all!! which skips the rows builder. It might be nice to skip rows from being build if they are not part of the model. That might be challenging to do but it could be a good solution.