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
IMO when one uses the expensive numeric type in Postgres one would do so because one would want it to behave like a Decimalas opposed toint,double or String. It would seem obvious to use the Dart type Decimal (i.e. GenericType<Decimal> from the decimal lib because it closely resembles the intent of numeric.
The encoding/decoding logic wouldn't change much, since Decimal can parse a String. But even if one added new Type.decimal and kept the current Type.numeric instead of changing it, this looks like a breaking change since PostgresBinaryDecoder wouldn't be able to tell the difference (as far as I can tell). Unless, one adds an optional useDecimalForNumeric flag in ConnectionSettings, but that seems messy.
What are your thoughts?
The text was updated successfully, but these errors were encountered:
I am asking this also in light of implementing numrange, which would either end up being a range of String (which makes no sense, I think) or be a range of Decimal, which would make more sense, but use an element type that is different than Type.numeric's.
IMO when one uses the expensive
numeric
type in Postgres one would do so because one would want it to behave like aDecimal
as opposed toint
,double
orString
. It would seem obvious to use the Dart typeDecimal
(i.e.GenericType<Decimal>
from thedecimal
lib because it closely resembles the intent ofnumeric
.The encoding/decoding logic wouldn't change much, since Decimal can parse a
String
. But even if one added newType.decimal
and kept the currentType.numeric
instead of changing it, this looks like a breaking change sincePostgresBinaryDecoder
wouldn't be able to tell the difference (as far as I can tell). Unless, one adds an optionaluseDecimalForNumeric
flag inConnectionSettings
, but that seems messy.What are your thoughts?
The text was updated successfully, but these errors were encountered: