I'm attempting to write my own DatabaseStorageBase for mini-profiler, and I'm running into issues in my
private List<T> LoadFor<T>(DbConnection conn, object idParameter)
method. Dapper keeps yelling at me with
Error parsing column 5 (level=0 - SByte)
I'm storing level as
tinyint(4), so I'm assuming dapper cannot make the conversion from Tiny Int to what looks like an Enum (
ProfileLevel)? Could someone suggest how I should store the level in mysql so I can solve my conversion woes?
Wow. what a cool insident, I'm also implement my own mysqlstorage for miniprofiler and get similar error with you.
miniprofiler uses enum as byte for MiniProfiler.Level and SqlTiming.ExecuteType using tinyint datatype for this property return invalid cast which shown that it return Sbyte instead of byte. this behavior default behavior of mysql as it permit return of signed value of tinyint where as sqlserver not as mention here:
Therefore, the resolution is simply by alter the tinyint field of level and executeType into unsigned tinyint will return correct value (cast to byte). now my mysqlstorage working as expected.. hope can ask pull request to sam :)