synth
synth copied to clipboard
Support `tstzrange` for PostgreSQL
Required Functionality
I want to use synth on a PostgreSQL DB, however, it does not feature a converter for tstzrange.
Proposed Solution
Implement a converter for tstzrange.
Use case
I really want to use synth, but currently I'm blocked :)
@JonasCir thanks for the suggestion!!
I am not familiar with the range PostgreSQL type though. It seems like it stores the two numbers (lower and upper) of a range? And then all the values in the range is represented by the range?
https://www.postgresql.org/docs/current/rangetypes.html
Seems like it :D An entry in the table has a
- subtype (integer, bigint, numeric, timestamp without TZ, timestamp with TZ, date)
- lower bound
- upper bound where
- bounds can be inclusive or exclusive
- bounds can be removed, meaning they are infinite
So generation appears to be a random choice of bounds for the subtype.
fake-rs seems to support DateTimeBetween which goes into the right direction, we need the same for timestamps with timezone, however.
This would be required before we can use Synth for our projects. We use this tstzrange values in a lot of places. I don't know if you would need to support the more generic range types.