From 8e9fdcbf3685da075091eb00559cfc301e6e3807 Mon Sep 17 00:00:00 2001 From: Skuirrels Date: Sat, 25 Jul 2026 21:50:58 +0100 Subject: [PATCH 1/4] Upgrade bundled DuckDB to 1.5.5 --- .github/workflows/preview-release.yml | 2 +- .../PreparedCommandWorkload.cs | 2 +- DuckDB.NET.Bindings/Bindings.csproj | 6 +- DuckDB.NET.Bindings/DuckDBStatementType.cs | 62 ++++++++++--------- DuckDB.NET.Data/Data.csproj | 2 +- .../DuckDB155CompatibilityTests.cs | 60 ++++++++++++++++++ README-FORK.md | 6 +- README.md | 2 +- scripts/validate-fork-packages.sh | 2 +- 9 files changed, 104 insertions(+), 40 deletions(-) create mode 100644 DuckDB.NET.Test/DuckDB155CompatibilityTests.cs diff --git a/.github/workflows/preview-release.yml b/.github/workflows/preview-release.yml index e2327f8b..5b095dd8 100644 --- a/.github/workflows/preview-release.yml +++ b/.github/workflows/preview-release.yml @@ -35,7 +35,7 @@ jobs: if [[ "$version" =~ ^1\.5\.[0-9]+-preview\.[0-9]+$ ]]; then fork_preview=true fork_release=false - elif [[ "$version" =~ ^1\.5\.[0-9]+$ ]]; then + elif [[ "$version" =~ ^1\.5\.[0-9]+(\.[0-9]+)?$ ]]; then fork_preview=false fork_release=true else diff --git a/DuckDB.NET.Benchmarks/PreparedCommandWorkload.cs b/DuckDB.NET.Benchmarks/PreparedCommandWorkload.cs index 69c6bb2a..1c7aaa1e 100644 --- a/DuckDB.NET.Benchmarks/PreparedCommandWorkload.cs +++ b/DuckDB.NET.Benchmarks/PreparedCommandWorkload.cs @@ -9,7 +9,7 @@ internal static class PreparedCommandWorkload #if DUCKDB_NET_BASELINE_1_5_3 private const string ExpectedEngineVersion = "v1.5.3"; #else - private const string ExpectedEngineVersion = "v1.5.4"; + private const string ExpectedEngineVersion = "v1.5.5"; #endif public static DuckDBConnection OpenVerifiedConnection() diff --git a/DuckDB.NET.Bindings/Bindings.csproj b/DuckDB.NET.Bindings/Bindings.csproj index cb88a774..6a38aa65 100644 --- a/DuckDB.NET.Bindings/Bindings.csproj +++ b/DuckDB.NET.Bindings/Bindings.csproj @@ -3,15 +3,15 @@ DuckDB Bindings for C#. -- Updated to DuckDB v1.5.4 +- Updated to DuckDB v1.5.5 Unofficial preview build of the DuckDB native bindings from the skuirrels DuckDB.NET fork. Unofficial preview bindings for the consolidated DuckDB.NET performance work, bundling DuckDB v1.5.4. Unofficial stable build of the DuckDB native bindings from the skuirrels DuckDB.NET fork. - Stable fork bindings for the consolidated DuckDB.NET performance work, bundling DuckDB v1.5.4. + Stable fork bindings for the consolidated DuckDB.NET performance work, bundling DuckDB v1.5.5. DuckDB.NET.Native win-x64;win-arm64;linux-x64;linux-arm64;osx - https://github.com/duckdb/duckdb/releases/download/v1.5.4 + https://github.com/duckdb/duckdb/releases/download/v1.5.5 True ..\keyPair.snk true diff --git a/DuckDB.NET.Bindings/DuckDBStatementType.cs b/DuckDB.NET.Bindings/DuckDBStatementType.cs index 3169983c..610d81eb 100644 --- a/DuckDB.NET.Bindings/DuckDBStatementType.cs +++ b/DuckDB.NET.Bindings/DuckDBStatementType.cs @@ -3,32 +3,36 @@ public enum DuckDBStatementType { Invalid = 0, - Select, - Insert, - Update, - Explain, - Delete, - Prepare, - Create, - Execute, - Alter, - Transaction, - Copy, - Analyze, - VariableSet, - CreateFunc, - Drop, - Export, - Pragma, - Show, - Vacuum, - Call, - Set, - Load, - Relation, - Extension, - LogicalPlan, - Attach, - Detach, - Multi, -} \ No newline at end of file + Select = 1, + Insert = 2, + Update = 3, + Explain = 4, + Delete = 5, + Prepare = 6, + Create = 7, + Execute = 8, + Alter = 9, + Transaction = 10, + Copy = 11, + Analyze = 12, + VariableSet = 13, + CreateFunc = 14, + Drop = 15, + Export = 16, + Pragma = 17, + [Obsolete("DuckDB reports SHOW statements as Select.")] + Show = Select, + Vacuum = 18, + Call = 19, + Set = 20, + Load = 21, + Relation = 22, + Extension = 23, + LogicalPlan = 24, + Attach = 25, + Detach = 26, + Multi = 27, + CopyDatabase = 28, + UpdateExtensions = 29, + MergeInto = 30, +} diff --git a/DuckDB.NET.Data/Data.csproj b/DuckDB.NET.Data/Data.csproj index 0154d74d..cd4dfac6 100644 --- a/DuckDB.NET.Data/Data.csproj +++ b/DuckDB.NET.Data/Data.csproj @@ -14,7 +14,7 @@ Fixes: Unofficial preview build of the DuckDB ADO.NET provider from the skuirrels DuckDB.NET fork. Unofficial preview of the consolidated DuckDB.NET performance work for DuckDB v1.5.4. Do not reference this package alongside the official DuckDB.NET packages. Unofficial stable build of the DuckDB ADO.NET provider from the skuirrels DuckDB.NET fork. - Stable fork release of the consolidated DuckDB.NET performance work for DuckDB v1.5.4. Do not reference this package alongside the official DuckDB.NET packages. + Stable fork release of the consolidated DuckDB.NET performance work for DuckDB v1.5.5. Do not reference this package alongside the official DuckDB.NET packages. True ..\keyPair.snk true diff --git a/DuckDB.NET.Test/DuckDB155CompatibilityTests.cs b/DuckDB.NET.Test/DuckDB155CompatibilityTests.cs new file mode 100644 index 00000000..7c0f8a62 --- /dev/null +++ b/DuckDB.NET.Test/DuckDB155CompatibilityTests.cs @@ -0,0 +1,60 @@ +namespace DuckDB.NET.Test; + +public class DuckDB155CompatibilityTests(DuckDBDatabaseFixture db) : DuckDBTestBase(db) +{ + [Fact] + public void MergeIntoReturnsManagedStatementType() + { + Command.CommandText = + """ + create table statement_type_target(id integer primary key, value varchar); + create table statement_type_source(id integer, value varchar); + insert into statement_type_target values (1, 'old'); + insert into statement_type_source values (1, 'new'), (2, 'added'); + """; + Command.ExecuteNonQuery(); + + var state = NativeMethods.Query.DuckDBQuery( + Connection.NativeConnection, + """ + merge into statement_type_target + using statement_type_source + on statement_type_target.id = statement_type_source.id + when matched then update set value = statement_type_source.value + when not matched then + insert (id, value) values (statement_type_source.id, statement_type_source.value) + """, + out var result); + + try + { + state.Should().Be(DuckDBState.Success); + NativeMethods.Query.DuckDBResultStatementType(result) + .Should().Be(DuckDBStatementType.MergeInto); + } + finally + { + NativeMethods.Query.DuckDBDestroyResult(ref result); + } + } + + [Fact] + public void ShowIsReportedAsSelect() + { + var state = NativeMethods.Query.DuckDBQuery( + Connection.NativeConnection, + "show tables", + out var result); + + try + { + state.Should().Be(DuckDBState.Success); + NativeMethods.Query.DuckDBResultStatementType(result) + .Should().Be(DuckDBStatementType.Select); + } + finally + { + NativeMethods.Query.DuckDBDestroyResult(ref result); + } + } +} diff --git a/README-FORK.md b/README-FORK.md index 4a2fa48b..c4f1e67a 100644 --- a/README-FORK.md +++ b/README-FORK.md @@ -2,13 +2,13 @@ This is an unofficial stable build from the [`skuirrels/DuckDB.NET`](https://github.com/skuirrels/DuckDB.NET) fork. It -packages the consolidated performance work for DuckDB v1.5.4 under distinct +packages the consolidated performance work for DuckDB v1.5.5 under distinct `Skuirrels.DuckDB.NET.*` package IDs. Install the bundled provider explicitly: ```shell -dotnet add package Skuirrels.DuckDB.NET.Data.Full --version 1.5.5 +dotnet add package Skuirrels.DuckDB.NET.Data.Full --version 1.5.5.2 ``` NuGet packages: @@ -21,7 +21,7 @@ so application source code does not need to change. Do not reference this fork package and the official `DuckDB.NET.Data.Full` package in the same dependency graph because they contain assemblies with the same identities. -This release bundles DuckDB v1.5.4 and includes the consolidated appender, +This release bundles DuckDB v1.5.5 and includes the consolidated appender, parameter binding, prepared-command, result materialisation, and scoped-writer optimisations from the fork. When equivalent upstream changes are released, move back to the official `DuckDB.NET.Data.Full` package. diff --git a/README.md b/README.md index b667f01a..aec80431 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ the corresponding upstream pull requests are reviewed and released. ## Usage ```sh -dotnet add package Skuirrels.DuckDB.NET.Data.Full --version 1.5.5 +dotnet add package Skuirrels.DuckDB.NET.Data.Full --version 1.5.5.2 ``` The fork packages retain the official `DuckDB.NET.Data` namespaces and assembly diff --git a/scripts/validate-fork-packages.sh b/scripts/validate-fork-packages.sh index 269189cc..019f8afb 100755 --- a/scripts/validate-fork-packages.sh +++ b/scripts/validate-fork-packages.sh @@ -109,7 +109,7 @@ using (var appender = connection.CreateAppender("fork_package_smoke")) using var verification = connection.CreateCommand(); verification.CommandText = "SELECT version(), sum(value) FROM fork_package_smoke"; using var reader = verification.ExecuteReader(); -if (!reader.Read() || !reader.GetString(0).Contains("v1.5.4", StringComparison.Ordinal) || reader.GetInt64(1) != 42) +if (!reader.Read() || !reader.GetString(0).Contains("v1.5.5", StringComparison.Ordinal) || reader.GetInt64(1) != 42) { throw new InvalidOperationException("Fork package smoke test failed."); } From 0aaf4e3bac4b9cc58786dcd56ed0ef5aa20c1852 Mon Sep 17 00:00:00 2001 From: Skuirrels Date: Sat, 25 Jul 2026 22:13:12 +0100 Subject: [PATCH 2/4] Harden DuckDB native package versioning --- .github/workflows/preview-release.yml | 2 +- Directory.Build.props | 1 + DuckDB.NET.Bindings/Bindings.csproj | 8 +-- .../DownloadNativeLibs.targets | 66 +++++++++++-------- DuckDB.NET.Data/Data.csproj | 4 +- README-PREVIEW.md | 4 +- 6 files changed, 47 insertions(+), 38 deletions(-) diff --git a/.github/workflows/preview-release.yml b/.github/workflows/preview-release.yml index 5b095dd8..28663088 100644 --- a/.github/workflows/preview-release.yml +++ b/.github/workflows/preview-release.yml @@ -32,7 +32,7 @@ jobs: version="${{ github.event.release.tag_name }}" version="${version#v}" - if [[ "$version" =~ ^1\.5\.[0-9]+-preview\.[0-9]+$ ]]; then + if [[ "$version" =~ ^1\.5\.[0-9]+(\.[0-9]+)?-preview\.[0-9]+$ ]]; then fork_preview=true fork_release=false elif [[ "$version" =~ ^1\.5\.[0-9]+(\.[0-9]+)?$ ]]; then diff --git a/Directory.Build.props b/Directory.Build.props index 603223b8..14058716 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -21,6 +21,7 @@ true Skuirrels. + 1.5.5 DuckDB.NET.$(MSBuildProjectName) $(ForkPackagePrefix)DuckDB.NET.$(MSBuildProjectName) DuckDB;ADO.NET;Database;Olap;Embedded diff --git a/DuckDB.NET.Bindings/Bindings.csproj b/DuckDB.NET.Bindings/Bindings.csproj index 6a38aa65..2a20ab51 100644 --- a/DuckDB.NET.Bindings/Bindings.csproj +++ b/DuckDB.NET.Bindings/Bindings.csproj @@ -3,15 +3,15 @@ DuckDB Bindings for C#. -- Updated to DuckDB v1.5.5 +- Updated to DuckDB v$(DuckDbNativeVersion) Unofficial preview build of the DuckDB native bindings from the skuirrels DuckDB.NET fork. - Unofficial preview bindings for the consolidated DuckDB.NET performance work, bundling DuckDB v1.5.4. + Unofficial preview bindings for the consolidated DuckDB.NET performance work, bundling DuckDB v$(DuckDbNativeVersion). Unofficial stable build of the DuckDB native bindings from the skuirrels DuckDB.NET fork. - Stable fork bindings for the consolidated DuckDB.NET performance work, bundling DuckDB v1.5.5. + Stable fork bindings for the consolidated DuckDB.NET performance work, bundling DuckDB v$(DuckDbNativeVersion). DuckDB.NET.Native win-x64;win-arm64;linux-x64;linux-arm64;osx - https://github.com/duckdb/duckdb/releases/download/v1.5.5 + https://github.com/duckdb/duckdb/releases/download/v$(DuckDbNativeVersion) True ..\keyPair.snk true diff --git a/DuckDB.NET.Bindings/DownloadNativeLibs.targets b/DuckDB.NET.Bindings/DownloadNativeLibs.targets index 0a73e20c..db93767c 100644 --- a/DuckDB.NET.Bindings/DownloadNativeLibs.targets +++ b/DuckDB.NET.Bindings/DownloadNativeLibs.targets @@ -1,47 +1,55 @@ - + - - + + $(MSBuildProjectDirectory)\obj\runtimes\$(Rid)\native $(MSBuildProjectDirectory)\obj\runtimes\$(Rid)\native.zip + $(MSBuildProjectDirectory)\obj\runtimes\$(Rid)\source-url.txt + $(MSBuildProjectDirectory)\obj\runtimes\$(Rid)\temp + + + + + + true + true - + + + - + - - - - - - - $(MSBuildProjectDirectory)\obj\runtimes\$(Rid)\native.zip - $(MSBuildProjectDirectory)\obj\runtimes\$(Rid)\temp - - - - - + - - - + + + diff --git a/DuckDB.NET.Data/Data.csproj b/DuckDB.NET.Data/Data.csproj index cd4dfac6..b2a1f486 100644 --- a/DuckDB.NET.Data/Data.csproj +++ b/DuckDB.NET.Data/Data.csproj @@ -12,9 +12,9 @@ Fixes: - Fixed ObjectDisposedException in enum appender (#327) Unofficial preview build of the DuckDB ADO.NET provider from the skuirrels DuckDB.NET fork. - Unofficial preview of the consolidated DuckDB.NET performance work for DuckDB v1.5.4. Do not reference this package alongside the official DuckDB.NET packages. + Unofficial preview of the consolidated DuckDB.NET performance work for DuckDB v$(DuckDbNativeVersion). Do not reference this package alongside the official DuckDB.NET packages. Unofficial stable build of the DuckDB ADO.NET provider from the skuirrels DuckDB.NET fork. - Stable fork release of the consolidated DuckDB.NET performance work for DuckDB v1.5.5. Do not reference this package alongside the official DuckDB.NET packages. + Stable fork release of the consolidated DuckDB.NET performance work for DuckDB v$(DuckDbNativeVersion). Do not reference this package alongside the official DuckDB.NET packages. True ..\keyPair.snk true diff --git a/README-PREVIEW.md b/README-PREVIEW.md index 0e3b2dd2..acac22c6 100644 --- a/README-PREVIEW.md +++ b/README-PREVIEW.md @@ -8,7 +8,7 @@ pull requests are under review. Install the bundled provider explicitly: ```shell -dotnet add package Skuirrels.DuckDB.NET.Data.Full --version 1.5.4-preview.2 +dotnet add package Skuirrels.DuckDB.NET.Data.Full --version 1.5.5.2-preview.1 ``` NuGet packages: @@ -21,7 +21,7 @@ so application source code does not need to change. Do not reference this fork package and the official `DuckDB.NET.Data.Full` package in the same dependency graph because they contain assemblies with the same identities. -This preview bundles DuckDB v1.5.4 and includes the consolidated appender, +This preview bundles DuckDB v1.5.5 and includes the consolidated appender, parameter binding, prepared-command, result materialisation, and scoped-writer optimisations from the fork. When equivalent upstream changes are released, move back to the official `DuckDB.NET.Data.Full` package. From 2adb672292bed95b3e69a240b50ddf2d14a205f9 Mon Sep 17 00:00:00 2001 From: Skuirrels Date: Sat, 25 Jul 2026 22:19:47 +0100 Subject: [PATCH 3/4] Keep fork package releases stable-only --- .github/workflows/preview-release.yml | 21 ++++----------------- DuckDB.NET.Bindings/Bindings.csproj | 2 +- DuckDB.NET.Data/Data.csproj | 2 +- README-PREVIEW.md | 4 ++-- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/.github/workflows/preview-release.yml b/.github/workflows/preview-release.yml index 28663088..7d20c683 100644 --- a/.github/workflows/preview-release.yml +++ b/.github/workflows/preview-release.yml @@ -12,10 +12,8 @@ jobs: publish-fork-package: if: >- startsWith(github.event.release.tag_name, 'v1.5.') && - ((github.event.release.prerelease == true && - contains(github.event.release.tag_name, '-preview.')) || - (github.event.release.prerelease == false && - !contains(github.event.release.tag_name, '-'))) + github.event.release.prerelease == false && + !contains(github.event.release.tag_name, '-') runs-on: ubuntu-latest environment: nuget-preview @@ -32,21 +30,14 @@ jobs: version="${{ github.event.release.tag_name }}" version="${version#v}" - if [[ "$version" =~ ^1\.5\.[0-9]+(\.[0-9]+)?-preview\.[0-9]+$ ]]; then - fork_preview=true - fork_release=false - elif [[ "$version" =~ ^1\.5\.[0-9]+(\.[0-9]+)?$ ]]; then - fork_preview=false - fork_release=true - else + if [[ ! "$version" =~ ^1\.5\.[0-9]+(\.[0-9]+)?$ ]]; then echo "Unexpected fork package version: $version" >&2 exit 1 fi { echo "PACKAGE_VERSION=$version" - echo "FORK_PREVIEW=$fork_preview" - echo "FORK_RELEASE=$fork_release" + echo "FORK_RELEASE=true" } >> "$GITHUB_ENV" - name: Setup .NET SDK @@ -65,7 +56,6 @@ jobs: /m:1 /p:BuildType=Full /p:CI=false - /p:ForkPreview="$FORK_PREVIEW" /p:ForkRelease="$FORK_RELEASE" /p:Version="$PACKAGE_VERSION" /p:PackageVersion="$PACKAGE_VERSION" @@ -80,7 +70,6 @@ jobs: --logger "console;verbosity=quiet" /p:BuildType=Full /p:CI=false - /p:ForkPreview="$FORK_PREVIEW" /p:ForkRelease="$FORK_RELEASE" /p:DoesNotReturnAttribute=DoesNotReturnAttribute @@ -96,7 +85,6 @@ jobs: /m:1 /p:BuildType=Full /p:CI=false - /p:ForkPreview="$FORK_PREVIEW" /p:ForkRelease="$FORK_RELEASE" /p:ForkPack=true /p:Version="$PACKAGE_VERSION" @@ -109,7 +97,6 @@ jobs: --source https://api.nuget.org/v3/index.json \ /p:BuildType=Full \ /p:CI=false \ - /p:ForkPreview="$FORK_PREVIEW" \ /p:ForkRelease="$FORK_RELEASE" \ /p:ForkPack=true \ /p:Version="$PACKAGE_VERSION" \ diff --git a/DuckDB.NET.Bindings/Bindings.csproj b/DuckDB.NET.Bindings/Bindings.csproj index 2a20ab51..1bba3e53 100644 --- a/DuckDB.NET.Bindings/Bindings.csproj +++ b/DuckDB.NET.Bindings/Bindings.csproj @@ -6,7 +6,7 @@ - Updated to DuckDB v$(DuckDbNativeVersion) Unofficial preview build of the DuckDB native bindings from the skuirrels DuckDB.NET fork. - Unofficial preview bindings for the consolidated DuckDB.NET performance work, bundling DuckDB v$(DuckDbNativeVersion). + Unofficial preview bindings for the consolidated DuckDB.NET performance work, bundling DuckDB v1.5.4. Unofficial stable build of the DuckDB native bindings from the skuirrels DuckDB.NET fork. Stable fork bindings for the consolidated DuckDB.NET performance work, bundling DuckDB v$(DuckDbNativeVersion). DuckDB.NET.Native diff --git a/DuckDB.NET.Data/Data.csproj b/DuckDB.NET.Data/Data.csproj index b2a1f486..d84306c5 100644 --- a/DuckDB.NET.Data/Data.csproj +++ b/DuckDB.NET.Data/Data.csproj @@ -12,7 +12,7 @@ Fixes: - Fixed ObjectDisposedException in enum appender (#327) Unofficial preview build of the DuckDB ADO.NET provider from the skuirrels DuckDB.NET fork. - Unofficial preview of the consolidated DuckDB.NET performance work for DuckDB v$(DuckDbNativeVersion). Do not reference this package alongside the official DuckDB.NET packages. + Unofficial preview of the consolidated DuckDB.NET performance work for DuckDB v1.5.4. Do not reference this package alongside the official DuckDB.NET packages. Unofficial stable build of the DuckDB ADO.NET provider from the skuirrels DuckDB.NET fork. Stable fork release of the consolidated DuckDB.NET performance work for DuckDB v$(DuckDbNativeVersion). Do not reference this package alongside the official DuckDB.NET packages. True diff --git a/README-PREVIEW.md b/README-PREVIEW.md index acac22c6..0e3b2dd2 100644 --- a/README-PREVIEW.md +++ b/README-PREVIEW.md @@ -8,7 +8,7 @@ pull requests are under review. Install the bundled provider explicitly: ```shell -dotnet add package Skuirrels.DuckDB.NET.Data.Full --version 1.5.5.2-preview.1 +dotnet add package Skuirrels.DuckDB.NET.Data.Full --version 1.5.4-preview.2 ``` NuGet packages: @@ -21,7 +21,7 @@ so application source code does not need to change. Do not reference this fork package and the official `DuckDB.NET.Data.Full` package in the same dependency graph because they contain assemblies with the same identities. -This preview bundles DuckDB v1.5.5 and includes the consolidated appender, +This preview bundles DuckDB v1.5.4 and includes the consolidated appender, parameter binding, prepared-command, result materialisation, and scoped-writer optimisations from the fork. When equivalent upstream changes are released, move back to the official `DuckDB.NET.Data.Full` package. From b6f1f5c45ca47054009226bed3bfb7eea36c81be Mon Sep 17 00:00:00 2001 From: Skuirrels Date: Sat, 25 Jul 2026 22:35:32 +0100 Subject: [PATCH 4/4] Trust Coveralls tap on macOS CI --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a13fdc9a..1ee358b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,6 +70,12 @@ jobs: CoverletOutputFormat: lcov run: dotnet test --configuration Release --verbosity normal --logger GitHubActions /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:BuildType=Full /p:DoesNotReturnAttribute="DoesNotReturnAttribute" + - name: Trust Coveralls Homebrew tap + if: runner.os == 'macOS' && github.event_name != 'schedule' + run: | + brew tap coverallsapp/coveralls + brew trust coverallsapp/coveralls + - name: Upload coverage reports to Coveralls Parallel uses: coverallsapp/github-action@v2 if: github.event_name != 'schedule'