This topic came up on an internal mailing list at Microsoft.
The question is, will LINQ be usable with databases other than Microsoft SQL Server?
Before we answer that, first of all let us understand, what is LINQ?
What is LINQ?
LINQ is Microsoft’s Language Integrated Query. It is a set of extensions to the .NET Framework that provide common capabilities within the programming language for querying against in-memory data as well as external data sources. I had posted previously on LINQ, here.
This is pretty cool when you understand the implications. Rather than writing a for loop to scroll through a collection of objects, imagine if you could apply a query to the collection itself, to select some of the members of the collection, based on criteria you define. Imagine getting the query verbs you know and love from a RDBMS, but applying those things to random collections of objects, whether or not those objects were persisted in or retrieved from a database. This is what LINQ can provide.
When does LINQ become available?
LINQ will ship with the .NET Framework v3.5, which was previously code-named the “Orcas” release. (My esteemed colleague Paul Andrew blogged earlier about the content in the .NET Framework v3.5.) The .NET Framework v3.5 (“Orcas”) will ship before the end of 2007; an update of Visual Studio will also ship at the same time. As with prior versions of the .NET Framework, the .NET Framework redistributable and SDK will be separately downloadable items. In other words, you can just use the SDK and the command line tools to build apps, but the visual toolset will add significant value.
As for the LINQ stuff in Orcas, originally the plan called for LINQ over Objects (query on arbitrary object collections), LINQ-to-XML (query over data derived from XML), LINQ-to-Datasets (you get the idea), as well as LINQ-to-SQL. Later we added LINQ-to-Entities into the plan for Orcas; this would be possible with the inclusion of the ADO.NET Entity Framework in Orcas as well. (but as Microsoft’s Mike Pizzo notes, the ADO.NET Entity Framework has since been removed from Orcas!). You can read about the ADO.NET Entity Framework here. So to summarize, LINQ is in Orcas, the .NET Framework v3.5, which will release before the end of 2007. Also, the LINQ stuff in Orcas will not include Linq-to-Entities.
You can read Mike Pizzo’s post yourself; here is the summary: We considered the ADO.NET Entity Framework important and big enough that we’ve decided to get it right, with good tools support, which meant holding it for release until after Orcas. This of course is why the the LINQ support for the Entity Framework won’t ship in Orcas either! The ADO.NET Entity Framework (including LINQ to Entities support) will be marketed with SQL Server “Katmai” (read the press release, or check the datasheet), and will ship at the same time (first half 2008), but the two will not be technically linqed ;). The ADO.NET Entity Framework will ship as an update to the .NET Framework, which is generally available to developers. Using the update will not require SQL Server “Katmai” to be installed.
Where does the interop part come in?
Why are you reading all about LINQ on an interop blog? Here’s the interop part: The LINQ-to-Entities that ships in Orcas+1 as part of the ADO.NET Entity Framework will include a provider model. What this means is that there will be multiple providers for multiple stores. Lance Olson tells me:
We’ve been working with a significant number of 3rd party provider writers for more than a year now to ensure that support for all major databases is available for LINQ to Entities at RTM (RTM of Orcas+1 !! -dino) . LINQ to Entities is built on an extension of the ADO.NET 2.0 provider model so provider writers just need to update their 2.0 providers to support a new interface in order to get LINQ support. SQLLite has an open source provider on the web today working against Beta 1 for example. A number of these partners are planning to attend Tech Ed and will be announcing their support and demonstrating working providers there. We’re obviously very excited to be able to show such broad support for LINQ.
So, look for good interop support in LINQ-to-Entities, which is coming in the first half of 2008.
Next obvious question – what about a public provider model for LINQ-to-SQL, which would enable LINQ-to-any-other-RDBMS? We have not announced plans in that direction. We think the LINQ-to-Entities
other relevant posts: