Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 36 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,31 @@ jobs:
with:
dotnet-version: 9.0.x
cache: true
cache-dependency-path: |
**/Directory.Packages.props
**/global.json

# Tag v6.0.0-rc.1 -> package/assembly version 6.0.0-rc.1.
# Pin explicitly so Linux never falls back to MinVer height (0.0.0-alpha.*) if
# Directory.Build.props / MinVerTagPrefix fails to load. Must be set at build time
# because pack uses --no-build.
- name: Resolve package version from tag
id: ver
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"

# Pack against the lowest supported linq2db (6.0.0) so the nupkg dependency is >= 6.0.0.
# Materialized CTE uses the pre-6.3 name-suffix fallback in that build; CI covers native API on 6.3+.
- name: Restore (linq2db 6.0.0)
run: |
dotnet restore \
-p:Version=${{ steps.ver.outputs.version }} \
-p:LinqToDbVersion=6.0.0 \
-p:FireboltSdkVersion=1.9.1

- name: Build (Release, all TFMs, linq2db 6.0.0)
run: |
dotnet build -c Release -warnAsError \
-p:Version=${{ steps.ver.outputs.version }} \
-p:LinqToDbVersion=6.0.0 \
-p:FireboltSdkVersion=1.9.1 \
--no-restore
Expand Down Expand Up @@ -66,13 +79,29 @@ jobs:

- name: Pack (symbols + notes)
run: |
notes=$(sed "s/'/''/g" RELEASE_NOTES.md | tr '\n' ' ')
dotnet pack src/Similarweb.LinqToDB.Firebolt/Similarweb.LinqToDB.Firebolt.csproj \
--no-build \
-c Release \
-o ./artifacts \
-p:LinqToDbVersion=6.0.0 \
/p:PackageReleaseNotes="$notes"
VERSION="${{ steps.ver.outputs.version }}"

# Don't pass release notes via -p: — MSBuild treats `; $ () {}` as syntax.
# Inject via a props file with CDATA instead.
mkdir -p artifacts
{
echo '<Project>'
echo ' <PropertyGroup>'
echo ' <PackageReleaseNotes><![CDATA['
cat RELEASE_NOTES.md
echo ']]></PackageReleaseNotes>'
echo ' </PropertyGroup>'
echo '</Project>'
} > artifacts/PackageReleaseNotes.props

dotnet pack src/Similarweb.LinqToDb.Firebolt/Similarweb.LinqToDB.Firebolt.csproj \
--no-build \
-c Release \
-o ./artifacts \
-p:Version="$VERSION" \
-p:PackageVersion="$VERSION" \
-p:LinqToDbVersion=6.0.0 \
-p:CustomBeforeDirectoryBuildProps="$PWD/artifacts/PackageReleaseNotes.props"

- name: Push to NuGet
env:
Expand Down
16 changes: 10 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](https://semver.org/) and
the format of [Keep a Changelog](https://keepachangelog.com/).
## [Unreleased]

### Changed
- Integration tests start Firebolt Core via Testcontainers (and seed Northwind in-process) instead of requiring a pre-run `docker compose` instance.
- Firebolt Core Testcontainers image and ports are configured in `testsettings.json` (`fireboltCore`).
## [Unreleased]

### Removed
- `scripts/seed_db.py` — seeding is handled by the test host (`NorthwindSeeder`).
## [6.0.0] - 2026-08-12
- Migrate provider to LinqToDB 6.x (compatible with 6.0–6.4; NuGet package built against 6.0.0)
- CI matrix: linq2db `{6.0.0–6.4.0}` × FireboltNetSDK `{1.9.1, 1.10.1}` × TFM `{net8.0, net9.0}`
- Materialized CTE: native `IsMaterialized` when built against linq2db ≥ 6.3; name-suffix fallback for 6.0–6.2
- Fix linq2db 6.4 SQL generation: inherit `AliasesContext` in nested builders; quote reserved table/CTE aliases
- Firebolt string search: emit `NOT (… LIKE …)`; translate `string.Contains` via `STRPOS`
- Translate `group.Select(…).ToArray()` to `ARRAY_AGG`
- Integration tests start Firebolt Core via Testcontainers and seed Northwind in-process
- Stop tracking `packages.lock.json`

## [5.0.0] - 2025-11-24
- Initial release
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ We in [Similarweb](https://similarweb.com) are using this package. This would en
## Installing package
### Using .NET CLI
```shell
dotnet add package Similarweb.LinqToFirebolt
dotnet add package Similarweb.LinqToDB.Firebolt
```

### Using Visual Studio UI
`Tools > NuGet Package Manager > Manage NuGet Packages for Solution` and search for `Similarweb.LinqToFirebolt`
`Tools > NuGet Package Manager > Manage NuGet Packages for Solution` and search for `Similarweb.LinqToDB.Firebolt`

### Using Rider UI
`Tools > NuGet > Manage NuGet packages for <solution name>` and search for `SimilarWeb.LinqToFirebolt`
`Tools > NuGet > Manage NuGet packages for <solution name>` and search for `Similarweb.LinqToDB.Firebolt`

### Using Package Manager Console:
```shell
Install-Package SimilarWeb.LinqToFirebolt
Install-Package Similarweb.LinqToDB.Firebolt
```
37 changes: 18 additions & 19 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
# Firebolt LinqToDB driver
## Version
This is documentation for outdated LinqToDb [v5.4.1](https://github.com/linq2db/linq2db/tree/v5.4.1)-based version. Please feel free exploring our [code](https://github.com/similarweb/linq2fb)!
Documentation for the LinqToDB **6.x**-based package ([`v6.0.0-rc.1`](https://www.nuget.org/packages/Similarweb.LinqToDB.Firebolt/6.0.0-rc.1)). Older docs: [v5.4](https://similarweb.github.io/linq2fb/v5.4/), [v3.7](https://similarweb.github.io/linq2fb/v3.7/). Source: [similarweb/linq2fb](https://github.com/similarweb/linq2fb).

## Target platforms
- [NET8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) (8.0.414) — backporting
- [NET9](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) (9.0.305) — mainstream

## Dogfooding
We in [Similarweb](https://developers.similarweb.com/docs/similarweb-web-traffic-api) use this package to fetch data from [Firebolt V2](https://firebolt.io), so constantly improving it.
We in [Similarweb](https://similarweb.com) use this package to fetch data from [Firebolt V2](https://firebolt.io), so we keep improving it.

### Supported versions
* Firebolt: I tested [Firebolt](https://firebolt.io) only for v2 since v1 is deprecated. V1 is not tested and you my try to use it without any warranties.
* You will need [FireboltNetSDK](https://github.com/firebolt-db/firebolt-net-sdk) v.1.9.1 and above for using this package.
* LinqToDB:
* [v3.7.0](https://github.com/linq2db/linq2db/tree/v3.7.0) — _deprecated_, not being updated. You may find usages [on previous version page](https://similarweb.github.io/linq2fb/v3.7);
* [v5.4.1](https://github.com/linq2db/linq2db/tree/v5.4.1) — check this documentation;
* Firebolt: tested on [Firebolt](https://firebolt.io) v2 only (v1 is deprecated / untested).
* Install [FireboltNetSDK](https://github.com/firebolt-db/firebolt-net-sdk) **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 + `BuildWithClause` fallback when built against &lt; 6.3; native `IsMaterialized` when 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}`.

## How to use
1. Install this package (see [how to install](#installing-package))
2. Add [FireboltNetSDK](https://github.com/firebolt-db/firebolt-net-sdk) package since this implementation uses same way of loading ADO.NET classes, as LinqToDB;
3. In your code add following:
2. Add [FireboltNetSDK](https://github.com/firebolt-db/firebolt-net-sdk) since this provider loads ADO.NET classes the same way LinqToDB does
3. In your code add:
```csharp
Registration.AddDataProvider(); // this will register Firebolt provider
var options = new LinqToDbConnectionOptionsBuilder()
.UseConnectionString(Registration.DataProviderName, connectionString)
.Build();
Registration.AddDataProvider(); // registers the Firebolt provider
var options = new DataOptions()
.UseConnectionString(Registration.DataProviderName, connectionString);
var db = new DataConnection(options);
// here you may use `db` as usual LinqToDB connection
// use `db` as a usual LinqToDB connection
```

4. In case you want real LinqToDB features, you should use `db.GetTable<T>()` method to get table as LinqToDB table. For example:
4. For LinqToDB table APIs, use `db.GetTable<T>()`:
```csharp
var table = db.GetTable<YourEntity>();
var result = table.Where(x => x.Id == 1).ToList();
Expand All @@ -38,16 +37,16 @@ We in [Similarweb](https://developers.similarweb.com/docs/similarweb-web-traffic
## Installing package
### Using .NET CLI
```shell
dotnet add package Similarweb.LinqToFirebolt
dotnet add package Similarweb.LinqToDB.Firebolt
```

### Using Visual Studio UI
`Tools > NuGet Package Manager > Manage NuGet Packages for Solution` and search for `Similarweb.LinqToFirebolt`
`Tools > NuGet Package Manager > Manage NuGet Packages for Solution` and search for `Similarweb.LinqToDB.Firebolt`

### Using Rider UI
`Tools > NuGet > Manage NuGet packages for <solution name>` and search for `SimilarWeb.LinqToFirebolt`
`Tools > NuGet > Manage NuGet packages for <solution name>` and search for `Similarweb.LinqToDB.Firebolt`

### Using Package Manager Console:
```shell
Install-Package SimilarWeb.LinqToFirebolt
Install-Package Similarweb.LinqToDB.Firebolt
```
Loading