Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# Type Provider for SQLite?

I have searched for the last month or so to no avail. Fsharpx, F# powerpack, codeplex, github, fssnip.net, hubfs.net, System.Data.SQLite, dba.stackexchange.com, F# & SQLite forums, blogs, etc. all turn up empty. As of today an F# Type Provider for SQLite does not exist in the public domain. Can you prove me wrong?

Assuming no body can prove me wrong my next step is to go about creating an F# Type Provider for SQLite which I am not very confident in my ability to do so (I'll get it done but it won't be pretty and it will take me a lot more effort that someone familiar with F#) but it will force me to learn how. I'm a student of F# and not a professional yet. I also have never created something in and for the Public Domain. Should I attempt that at GitHub? Or is that overkill and the solution is going to be simple enough to post the various answers/solutions of code here in this thread (and the final, final elegant solution(s) at fssnip.net)?

P.S. - I hope this post is of interest to GlennFerrieLive because he made a post Project ideas for FSharp Type Providers? [closed]

BTW - A HUGE thanks to all the incredibly helpful people on this site and others and F# is awesome, thanks Don Syme!

like image 826
Rick Avatar asked Dec 30 '12 19:12

Rick


2 Answers

Just to let you know, my SQL type provider now supports SQLite, feel free to contribute and help testing, it is not production ready.

like image 193
Ross McKinlay Avatar answered Oct 19 '22 19:10

Ross McKinlay


Entity Framework supports sqlite, so you should be able to create an .edmx file for your database schema then use the EDMX type provider to generate your types.

You may be able to create your .edmx file using the design-time support available in Visual Studio through the System.Data.SQLite plugin -- see this earlier SO post: How to create an Entity Framework model from an existing SQLite database in Visual Studio 2008?

Finally, CodeProject has a nice article on using SQLite from within Visual Studio; it's not related to F# but might be useful for general background info: Using SQLite Embedded Database with Entity Framework and Linq-to-SQL.

like image 44
Jack P. Avatar answered Oct 19 '22 19:10

Jack P.