Comments (6)
Yeah going to do just that.
from pg-aggregates.
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 ...
andselect 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.
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 ...
andselect 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.
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.
@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.
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)
- Aggregates provide null values HOT 5
- aggregates throwing "null" all the time HOT 1
- TIMESTAMP_TRUNCATED_TO_MONTH & TIMESTAMP_TRUNCATED_TO_YEAR HOT 23
- Cannot get the given example to work HOT 3
- Filtering by totalCount HOT 3
- Getting - Error: Option 'appendPlugins' should be an array of functions, found 'object' at index 0 HOT 3
- Looks like aggregate order bys get generated even when table is omitted HOT 1
- GroupBy computed columns not generated ? HOT 4
- Removing limitation of stringified `keys` HOT 3
- Order by totalCount with per-query custom filtering applied HOT 2
- Aggregates can return unsafe integers HOT 8
- pg-aggregates plugin doesn't work without postgraphile-plugin-connection-filter in V5 HOT 1
- Too few types are exported in V5 plugin HOT 1
- Aggregate keys should be nullable HOT 1
- This repository needs tests
- What's the best way to aggregate on duration? HOT 4
- Update docs around custom plugins for V5 HOT 5
- groupedAggregates should use their own behavior
- Supporting user-defined aggregate functions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pg-aggregates.