Giter VIP home page Giter VIP logo

Comments (6)

RobertCraigie avatar RobertCraigie commented on May 20, 2024 1

@HKGx Not yet, although this is not a difficult change. I'll work on it now.

from prisma-client-py.

HKGx avatar HKGx commented on May 20, 2024

any updates?

from prisma-client-py.

RobertCraigie avatar RobertCraigie commented on May 20, 2024

@HKGx Do you need to also query by _count, _avg, _sum, _min or _max? (https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#groupby)

I forgot about these aggregation fields before mentioning that this is not a difficult change. Adding support for querying by these fields is more difficult due to internal features that I haven't implemented yet. If you don't need these, I can prioritise getting an initial proof of concept implemented which you would be able to use until the next release.

from prisma-client-py.

HKGx avatar HKGx commented on May 20, 2024

@RobertCraigie I'd say so as I'm currently doing

SELECT field, COUNT(field) FROM table GROUP BY field

Not sure how it applies to Prisma, though.

from prisma-client-py.

RobertCraigie avatar RobertCraigie commented on May 20, 2024

@HKGx You would be correct, I'll see what I can do.

For reference, the missing internal feature is serializing queries for selecting fields (#19).

from prisma-client-py.

RobertCraigie avatar RobertCraigie commented on May 20, 2024

@HKGx I've added the initial support for this feature.

You can try it out by installing from the wip/group-by branch:

pip install -U git+https://github.com/RobertCraigie/prisma-client-py@wip/group-by

It should be noted that the group_by method returns a TypedDict, not a BaseModel.

This is also very much a work in progress, please let me know if you encounter any issues.

from prisma-client-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.