Type provider for MySql

杀马特。学长 韩版系。学妹 提交于 2019-12-06 01:39:30

I don't think there is out-of-the box type provider that would work with MySQL at the moment. However, Ross McKinlay has been working on a better type provider for SQL databases (more generally). It currently works with MS SQL server and SQL Lite.

It should be possible to write an extension to support MySQL with fairly small amount of work (but sadly, it has not been done yet). See his blog for details. I'm sure that contributions are welcome!

I haven't tested this, but if Entity Framework works with MySql (it does) and if F# has an Entity Framework Type Provider (it does) then I would expect the Entity Framework Type Provider to work with MySql.

Have you tried that approach?

If you are still interested, I recently added support for MySQL to my SQL type provider, help with testing would be good!

A general SQL database type provider, supporting LINQ queries, schema exploration, individuals and much more besides.

The provider currently supports MS SQL Server, SQLite, PostgreSQL, Oracle, MySQL and MS Access. All database vendors except SQL Server and MS Access will require 3rd party ADO.NET connector objects to function. These are dynamically loaded at runtime so that the SQL provider project is not dependent on them. You must supply the location of the assemblies with the "ResolutionPath" static parameter.

https://fsprojects.github.io/SQLProvider/

I think I actually got it to work!! Here's what I did:

  • Installed the MySql Connector
  • Added to and referenced MySql.Data & MySql.Data.Entity in my project
  • Added and EntityFramework 5.0 to my project
  • Added both MySql.Data & MySql.Data.Entity to the GAC.

Then I was able to use SqlEntityConnection and get the types!

There's gotta be an easier way to do this though. I particular, adding stuff to the GAC should not be a part of all this process. I mean, am I asking to much for this to work pretty much "out of the box"?!

Unfortunately, I'm extremely unfamiliar with .Net yet, so I couldn't get the whole thing working with the App.config file. Based on my searches here, it looks like I'm not the only one having troubles with this. If anyone has any feedback/suggestions please help!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!