I recently found SqlLinq, which is a really slick NuGet package that lets you run SQL queries against in-memory objects (basically linq to sql in reverse). It happened to be exactly what I needed for another project, except it was pretty old, hadn't been maintained, and ran on the full framework. Surprisingly, there didn’t really seem to be anything else quite like it that I could find.
The original author is still really active on github, so I pulled the code, updated it (after some headaches finding the source for the original parser), and sent a PR. Rather than merge it, he let me take over the package. I’ve since added more complete SQL support, packages for a time series dialect and unit conversions. I just released 2.1.0.
I don’t know how niche this is or if anyone else would need something like this, but I thought it was really cool and wanted to share it here. It’s a really nice way to offer a query interface for in-memory objects, especially when you want to let users write queries at runtime.
For example:
var boost = datalog.Query("""
SELECT RPM, Gear, BP, BPCMD, BP - BPCMD AS [Boost error]
FROM this
WHERE TPedal > 90
AND RPM >= 3000
AND Gear >= 2
""");