pgrx icon indicating copy to clipboard operation
pgrx copied to clipboard

PgRange<T> type support

Open mhov opened this issue 3 years ago • 6 comments
trafficstars

Mapping for PgRange<T> type

PgRange<T> maps to the PG *RangeType and provides mappings for int4range int8range daterange numrange tsrange and tstzrange

This does not yet include pg14 multirange variations

Note: work on mappings for std::ops::Range<T> is commented out for now as std::ops::Range<T> would only support "half-open" ranges (ex. [1..10)) with non-infinite bounds, and only on discrete types (to allow for [) pg's range canonicalization) so utility is very limited. Need to explore possibility of dyn RangeBounds<T> to handle all the different range possibilities (..] [..] (..) [..) (,)

Also:

Added infinity/-infinity support for Date, Timestamp, TimestampWithTimeZone

mhov avatar Aug 10 '22 22:08 mhov

I still need to include some inline documentation

mhov avatar Aug 10 '22 22:08 mhov

It looks like you ran the option to regenerate the bindings for docs.rs! That's 100% okay, but could I ask you to revert those changes for merging here? We prefer to do that all at once on release to avoid them constantly being regenerated due to different people having different postgres headers.

Hoverbear avatar Aug 11 '22 00:08 Hoverbear

@Hoverbear just checking that this branch would not be buildable/testable (outside of my local) until merged with a full release?

mhov avatar Aug 11 '22 00:08 mhov

@mhov:

just checking that this branch would not be buildable/testable (outside of my local) until merged with a full release?

As the publicly displayed bindings are mostly decorative, diffing them or not should have no effect on actually building the "develop" branch for end users.

workingjubilee avatar Aug 11 '22 00:08 workingjubilee

Got it, i forgot that you'll generate them locally when you build anyways.

mhov avatar Aug 11 '22 00:08 mhov

ok re-committed with the pgXX.rs changes omitted, keeping the pgXX.h changes.

mhov avatar Aug 11 '22 01:08 mhov

Parking this PR for now until the proper fixes for Date/Timestamp infinity values are completed.

mhov avatar Aug 15 '22 23:08 mhov