-
Notifications
You must be signed in to change notification settings - Fork 168
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
[#350] allow creation of unbounded Ranges #351
Conversation
org.jooq.lambda.tuple.Range class does not support nullable bounds. However in PostgreSQL a lower range bound of value 'null' means '-infinity'. See the [Range Types documentation](https://www.postgresql.org/docs/11/rangetypes.html#RANGETYPES-INFINITE): > The lower bound of a range can be omitted, meaning that all points less than the upper bound are included in the range. E.g. when testing that the range '(,3)' contains the value '-12': # SELECT '(,3)'::INT4RANGE @> -12; ?column? ---------- t (1 row)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR rejected because it combines multiple, unrelated changes in a single change, and because it implements range related API in Tuple2
where it does not belong.
Thanks a lot for your suggestions. There are too many review findings for this to be merged as it is. But I will take the following bits from your commits and integrate them in slightly changed ways:
Thanks again for taking the time to suggest an implementation. |
hey @lukaseder thanks for your time and comments/ So am I to submit corrected changes in another PR? or you are 'taking it from here' and use what's here to complete the change? Edit: Oh I've just seen your change on the issue. all good then |
I'm taking it from here.
That's what I thought at first, until I saw how much needed fixing, at which point the ping pong of getting PRs, reviewing, getting PRs, reviewing takes much more of both our time than just doing it myself.
Yep :) |
The class
org.jooq.lambda.tuple.Range
does not support nullable bounds.For example in PostgreSQL a lower range bound of value
null
means-infinity
.See the Range Types documentation:
E.g. when testing that the range
(,3)
contains the value-12
:What's left to do in this PR
I did not update the method
Tuple2.intersect
to handle null bounds, because it's a bit complicated, and I want to make sure that people support this PR before making this last effort 😄.Other possible improvements
intersect
andoverlaps
(in documentation "Range Functions and Operators")Usage example
For PostgreSQL type
tstzrange
:... And register the binding: