Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add agg method @ FunctionModule to allow AggregateFunctionBuilder usage outside of built-ins. #417

Merged
merged 4 commits into from
May 13, 2023

Conversation

igalklebanov
Copy link
Member

@igalklebanov igalklebanov commented Apr 8, 2023

as discussed in #397.

This PR adds the ability to use AggregateFunctionBuilder's methods without a built-in aggregate function method (e.g. sum), using eg.fn.agg(name, [args]) which is inspired by eb.fn(name, [args]).

db.selectFrom('person')
  .select(({ fn }) => [
    fn.agg<number>('rank').over().as('rank'),
    fn.agg<string>('group_concat', ['first_name']).distinct().as('first_names')
  ])

breaking changes:

  • internal: aggregate function node structure.

@igalklebanov igalklebanov added enhancement New feature or request api Related to library's API breaking change Includes breaking changes labels Apr 8, 2023
@igalklebanov igalklebanov marked this pull request as ready for review April 8, 2023 16:12
@vercel
Copy link

vercel bot commented Apr 18, 2023

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 May 13, 2023 7:33am

Copy link
Member

@koskimas koskimas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flawless yet again! You, sir, are a legend! 🎩

@koskimas koskimas merged commit 87a6d24 into kysely-org:master May 13, 2023
@igalklebanov igalklebanov deleted the eb.fn.agg branch May 13, 2023 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to library's API breaking change Includes breaking changes enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants