DuckDB.NET.Bindings.Full
2.0.0-preview.1
Prefix Reserved
dotnet add package DuckDB.NET.Bindings.Full --version 2.0.0-preview.1
NuGet\Install-Package DuckDB.NET.Bindings.Full -Version 2.0.0-preview.1
<PackageReference Include="DuckDB.NET.Bindings.Full" Version="2.0.0-preview.1" />
<PackageVersion Include="DuckDB.NET.Bindings.Full" Version="2.0.0-preview.1" />
<PackageReference Include="DuckDB.NET.Bindings.Full" />
paket add DuckDB.NET.Bindings.Full --version 2.0.0-preview.1
#r "nuget: DuckDB.NET.Bindings.Full, 2.0.0-preview.1"
#:package DuckDB.NET.Bindings.Full@2.0.0-preview.1
#addin nuget:?package=DuckDB.NET.Bindings.Full&version=2.0.0-preview.1&prerelease
#tool nuget:?package=DuckDB.NET.Bindings.Full&version=2.0.0-preview.1&prerelease
DuckDB.NET
DuckDB bindings for C#

Usage
dotnet add package DuckDB.NET.Data.Full
using (var duckDBConnection = new DuckDBConnection("Data Source=file.db"))
{
duckDBConnection.Open();
using var command = duckDBConnection.CreateCommand();
command.CommandText = "CREATE TABLE integers(foo INTEGER, bar INTEGER);";
var executeNonQuery = command.ExecuteNonQuery();
command.CommandText = "INSERT INTO integers VALUES (3, 4), (5, 6), (7, 8);";
executeNonQuery = command.ExecuteNonQuery();
command.CommandText = "Select count(*) from integers";
var executeScalar = command.ExecuteScalar();
command.CommandText = "SELECT foo, bar FROM integers";
var reader = command.ExecuteReader();
PrintQueryResults(reader);
}
private static void PrintQueryResults(DbDataReader queryResult)
{
for (var index = 0; index < queryResult.FieldCount; index++)
{
var column = queryResult.GetName(index);
Console.Write($"{column} ");
}
Console.WriteLine();
while (queryResult.Read())
{
for (int ordinal = 0; ordinal < queryResult.FieldCount; ordinal++)
{
var val = queryResult.GetInt32(ordinal);
Console.Write(val);
Console.Write(" ");
}
Console.WriteLine();
}
}
MotherDuck
To connect to MotherDuck:
using var duckDBConnection = new DuckDBConnection("DataSource=md:{your_database}?motherduck_token=ey...");
DuckDB Extensions (C#)
If you want to build DuckDB extensions with C#, see Giorgi/DuckDB.ExtensionKit.
Known Issues
When debugging your project that uses DuckDB.NET library, you may get the following error: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. The error happens due to debugger interaction with the native memory. For a workaround check out Debugger Options mess up debugging session during Marshalling
Documentation
Documentation is available at https://duckdb.net
Support
If you encounter a bug with the library Create an Issue. Join the DuckDB dotnet channel for DuckDB.NET-related topics.
Contributors
Sponsors
A big thanks to DuckLabs and AWS Open Source Software Fund for sponsoring the project!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (7)
Showing the top 5 NuGet packages that depend on DuckDB.NET.Bindings.Full:
| Package | Downloads |
|---|---|
|
DuckDB.NET.Data.Full
DuckDB ADO.NET Provider for C#. |
|
|
SQLProvider.DuckDb
Type providers for DuckDB database access. |
|
|
DuckDbSharp
Bidirectional interoperability layer between DuckDB and .NET. |
|
|
Reveal.Sdk.Data.DuckDB
Reveal SDK DuckDB data source |
|
|
TheTechIdea.Beep.DuckDBDataSourceCore
Package Description |
GitHub repositories (4)
Showing the top 4 popular GitHub repositories that depend on DuckDB.NET.Bindings.Full:
| Repository | Stars |
|---|---|
|
apache/arrow-adbc
Database connectivity API standard and libraries for Apache Arrow
|
|
|
erikdarlingdata/PerformanceMonitor
Free, open-source SQL Server and Postgres performance monitoring. Collectors, real-time alerts, graphical plan viewer, MCP server for AI analysis. Supports SQL 2016-2025, Azure SQL, AWS RDS, Postgres, Aurora Postgres.
|
|
|
RusselWebber/xlDuckDb
Use DuckDB within Excel with the xlDuckDb addin
|
|
|
jacking75/programming-books-with-ai
AI 와 같이 만든 프로그래밍 책들
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-preview.1 | 928 | 11/9/2026 |
| 1.5.6.1 | 148,015 | 10/15/2026 |
| 1.5.6 | 161,376 | 9/28/2026 |
| 1.5.5 | 576,887 | 7/26/2026 |
| 1.5.3 | 482,098 | 5/24/2026 |
| 1.5.2 | 196,408 | 4/24/2026 |
| 1.5.0 | 223,115 | 3/10/2026 |
| 1.4.4 | 259,249 | 2/3/2026 |
| 1.4.4-alpha.2 | 3,848 | 12/19/2025 |
| 1.4.3 | 148,284 | 12/11/2025 |
| 1.4.1 | 251,488 | 10/13/2025 |
| 1.3.2 | 247,137 | 7/8/2025 |
| 1.3.0 | 269,529 | 6/3/2025 |
| 1.2.1 | 656,932 | 3/5/2025 |
| 1.2.1-alpha.8 | 897 | 2/19/2025 |
| 1.2.0 | 254,559 | 2/6/2025 |
| 1.1.3 | 512,928 | 11/7/2024 |
| 1.1.2.1 | 117,344 | 10/21/2024 |
| 1.1.2-alpha.5 | 449 | 10/10/2024 |
- Updated to DuckDB v2.0.0
Breaking changes:
- DuckDB.NET.Bindings 2.0 needs DuckDB.NET.Data 2.0: DuckDB.NET.Data 1.x with Bindings 2.0 throws TypeLoadException at the first string append. Upgrade both packages together
- DuckDBString.value and the nested type DuckDBString._value_e__Union are removed: read a string with Length and Data, and build a short one with DuckDBString.TryCreateInlined
- DuckDBString.TryCreateInlined returns true for a short string that contains a NUL character; it returned false
- NativeMethods.Value.DuckDBCreateVarchar takes a non-nullable string (null crashes the process; use DuckDBCreateNullValue for NULL), and has a new overload for UTF-8 bytes, DuckDBCreateVarchar(ReadOnlySpan<byte>), which keeps NUL characters. With C# 12, DuckDBCreateVarchar(null) and DuckDBCreateVarchar(default) are ambiguous, and a method group or a reflection lookup of DuckDBCreateVarchar needs the parameter type
- DuckDBStringInlined is internal: build a short string with DuckDBString.TryCreateInlined
- DuckDBValue.GetValue<T> gives the value as its own type, as object, a nullable of it or an interface it implements; any other T throws InvalidCastException. It reinterpreted the value's memory as T
New features:
- DuckDBHugeInt and DuckDBUHugeInt can be created from an Int128 and a UInt128
- DuckDBType has the DuckDB 1.5 types STRING_LITERAL, INTEGER_LITERAL, TIME_NS, GEOMETRY and VARIANT
- Bindings for duckdb_prepared_statement_type, duckdb_clear_bindings and duckdb_create_varchar_length
Fixes:
- Some native function declarations were corrected to match duckdb.h

