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

Extend range functions to support nullable and multirange #4193

Merged
merged 10 commits into from
Aug 23, 2024

Conversation

guissalustiano
Copy link
Contributor

@guissalustiano guissalustiano commented Aug 22, 2024

This PR extends the range functions to suportt multirange and nullable types, folowing the behavior of the postgres functions

Please review after #4182 and #4179 be merged

@guissalustiano guissalustiano marked this pull request as ready for review August 22, 2024 22:39
Copy link
Member

@weiznich weiznich left a comment

Choose a reason for hiding this comment

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

Thanks for unifying these functions. The change looks mostly fine, but I think we miss a helper type for multirange_merge + a test case for #[auto_type] for this function.

/// # Ok(())
/// # }
/// ```
#[cfg(feature = "postgres_backend")]
fn range_merge<T1: RangeHelper, T2: RangeHelper<Inner = T1::Inner>>(lhs: T1, rhs: T2) -> Range<T1::Inner>;
#[sql_name = "range_merge"]
fn multirange_merge<R: MultirangeOrNullableMultirange + SingleValue>(multirange: R) -> R::Range;
Copy link
Member

Choose a reason for hiding this comment

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

We need to add a helper type definition for this new function + a test variant in the #[auto_type] test case module.

Copy link
Contributor Author

@guissalustiano guissalustiano Aug 23, 2024

Choose a reason for hiding this comment

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

Thanks! for the review. I updated that.

Copy link
Member

@weiznich weiznich left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@weiznich weiznich enabled auto-merge August 23, 2024 13:47
@weiznich weiznich added this pull request to the merge queue Aug 23, 2024
Merged via the queue into diesel-rs:master with commit faaf4e8 Aug 23, 2024
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants