LinqPad CosmosDb Data Context Driver Update - Part 3
In my last post and the one before that I was writing about the process of releasing a new version of my LinqPad CosmosDb DataContext Driver. Those were the two important steps to make before the actual update of the driver — and now, it's finally here.
If you just want to use it, you can download the binaries from here, or checkout the Github repo for the source (and the binaries can be downloaded from there, too).
But if you are interested in the "what's new" type of marketing, here's the new (or changed features) that you might be interested in:
Modularized architecture for better maintainability
As described in my last post and the one before that, I have split the "backend" of my driver into separate assemblies and also separate Github repositories for better development.
What this means is that now the ADO.NET provider that powers the SQL-execution in LinqPad and the context library that manages the connection to CosmosDb can be used separately. Also, they are included as submodules in the repository of the actual LinqPad driver, so any updates or bugfixes that are made can now be easily introduced in the driver.
Cleaned up source code
When I started out, I did this just for fun and I didn't expect this much external interest in the project. Don't get me wrong, I'm really glad that people are using it, but there were places that just felt a little off. Especially since it turns out that this is useful :)
So I upgraded the source code. Added some comments, rewritten some parts with the language features of C# 6 and C# 7, updated the dotnet and CosmosDb SDK versions (but not Json.NET; I have run into some problems and I will invesigate further if it's possible at all and if so, then how).
New feature: Running SQL queries as part of the C# windows
The ones before were just part of the long-overdue "spring cleaning". The whole idea of the update came with this issue in Github. So now, you can use the C# windows to run SQL queries and then fiddle with the results even further using Linq2Objects:
You have to use the
ExecuteSql<dynamic>() method when using the dynamic driver and
ExecuteSql<T>() when using the static driver. Have fun!
New feature: Support for FeedOptions
The change in the arhitectural style of the driver made it possible to add more features to the driver. One that I thought was necessary is the support for FeedOptions. If you want, you can now set all (except for the partition key) on a collection, and when a query is run, this is taken into consideration. So this makes it possible to run cross-partition queries, for example:
See the project wiki for more details on the possible values;
New feature: Populating the SQL-translation tab
Again with the new architecture (and some black magin described in this post) if you use a static driver, now you can see the SQL-query that is issued to the server:
Since the dynamic driver runs everything on the client side, there was no reason to include the feature in that one (it's always a SELECT *).
Wrapping up everything in a bow:
With the official, final and (hopefully) last name change that is scheduled for June 1st, I thought it was time to rename the driver to CosmosDb DataContext Driver altogether. I'm keeping the Github repository name, but both in the source code and in the resource strings, I removed any reference to the glorious technology once called "DocumentDb". And with this, I also bumped the version from 220.127.116.11 to 18.104.22.168 (I thought with these new features it was warranted).
So that's that. Hope you'll like this new version just as much as you did the old one. Of course you can still keep using version, but I won't be making updates on that one, so you'll be better off switching to the new and improved version.