steffengy / tiberius

TDS 7.4 (mssql / Microsoft SQL Server) async driver for rust. Fork at: https://github.com/prisma/tiberius
Apache License 2.0
150 stars 2 forks source link

Some types casting #69

Closed andriy-viyatyk closed 6 years ago

andriy-viyatyk commented 6 years ago

In real life in legacy databases there are different type of fields used for storing bolean/integers/date values. In my case, I have "bit" and "tinyint" fields with boolean values; "date" and "datetime" fields with just Date values... I can use try_get() method to guess what the actual type inside, but I don't like do so. I like to have automatic casting where it is logically right.