Page 1 of 1

Mapping Issue with tinyint , need help ...

Posted: Mon 26 Jun 2017 05:34
by anthony888999
with mysql - tinyint(1) LinqConnect is mapped to property type System.Boolean, and that's the correct behavior I can work with my compiler.
When I use the same data structure tinyint(1) from sqlite3, the mapping property will mapped to System.byte
As a result, I had a compiler error with type mismatch.
I sure don't want to do type cast all over the place, it's just too much code modification and generated too much confusion.

(I checked some support Reference)
Entity Developer:
viewtopic.php?f=31&t=23255&p=77915&hilit=tinyint#p77915

The behaviour is changed: the TINYINT(1) data type is now used for the columns which correspond to the System.Boolean properties (MySQL)

One workaround is to go through all my datatype with "Class Editor" and manually modify all the relevant byte to bool. But, that's time consuming when I have many to modify.

Also, longblob are mapped to System.byte[] from mysql ( which is what I wanted )
but, in sqlite3, longblob are mapped as a System.object
Now, I have to go through all my tables one by one with "Class Editor" many times
Please Help ...

Re: Mapping Issue with tinyint , need help ...

Posted: Fri 30 Jun 2017 16:34
by Shalex
anthony888999 wrote:When I use the same data structure tinyint(1) from sqlite3, the mapping property will mapped to System.byte
A default Database First mapping for the newly created models can be customized via:
* Visual Studio > Tools > Entity Developer > Options > Server Options > SQLite (for Entity Developer embedded in VS)
* Entity Developer > Tools > Options > Server Options > SQLite (for a standalone Entity Developer)
anthony888999 wrote:Also, longblob are mapped to System.byte[] from mysql ( which is what I wanted )
but, in sqlite3, longblob are mapped as a System.object
There is no longblob in Server Options for SQLite, that's why it is mapped to System.Object. Actually, blob (available in Server Options) and longblob correspond to the same affinity type: https://sqlite.org/datatype3.html. Is it possible for you to use blob (instead of longblob) in your SQLite database?