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

Having a count method generated #115

Open
jaumard opened this issue Mar 18, 2019 · 1 comment
Open

Having a count method generated #115

jaumard opened this issue Mar 18, 2019 · 1 comment

Comments

@jaumard
Copy link
Contributor

jaumard commented Mar 18, 2019

Would be nice to have a count method generated to be able to count number of items from a where query a get a integer.

Because for now all we can do (a I know) is:

final items = await bean.findMany(bean.finder);
return items.length;

But it not optimized as you'll map all the objects just to get a count :/

Maybe there a better way @tejainece ?

@tejainece
Copy link
Member

@jaumard This is cool.

Jaguar_query already has count clause.

PR is welcome.

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

No branches or pull requests

2 participants