A bit OT: Building your own Linq to <database>

A bit OT: Building your own Linq to <database>

Old forum URL: forums.lhotka.net/forums/t/7974.aspx


ajj3085 posted on Wednesday, November 11, 2009

HI,

I was wondering if anyone might have any pointers on how to build your own Linq to <db of choice>?  Is it even possible?  If not, is there a Linq2ODBC (yes, I need to work with a DB that ONLY offers ODBC drivers... ugh).

Thanks!

Andy

Regent replied on Thursday, November 12, 2009

Project at http://code2code.net/DB_Linq/ have support of different databases (e.g. PostgreSql, MySql, Oracle). Also it may be a good sample of implementing a custom Linq provider...

rfcdejong replied on Thursday, November 12, 2009

Opf3 went open source this year, Christian Liensberger as the "productowner" became a microsoft employee and doesn't have enough time anymore hehe..
Opf3: http://www.codeplex.com/opf3

Anyway it has a LinqToOpf3 and a high level of abstraction so you can write your own db provider, while there are enough providers already available.

Another choose could be Entity Framework for which you can use several 3rd party providers as well, it supports alot of databases already http://msdn.microsoft.com/en-us/data/dd363565.aspx
An example to write an own provider http://code.msdn.microsoft.com/EFSampleProvider

For a general ODBC driver... maybe the ODBC to ODBC bridge driver from OpenLink. And that way you still have the Entity Framework.
If u investigate the OpenLink solution i would like to get updated, since i want our teams to step to EF as well.

JonnyBee replied on Thursday, November 12, 2009

Hi,

Another option is Subsonic 3 with Linq templates and support for
          o SQL Server (200-2008)
          o MySQL (5.0 +)
          o PostGres
          o SQL Lite
          o SQL CE
          o VistaDB
          o Oracle

If you really want to create your own provider then have a look at the blogpost by Matt Warren (the creator of Linq2SQL): LINQ: Building an IQueryable provider series

All the code there can also be found on IQToolkit on codeplex.

ajj3085 replied on Thursday, November 12, 2009

Thanks everyone for the feedback, I'll have to look at this... at least it seems possible to build your own.

I'll likely have to do that, unless someone already built a Linq 2 FileMaker.  Wink [;)]

Copyright (c) Marimer LLC