SQLitePLC does not return the correct type

May 2, 2014 at 4:26 AM
Edited May 2, 2014 at 5:02 AM
Hey guys,

In my database I have my ID set as an integer but when using sqlitepcl it is converted into a long breaking my reflection method to match values to properties.

Also Decimals are converted to double, boolean to Int64 through SQLitePLC. Is there anyway the next versions can keep the native types and not convert them. I have not tested other datatypes but I assume they will be similar.

I can overcome this by creating a method to convert long into an integer etc... but first I was wondering if there was a reason to do this?

Cheers,

Alex.
May 2, 2014 at 8:46 AM
This is just a note:

This is related to issue #8 - http://sqlitepcl.codeplex.com/workitem/8
It is because SQLite only really handles basic types: INTEGER, REAL, TEXT and BLOB (http://www.sqlite.org/datatype3.html)
Developer
Jun 21, 2014 at 8:03 PM
Hi @Xela101,

We've added support for most .Net primitive types in the latest release.

We've also added ColumnType method, and GetInteger, GetFloat, GetText, and GetBlob methods, with their corresponding .Net return types.

Unsupported types throw SQLiteException now.
Marked as answer by leotilli on 9/5/2014 at 11:28 AM