#586 added aggregate pushdown and the native wrappers got wired up (#596 for MySQL), but Wasm wrappers can't see any of it — types.wit only has quals, sorts and limit, so a guest never knows it's serving an aggregate.
Ran into this with the Langfuse wrapper from #622. select name, sum(total_cost) ... group by name paginates every trace and sums locally, even though the upstream API does it in one call:
GET /api/public/metrics?query={"view":"traces","dimensions":[{"field":"name"}],"metrics":[{"measure":"totalCost","aggregation":"sum"}]}
Is this on the roadmap, or out of scope on purpose? It'd be a breaking change to the WIT so I didn't want to just show up with a PR. Happy to take it on if you want it.
#586 added aggregate pushdown and the native wrappers got wired up (#596 for MySQL), but Wasm wrappers can't see any of it —
types.witonly has quals, sorts and limit, so a guest never knows it's serving an aggregate.Ran into this with the Langfuse wrapper from #622.
select name, sum(total_cost) ... group by namepaginates every trace and sums locally, even though the upstream API does it in one call:Is this on the roadmap, or out of scope on purpose? It'd be a breaking change to the WIT so I didn't want to just show up with a PR. Happy to take it on if you want it.