sqlboiler icon indicating copy to clipboard operation
sqlboiler copied to clipboard

Gen shortcut for `COUNT(DISTINCT column_name)`

Open renom opened this issue 1 year ago • 1 comments

There's Count method that is generated for a table:

Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) // performs COUNT(*)

It'd be useful to have CountDistinct method:

CountDistinct(ctx context.Context, exec boil.ContextExecutor, column string) (int64, error) // performs COUNT(DISTINCT column)

renom avatar May 31 '24 13:05 renom

If you send in a PR, I'll be happy to review.

stephenafamo avatar Jun 01 '24 00:06 stephenafamo