Add support for DECIMAL type
fiorix opened this issue · comments
Alexandre Fiori commented
Add support for fixed-precision type: https://prestodb.io/docs/current/language/types.html#fixed-precision
Alexandre Fiori commented
David Phillips commented
What does the PostgreSQL driver return?
Alexandre Fiori commented
github.com/lib/pq supports scanning decimals to string
, float64
, and their variants sql.NullString
and sql.NullFloat64
. Despite not being able to convert to int64
for obvious reasons, a CAST(NULL to DECIMAL(10,2))
can be scanned to sql.NullInt64
.
I haven't tried github.com/go-sql-driver/mysql but I believe it should be consistent with pq.
That said, we should probably do the same here.
Alexandre Fiori commented
This is a simple fix. Added a suggestion in #11 (comment) which should provide the same behavior as pq.