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

make FunctionModule's avg, max, min & sum functions nullable (consumer opt-in). #183

Merged
merged 6 commits into from
Oct 17, 2022

Conversation

igalklebanov
Copy link
Member

@igalklebanov igalklebanov commented Oct 6, 2022

These aggregate functions are nullable, in some edge cases.

Current types:

a. are a lie, if some edge cases are possible in consumer's queries / state of database.
b. do not allow our consumers to state null as a possible return type.

Let's help our consumers write robust code, by allowing them to opt-in for the stricter nullable form.

Should fit smooth like 🧈 with recently merged .coalesce(...) function.


  • implement type changes.
  • fix typings tests.

@igalklebanov igalklebanov added the enhancement New feature or request label Oct 6, 2022
@igalklebanov igalklebanov changed the title open up FunctionModules's avg, max, min & sum to null return value. open up FunctionModule's avg, max, min & sum to null return value. Oct 6, 2022
@igalklebanov igalklebanov changed the title open up FunctionModule's avg, max, min & sum to null return value. open up FunctionModule's avg, max, min & sum functions to null return value. Oct 6, 2022
@igalklebanov igalklebanov added the typescript Related to Typescript label Oct 12, 2022
@igalklebanov igalklebanov marked this pull request as ready for review October 16, 2022 21:00
@igalklebanov igalklebanov changed the title open up FunctionModule's avg, max, min & sum functions to null return value. make FunctionModule's avg, max, min & sum nullable (consumer opt-in). Oct 16, 2022
@igalklebanov igalklebanov changed the title make FunctionModule's avg, max, min & sum nullable (consumer opt-in). make FunctionModule's avg, max, min & sum functions nullable (consumer opt-in). Oct 16, 2022
@igalklebanov igalklebanov requested a review from koskimas October 16, 2022 21:03
@igalklebanov
Copy link
Member Author

Sorry about docs, hope its fine now.. 😅

@igalklebanov igalklebanov requested a review from koskimas October 17, 2022 06:45
@koskimas
Copy link
Member

Thanks!

@koskimas koskimas merged commit 24779b3 into kysely-org:master Oct 17, 2022
@igalklebanov igalklebanov deleted the null-aggregates branch October 17, 2022 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request typescript Related to Typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants