SQLite doesn't have support for many data types, but in fact it just doesn't 
have many restrictions. It doesn't have data types but affinities.

When defining a column as "uniqueidentifier" in SQLite, it still stores the 
data as text. It would be the .NET provider's job to convert it back and forth 
to Guid.

Since it already detects those columns as Guid, and it can easily convert the 
data properly, there's no reason why it shouldn't work.

So I guess it's a bug that Guid columns as primary keys aren't working with 
System.Data.SQLite

Sure it can be worked around by replacing Guid with String everywhere in the 
code, but there's no reason why it shouldn't be working in the first place.


Etienne

From: mystery...@hotmail.com
To: sqlite-users at mailinglists.sqlite.org
Subject: RE: [sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or 
delete statement affected an unexpected number of rows"
Date: Sat, 30 May 2015 10:45:36 -0600




Thanks! If I change the column type from UNIQUEIDENTIFIER to TEXT, it works. 
Only thing is, the code then maps to String instead of Guid. Is there any way 
to keep the .NET code working with Guid classes?

I'm also seeing that BIT data type isn't supported and should be replaced by 
INT. However, leaving the data type as BIT does get mapped as Boolean and it 
still works even though it shouldn't. Any side-effect that could result from 
this? If it works it works...

Then Single data types have to be replaced by Double, which is no big deal.


Etienne

Reply via email to