我正在尝试为我在MemSQL中创建的2个超级简单表创建一个实体模型:
CREATE TABLE foo(id int primary key auto_increment, name varchar(20));
CREATE TABLE t(id int primary key auto_increment);
我正在使用Entity Framework 6.1.x.我安装了MySQL连接器,因为MemSQL是与MySQL兼容的二进制协议,在我的项目中添加了一个新的ADO.NET实体模型并完成了向导.遇到以下问题:
>大多数情况下,向导会超时尝试查询表和视图列表.它可能是这样的,因为MemSQL集群在Azure中是远程的.我明天会尝试创建一个本地虚拟机群集,然后再试一次.
>它成功读取表和视图列表的时间,我选择了两个表,然后让Entity Framework生成模型.我收到以下错误:
Unable to generate the model because of the following exception: ‘System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. —> MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘LEFT(COLUMN_TYPE,10) = ‘tinyint(1)’, ‘bool’,
IF (LEFT(COLUMN_TYPE,10) ‘ at line 47
所以我不知所措.是否可以将实体框架与MemSQL一起使用?