Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use EntityFramework with MemSQL?

I am trying to create an entity model for 2 super simple tables that I created in MemSQL:

CREATE TABLE foo(id int primary key auto_increment, name varchar(20));
CREATE TABLE t(id int primary key auto_increment);

I am using Entity Framework 6.1.x. I installed MySQL connector since MemSQL is binary protocol compatible with MySQL, added a new ADO.NET Entity Model to my project and walking through the wizard. Running into the following issues:

  1. Most of the times the wizard times out trying to query the list of tables and views. It's possible that it does so because the MemSQL cluster is remote in Azure. I'll try and create a local vm cluster tomorrow and try again.
  2. The times that it does succeed in reading the list of tables and views, I select both of the tables, then let Entity Framework generate the model. I get the following error:

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

So I am at a loss. Is it possible to use Entity Framework with MemSQL?

like image 614
AngryHacker Avatar asked Oct 31 '22 13:10

AngryHacker


1 Answers

It looks like the entity framework is using the LEFT builtin function which MemSQL doesn't support yet. It will be supported in MemSQL 5 due out early in 2016.

like image 112
Adam Prout Avatar answered Nov 15 '22 07:11

Adam Prout