Currently, there are no official LinqToDB driver for Firebolt. This leads to following issues:
- usage of direct SQL queries instead of Linq expressions;
- overcomplicated infrastructure around ADO.NET classes;
- can't use variety of ORMs and features/extensions;
- devs have to write all SQL queries, even simple ones like
SELECT * FROM table.
Providing a LinqToDB driver for Firebolt will simplify usage of DB for newcomers.
Currently, it is an MVP to narrow down the scope of the project.
- No support for LinqToDB features like
InsertOrUpdate,InsertOrReplace, etc.; - Not all Firebolt-specific functions are supported (e.g. geospatial, DataSketches, etc.);
- No support for Schema retrieval (yet);
- Some other issues could be present, but they are not critical for current goal.
We in Similarweb are using this package. This would encourage us to constantly improve it.
- Firebolt: tested on Firebolt v2 only (v1 is deprecated / untested).
- Install FireboltNetSDK 1.9.1 or 1.10.x yourself (peer dependency; not bundled).
- LinqToDB: 6.0 – 6.4 (one nupkg; dependency
linq2db >= 6.0.0).- Materialized CTE (
AsMaterializedCte): name-suffix +BuildWithClausefallback when built against < 6.3; nativeIsMaterializedwhen built against ≥ 6.3. The published package is built against 6.0.0 (suffix fallback). - CI matrix: linq2db
{6.0.0, 6.1.0, 6.2.0, 6.3.0, 6.4.0}× FireboltNetSDK{1.9.1, 1.10.1}× TFM{net8.0, net9.0}.
- Materialized CTE (
-
Install this package (see how to install)
-
Add FireboltNetSDK package since this implementation uses same way of loading ADO.NET classes, as LinqToDB;
-
In your code add:
Registration.AddDataProvider(); // this will register Firebolt provider var options = new DataOptions() .UseConnectionString(Registration.DataProviderName, connectionString); var db = new DataConnection(options); // here you may use `db` as usual LinqToDB connection
-
In case you want real LinqToDB features, you should use
db.GetTable<T>()method to get table as LinqToDB table. For example:var table = db.GetTable<YourEntity>(); var result = table.Where(x => x.Id == 1).ToList();
dotnet add package Similarweb.LinqToDB.FireboltTools > NuGet Package Manager > Manage NuGet Packages for Solution and search for Similarweb.LinqToDB.Firebolt
Tools > NuGet > Manage NuGet packages for <solution name> and search for Similarweb.LinqToDB.Firebolt
Install-Package Similarweb.LinqToDB.Firebolt