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

Merged
merged 24 commits into from
Jan 5, 2025

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 Jan 5, 2025 10:46pm

@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.

igalklebanov and others added 16 commits December 8, 2024 19:42
…kysely-org#1085)

* add reusable helpers recipe and implement missing expression features

* force node 22.4.1 in CI because of an npm bug
* feat: add postgres range types (kysely-org#1086)

* feat: support refresh naterialized view

* fix tests by adding .materialized() to remove the matview

* fix failing test

* fix: References typo (kysely-org#1092)

* chore: refresh-view-node.ts => refresh-materialized-view-node.ts

* chore: export node in index.ts

---------

Co-authored-by: Isak <16906089+kansson@users.noreply.github.com>
Co-authored-by: Jonathan Wu <jonathanwu70@gmail.com>
Co-authored-by: Igal Klebanov <igal@grainfinance.co>
* feat: empty where in plugin

* test: add new tests

* chore: remove unneccesary typeguards

* fix: change to binary operator node

* test: update tests to do both in and not in

* test: for having

* chore: rm test

* test: nullable tests

* chore: nit

* chore: condense suite

* chore: db config override

* chore: extra console log

* chore: empty arr plugin docs

* HandleEmptyInListsPlugin initial commit.

Co-authored-by: Austin Woon Quan <43132101+austinwoon@users.noreply.github.com>

---------

Co-authored-by: Austin Woon <austin@open.gov.sg>
Co-authored-by: igalklebanov <igalklebanov@gmail.com>
@igalklebanov igalklebanov changed the base branch from master to v0.28 January 5, 2025 11:19
Co-authored-by: Sam Clearman <238164+samclearman@users.noreply.github.com>
Co-authored-by: Sam Clearman <238164+samclearman@users.noreply.github.com>
Co-authored-by: Sam Clearman <238164+samclearman@users.noreply.github.com>
@igalklebanov igalklebanov added mysql Related to MySQL sqlite Related to sqlite mssql Related to MS SQL Server (MSSQL) labels Jan 5, 2025
@igalklebanov igalklebanov merged commit 5e5c463 into kysely-org:v0.28 Jan 5, 2025
22 checks passed
@igalklebanov
Copy link
Member

Pushed this through the finish line. Thanks for raising this. 🙏

@igalklebanov igalklebanov self-assigned this Jan 5, 2025
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 mssql Related to MS SQL Server (MSSQL) mysql Related to MySQL postgres Related to PostgreSQL sqlite Related to sqlite typescript Related to Typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants