Skip to content
New issue

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

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

Already on GitHub? # to your account

Gen shortcut for COUNT(DISTINCT column_name) #1386

Open
renom opened this issue May 31, 2024 · 1 comment
Open

Gen shortcut for COUNT(DISTINCT column_name) #1386

renom opened this issue May 31, 2024 · 1 comment

Comments

@renom
Copy link
Contributor

renom commented May 31, 2024

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)
@stephenafamo
Copy link
Collaborator

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

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

No branches or pull requests

2 participants