Sqlite DateTime2 column bug

Sqlite supports many alias data types in order to achieve compatibility with other Sql dialects like MS Sql. One of these that we use a lot is a column type of DateTime2. Linqpad is interpreting these columns as strings instead of the correct DateTime data type. Could you please add the correct mapping here? (screenshot below)

Thanks!

Comments

  • JoeAlbahari
    edited January 2021

    SQLite does not support datetime as a column type:
    https://www.sqlite.org/datatype3.html

    While there's nothing to stop LINQPad's driver from mapping columns that it thinks are a datetime to .NET's DateTime type, the problem is that should a conversion fail in any row that's retrieved, an exception will be thrown, preventing you from querying data.