Fork me on GitHub

I want to convert boolean values to bit values for DBs that don't have BOOLEAN values (sqlserver, oracle) in a consistent way (say, convert INT), while also keeping TRUE/FALSE values for dbs with native boolean support. a) Is this supported with HoneySQL? It doesn't appear to be. b) would registering a new dialect be a good approach, or should this be handled in application code?


I'm not even sure what you're asking in terms of HoneySQL -- bit/boolean conversion happens at the JDBC level.


Thanks. I guess my question was really "where should this happen"


MySQL does not have a BOOLEAN data type, but its JDBC driver converts to/from Boolean just fine for a BIT(1) field. It's not even done in next.jdbc.


For a JDBC driver that doesn't do the conversion you want, you can generally extend the protocols in next.jdbc to "force" the conversion but you have to be a bit careful since such conversions will be global to your application.


Excellent. Thanks for the help.