You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe. pgx defines a Range[T] type that can be used to store PostgreSQL ranges. I use the ranges in a CopyFrom call, but sometimes the call contains one or more overlapping ranges that are not allowed in my table definition. Therefore, the whole CopyFrom fails. It would be helpful if I could use the functions/operators as defined in https://www.postgresql.org/docs/current/functions-range.html to check the records I have before insert. I could imagine that for other use cases other functions/operators are helpful if they can be applied already in Go.
Describe the solution you'd like
I would like to add these functions in a file range_functions.go and range_functions_test.go in the pgtype package. Would you include these in pgx (pull request) or is it better to make a separate project for these functions?
Describe alternatives you've considered
A separate project that uses pgtype.Range[T].
The text was updated successfully, but these errors were encountered:
I think this would make sense as a separate project at least to start. It might even make sense to have these types be independent of pgtype.Range[T]. Range types and functionality would be useful in Go independent of PostgreSQL. They could be modeled off of the PostgreSQL system. And an adapter could be made that implements RangeValuer and RangeScanner. This would let the projects integrate without direct dependencies. For example, it would be like the shopspring/decimal package is used with pgx.
Is your feature request related to a problem? Please describe.
pgx
defines aRange[T]
type that can be used to store PostgreSQL ranges. I use the ranges in aCopyFrom
call, but sometimes the call contains one or more overlapping ranges that are not allowed in my table definition. Therefore, the wholeCopyFrom
fails. It would be helpful if I could use the functions/operators as defined in https://www.postgresql.org/docs/current/functions-range.html to check the records I have before insert. I could imagine that for other use cases other functions/operators are helpful if they can be applied already in Go.Describe the solution you'd like
I would like to add these functions in a file
range_functions.go
andrange_functions_test.go
in thepgtype
package. Would you include these inpgx
(pull request) or is it better to make a separate project for these functions?Describe alternatives you've considered
A separate project that uses
pgtype.Range[T]
.The text was updated successfully, but these errors were encountered: