jaguar_orm icon indicating copy to clipboard operation
jaguar_orm copied to clipboard

Having a count method generated

Open jaumard opened this issue 5 years ago • 1 comments

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 ?

jaumard avatar Mar 18 '19 10:03 jaumard

@jaumard This is cool.

Jaguar_query already has count clause.

PR is welcome.

tejainece avatar Mar 18 '19 16:03 tejainece