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

Prisma Count API #81

Open
imsanchez opened this issue Aug 10, 2023 · 2 comments
Open

Prisma Count API #81

imsanchez opened this issue Aug 10, 2023 · 2 comments

Comments

@imsanchez
Copy link
Contributor

imsanchez commented Aug 10, 2023

Problem

The generator does not include the count API.

image

Use count to count the number of records or non-null field values. The following example query counts all users:

const userCount = await prisma.user.count()

https://www.prisma.io/docs/concepts/components/prisma-client/aggregation-grouping-summarizing#count

Suggested solution

I will create a pull request to add the API.

Alternatives

None I can think of as of now ~ open to suggestions.

Additional context

This was brought to our attention via ZenStack: zenstackhq/zenstack#618

@ymc9
Copy link

ymc9 commented Sep 3, 2023

Hi @imsanchez , have you already put any effort into this one? I'm wondering if I should start the work form ZenStack side.

@imsanchez
Copy link
Contributor Author

Sorry @ymc9 , I have not. Swamped with personal things and just got back. I saw you fixed it from the ZenStack side, thank you!! 🎉

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