-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 some multirange operations support #4261
base: master
Are you sure you want to change the base?
add some multirange operations support #4261
Conversation
0fda44e
to
8430246
Compare
@@ -1779,7 +1790,7 @@ pub trait PgRangeExpressionMethods: Expression + Sized { | |||
impl<T> PgRangeExpressionMethods for T | |||
where | |||
T: Expression, | |||
T::SqlType: RangeOrNullableRange, | |||
T::SqlType: MultirangeOrRangeMaybeNullable, |
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.
I can't test without flipping this, and this allows all the range operations to accept multirange without proper test. What do the reviewers think? Can I merge the PR like that and add tests in the future in other small PRs, or should I add a multirange test for all the range methods?
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.
The correct way to handle this would be to split up this trait into two:
- The
PgRangeExpressionMethods
contains methods that are only available forRange
but not forMultiRange
. That is then only implemented forT::SqlType: RangeOrNullableRange
- The
PgRangeAndMultirangeMethods
contains methods that are available for both
(If there are methods that are only available for MultiRange
we would just add a third trait for that.)
I would prefer having at least one test for range + one for multirange for each of the supported methods.
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.
I did a fast check, and it looks like all the range operations are also multirange operations. If this is the case, do you still want to rename it to PgRangeAndMultirangeMethods
?
I will add the tests for each of the supported methods in this PR
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.
In this case it should be fine to keep the old name.
Add multirange contains support under #4240
It is a small test to check the format before moving everything else