Defining a column as Word64 and writing a value in the range [maxBoundInt64 +1 .. maxBoundWord64] results in a negative value (ie the Int64 bit pattern of the Word64) being inserted into the database.
The reason for this is that the Word64 type in the schema definition is converted to SqlInt64 which is then written to the database. The reverse is done when read the value is read, so the value is correct in Haskell land but the value in the database is negative. This is a problem for interop when the database is used from languages other then Haskell.
The obvious solution is to add an SqlWord64 constructor to the type to SqlType.
@parsonsmatt Is this a sane idea? Volunteering to do this if it is.
Defining a column as
Word64and writing a value in the range[maxBoundInt64 +1 .. maxBoundWord64]results in a negative value (ie theInt64bit pattern of theWord64) being inserted into the database.The reason for this is that the
Word64type in the schema definition is converted toSqlInt64which is then written to the database. The reverse is done when read the value is read, so the value is correct in Haskell land but the value in the database is negative. This is a problem for interop when the database is used from languages other then Haskell.The obvious solution is to add an
SqlWord64constructor to the type toSqlType.@parsonsmatt Is this a sane idea? Volunteering to do this if it is.