Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support non model building queries #37

Open
kwrooijen opened this issue Feb 3, 2021 · 0 comments
Open

Support non model building queries #37

kwrooijen opened this issue Feb 3, 2021 · 0 comments

Comments

@kwrooijen
Copy link
Owner

kwrooijen commented Feb 3, 2021

(-> (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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant