Git Product home page Git Product logo

Comments (6)

KazimirPodolski avatar KazimirPodolski commented on September 22, 2024 1

Yeah going to do just that.

from pg-aggregates.

benjie avatar benjie commented on September 22, 2024

Wrapping the table expression has a couple disadvantages:

  • It's likely to perform less well in some circumstances
  • It needs to be select my_table.* from my_table ... and select my_table.* will break queries for people using column-level select grants

Instead, it would need to be done in the aggregates themselves.

This is not something I'm particularly interested in taking on right now, but if you wanted to take a punt at it along with the accompanying tests (and make sure the tests pass against PG10-14) and benchmark, that would give a significant leg up to this being something that we could merge. And even if we didn't merge it, you could use your custom plugin with PostGraphile, so your work would not be in vain 👍

from pg-aggregates.

KazimirPodolski avatar KazimirPodolski commented on September 22, 2024

It's likely to perform less well in some circumstances

True, still I think the one who wants ordering is willing to take a trade-off instead of not having it at all.

It needs to be select my_table.* from my_table ... and select my_table.* will break queries for people using column-level select grants

🤔 never had the chance to use that feature of postgres.

Instead, it would need to be done in the aggregates themselves.

Yeah that is probably the most straightforward way, tho some people advice against it when you have more than one aggregate (they have something about it in the thread). Still better than no ordering at all IMO.

I'm very limited about the time I can spend on that, probably I won't be able to make right proper PR.

from pg-aggregates.

benjie avatar benjie commented on September 22, 2024

You're probably best forking this plugin and adding in the more direct logic yourself; that wouldn't be merged into this project for the reasons outlined, but it may suffice for your needs 👍

from pg-aggregates.

KazimirPodolski avatar KazimirPodolski commented on September 22, 2024

@benjie Is the any way to get a result of addArgDataGenerator for given type, from some hook? I'm trying to add ordering to AddConnectionGroupedAggregatesPlugin other way but copy-pasting that. I've added orderBy arg to AggregateContainerType typed with table's orderBy type (e.g. MatchesOrderBy to MatchAggregates), but I cannot get original SQL query building function for the ordering type. I've tried to look for a way to get pgQuery function from runtime stuff available to the field hook, but no luck. The closest thing I see is fieldArgDataGeneratorsByFieldNameByType, but all values there are just empty objects.

from pg-aggregates.

benjie avatar benjie commented on September 22, 2024

I don't really know; I'd have to spend some time figuring that out - I've not worked in the lookahead engine for a while and it's... not obvious 😉

from pg-aggregates.

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.