Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support Range<NaiveDate> for daterange#18

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
the-kenny wants to merge6 commits intorust-postgres:master
base:master
Choose a base branch
Loading
fromthe-kenny:date-ranges

Conversation

the-kenny
Copy link

This implementsNormalizable forNaiveDate to supportRange<Date>. It also changesassert! toassert_eq! in a few places to improve the test output.

Note that I had to#[ignore] the new test I added because Postgres normalises(2023-01-01,) to[2023-01-02,), which makes the test fail astest_types does a by-value comparison.

> The built-in range types int4range, int8range,> and daterange all use a canonical form that> includes the lower bound and excludes the upper> bound; that is, [).https://www.postgresql.org/docs/current/rangetypes.html#RANGETYPES-DISCRETEThis is implemented by modifying the`bounded_normalize` macro to take a `$delta`expression (`1` for `i32` and `i64`,`Duration::days(1)` for `NaiveDate`).
@the-kenny
Copy link
Author

@sfackler I finally got around to fixingNormalize :-) Could I ask you to have another look when your time permits?

@lgrosz
Copy link

Will this get merged?

lgrosz added a commit to lgrosz/climb-graphql that referenced this pull requestMar 24, 2025
This _does not_ add the date window support, yet. This is because thereis not a great native rust-postgres way of getting PostgreSQLs DATERANGEtype. Looks like there'srust-postgres/rust-postgres-range#18, but it hasn'tbeen merged in a year and the general state of rust-postgres-range seemsunmaintained.. perhaps@tkbrigham has a good point inrust-postgres/rust-postgres#601.. it'd be great if all the PostgreSQLfeatures were supported in rust-postgres directly.
lgrosz added a commit to lgrosz/climb-graphql that referenced this pull requestMar 24, 2025
This _does not_ add the date window support, yet. This is because thereis not a great native rust-postgres way of getting PostgreSQLs DATERANGEtype. Looks like there'srust-postgres/rust-postgres-range#18, but it hasn'tbeen merged in a year and the general state of rust-postgres-range seemsunmaintained.. perhaps@tkbrigham has a good point inrust-postgres/rust-postgres#601.. it'd be great if all the PostgreSQLfeatures were supported in rust-postgres directly.
lgrosz added a commit to lgrosz/climb-graphql that referenced this pull requestMar 25, 2025
This _does not_ add the date window support, yet. This is because thereis not a great native rust-postgres way of getting PostgreSQLs DATERANGEtype. Looks like there'srust-postgres/rust-postgres-range#18, but it hasn'tbeen merged in a year and the general state of rust-postgres-range seemsunmaintained.. perhaps@tkbrigham has a good point inrust-postgres/rust-postgres#601.. it'd be great if all the PostgreSQLfeatures were supported in rust-postgres directly.
lgrosz added a commit to lgrosz/climb-graphql that referenced this pull requestMar 28, 2025
This _does not_ add the date window support, yet. This is because thereis not a great native rust-postgres way of getting PostgreSQLs DATERANGEtype. Looks like there'srust-postgres/rust-postgres-range#18, but it hasn'tbeen merged in a year and the general state of rust-postgres-range seemsunmaintained.. perhaps@tkbrigham has a good point inrust-postgres/rust-postgres#601.. it'd be great if all the PostgreSQLfeatures were supported in rust-postgres directly.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@sfacklersfacklersfackler left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@the-kenny@lgrosz@sfackler

[8]ページ先頭

©2009-2025 Movatter.jp