Unable to insert a value of type uint64 into the table column of type DECIMAL(20,0).
Issue tracker is used for reporting bugs and discussing new features. Please use
[Discord](https://discord.gg/rWtp5Aj) or [stackoverflow](https://stackoverflow.com) for supporting
issues.
<!--- Provide a general summary of the issue in the Title above -->
## Expected Behavior
When a user try to insert a value of type unit64 (for ex: 9383336886908942973) in the table column of type DECIMAL(20,0). The value in the column should be stored as it is without any wrapping to negative value.
<!--- Tell us what should happen -->
## Current Behavior
When a user try to insert a value of type unit64 (for ex: 9383336886908942973) in the table column of type DECIMAL(20,0). The value in the column is stored as negative (for ex: -9063407186800608643).
<!--- Tell us what happens instead of the expected behavior -->
## Possible Solution
The library insert function is converting back the uint64 value to int64 and storing it in the database. Possible solution is to simply map uint64 to uint64 values only, which means only allow signed values
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
## Steps to Reproduce
Create a table with column name flow_id with data type as DECIMAL(20,0).
Create a struct having flow_id attribute of type uint64.
Declare a value of above struct type(assign value as 9383336886908942973) and try to insert in the postgres database using *pg.Db.model().insert() function passing the struct variable.
Check in the database, the record will reflect a negative value which should be -9063407186800608643
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.
## Context (Environment)
Any IDE running golang
Connections with database running postgres
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
<!--- Provide a general summary of the issue in the Title above -->
## Detailed Description
<!--- Provide a detailed description of the change or addition you are proposing -->
## Possible Implementation
<!--- Not obligatory, but suggest an idea for implementing addition or change -->
0 条评论