crystal-db icon indicating copy to clipboard operation
crystal-db copied to clipboard

better error message when types don't line up

Open rdp opened this issue 9 years ago • 2 comments

Today I get this:

cast from Int32 to Int64 failed, at /x/y/libs/db/db/result_set.cr:80 (TypeCastError)

if I declare an "id" column as Int64 instead of Int32 that it is in the DB.

Might be nice to say which column is failing when this occurs instead of "somewhere, there is a failure in the conversion..."

rdp avatar Oct 20 '16 23:10 rdp

To be able to do this all ResultSets should store the current column index, so they can retrieve the current column name from that index.

asterite avatar Oct 21 '16 14:10 asterite

actually, just outputting the current column index would be an improvement :)

rdp avatar Oct 26 '16 04:10 rdp