-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Easier counting with next.jdbc.sql/find-by-keys
#274
Comments
I'll think about it -- I really don't want to expand the "Friendly SQL Functions": I'd rather folks used HoneySQL for more complex SQL and |
Yes, agreed. I much appreciate Honey but in my current context, socially we decided to stick to |
How would you feel about this: (aggregate-by-keys ds :table "count(*)" :total where-map opts)
;; would call:
(-> (find-by-keys ds :table where-map (assoc opts :columns [["count(*)" :total]])) first :total) This would allow for more general aggregation. Perhaps the alias keyword ( |
Yes the Other than that, it looks reasonable to me! |
Nice, thank you! |
Is your feature request related to a problem? Please describe.
I'd like to sql-
count
more easily while usingfind-by-keys
.I can pass
:columns [["count(*)" :total]]
and then-> ,,, first :total
the result.But neither bit seems intuitive to me.
Describe the solution you'd like
An option in
find-by-keys
that translates to a count, maybe?Describe alternatives you've considered
A separate function in the same ns that takes similar options to
find-by-keys
, but that performs a count and returns a number (the count) rather than a coll of results.Thanks - V
The text was updated successfully, but these errors were encountered: