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

feat: use undefined as bottom value instead of null #278

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

soedirgo
Copy link
Member

BREAKING CHANGE: use undefined as bottom value instead of null

@soedirgo soedirgo requested review from inian and kiwicopple May 31, 2022 19:19
@soedirgo soedirgo force-pushed the BREAK/nullsfirst branch from 56a6677 to 1ff92c6 Compare June 1, 2022 06:12
@soedirgo soedirgo force-pushed the BREAK/null-to-undefined branch from cf14f43 to b192307 Compare June 1, 2022 06:42
@steve-chavez
Copy link
Member

Why is this needed?

@soedirgo
Copy link
Member Author

soedirgo commented Jun 7, 2022

Here's the discussion on this: supabase/supabase-js#244. Basically it doesn't make sense to treat null as a sentinel value when undefined is already implied for optional fields. E.g. null is redundant in count?: null | 'exact' | ... because it also accepts undefined anyway.

Note that this change only applies to function args etc. - it doesn't modify PostgREST's response at all. That way it's more consistent in that the absence of value in the JS part is undefined while null is only ever used to represent a Postgres null, e.g. for the .is() filter.

BREAKING CHANGE: use undefined as bottom value instead of null
@soedirgo soedirgo force-pushed the BREAK/nullsfirst branch from 1ff92c6 to 2305330 Compare June 7, 2022 06:24
@soedirgo soedirgo force-pushed the BREAK/null-to-undefined branch from b192307 to 628be73 Compare June 7, 2022 06:24
Base automatically changed from BREAK/nullsfirst to next June 7, 2022 06:25
@soedirgo soedirgo merged commit 3ac4acb into next Jun 8, 2022
@soedirgo soedirgo deleted the BREAK/null-to-undefined branch June 13, 2022 07:08
@github-actions
Copy link

🎉 This PR is included in version 1.0.0-next.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants