Golang SQLBoiler converts bit(1) to string instead of bool or int

695 Views Asked by At

I am trying to use sqlboiler (using version 4.5.0) to generate my database-models in Golang.

I have a lot of tables with columns of type tinyint(1) or bit(1) which were mapped to booleans in my java spring code.

Now when I generate the sqlboiler code these columns are all mapped to strings instead of boolean or integer, so I get errors when it tries to insert "Y" or "N" as values.

I did find the undocumented property tinyint_as_int or tinyint_as_bool mentioned in a lot of threads, but setting these didn't change anything (I am using the mysql driver)

What can I do to properly map bit/tinyint columns into an integer or a boolean so sqlboiler does not try to insert a string there?

Update: Was my mistake, I changed the column from bit(1) to tinyint(1) in the wrong table. Would still be nice if mysqlboiler would support bit(1) but with tinyint it works

0

There are 0 best solutions below