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 Date as a valid return type for max and min #1062

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

samclearman
Copy link

At least with postgres / pg, it's possible for the value of a field generated by the max and min functions to be a Date. This PR updates the constraints on the types of these functions to reflect that.

Copy link

vercel bot commented Jun 26, 2024

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 Jul 14, 2024 9:30am

@igalklebanov igalklebanov added enhancement New feature or request postgres Related to PostgreSQL api Related to library's API typescript Related to Typescript labels Jun 26, 2024
@igalklebanov
Copy link
Member

igalklebanov commented Jul 14, 2024

Hey 👋

Thanks! 💪

Let's add a unit test case that verifies a Date is returned by pg @ https://github.com/kysely-org/kysely/blob/master/test/node/src/aggregate-function.test.ts.
Let's add type-only test cases @ https://github.com/kysely-org/kysely/blob/master/test/typings/test-d/aggregate-function.test-d.ts.

Copy link
Member

@igalklebanov igalklebanov Jul 14, 2024

Choose a reason for hiding this comment

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

Should also add Date to the fallback unions in L536 and L595.

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 enhancement New feature or request postgres Related to PostgreSQL typescript Related to Typescript waiting for submitter response
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants