kysely-org / kysely

A type-safe typescript SQL query builder
https://kysely.dev
MIT License
10.53k stars 270 forks source link

Add orderBy clause support to aggregate function builder #896

Closed ivashog closed 2 weeks ago

ivashog commented 7 months ago

780

see sql syntax on PostgreSQL example: https://www.postgresql.org/docs/16/sql-expressions.html#SYNTAX-AGGREGATES

vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kysely ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 8:19pm
igalklebanov commented 7 months ago

Hey 👋

Thanks! 💪

This is also supported in MySQL and SQLite for some aggregate functions. Let's add tests for those.

ivashog commented 7 months ago

Hey

Thanks, @igalklebanov

I follow your recommendation and add a separate test case for order-sensitive aggregate functions including mysql and sqlite.

Also I explore this functionality in mssql and discovered that we need implement within group (order by ...) clause support for aggregate functions - #781. But it is better to implement it in a separate PR, what do you say?

igalklebanov commented 5 months ago

But it is better to implement it in a separate PR, what do you say?

Yeah, different clause, different PR.

ivashog commented 5 months ago

Looks good and functional overall! 💪

Left a few minor suggestions, once addressed this is good to go! 🚀

@igalklebanov, thanks for review!

juusaw commented 1 month ago

Any plans to release this feature? It would be really useful for us.