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
Currently when using CodeGen, with for example MySQL, if you have a table like:
CREATE TABLE my_table ( id UNSIGNED INT NOT NULL AUTO_INCREMENT PRIMARY KEY, something VARCHAR(100) )
It will generate a case class with id as a Scala Int, instead CodeGen should be able to read that it is an UNSIGNED INT and cast it to a Long instead, same goes for an UNSIGNED BIGINT which should be cast to a BigInteger and so on.
For a full list of what SIGNED/UNSIGNED numbers should be cast to see here.
The text was updated successfully, but these errors were encountered:
Asamsig
pushed a commit
to Asamsig/slick
that referenced
this issue
Sep 2, 2017
Added unsigned integer mapping to Long, following the MySQL connector reference. Added code for unsigned bigint aswell, but scala.math.BigInt isn't support as a default datatype, I left these parts in for completeness, but commented out. Updated the tests for the MySQLProfile to cover the new conversion.
Additionally fixed two typos, I spotted randomly.
After investigating it doesn't seem like any of the other database than MySQL actually uses the UNSIGNED notation, so I guess this issue can be closed. Anybody who can confirm my findings?
Currently when using CodeGen, with for example MySQL, if you have a table like:
CREATE TABLE my_table ( id UNSIGNED INT NOT NULL AUTO_INCREMENT PRIMARY KEY, something VARCHAR(100) )
It will generate a case class with
id
as a Scala Int, instead CodeGen should be able to read that it is anUNSIGNED INT
and cast it to a Long instead, same goes for anUNSIGNED BIGINT
which should be cast to a BigInteger and so on.For a full list of what
SIGNED/UNSIGNED
numbers should be cast to see here.The text was updated successfully, but these errors were encountered: