DuckDB.NET.Data 1.2.1
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();
}
}
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 DuckDB Labs and AWS Open Source Software Fund for sponsoring the project!
No packages depend on DuckDB.NET.Data.
Added support for binding nested List and Array values
Added support for binding List with null values
Added support for inserting TIMESTAMP_MS, TIMESTAMP_NS and TIMESTAMP_S
Updated to DuckDB v1.2.1
Fixed issue with binding statements that use explicit casts.
.NET 6.0
- DuckDB.NET.Bindings (>= 1.2.1)
.NET 8.0
- DuckDB.NET.Bindings (>= 1.2.1)
.NET Standard 2.0
- DuckDB.NET.Bindings (>= 1.2.1)
- System.Memory (>= 4.6.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.0)
| Version | Downloads | Last updated |
|---|---|---|
| 1.4.4-alpha.2 | 2 | 12/25/2025 |
| 1.4.3 | 1 | 12/25/2025 |
| 1.4.1 | 2 | 12/24/2025 |
| 1.3.2 | 1 | 12/25/2025 |
| 1.3.0 | 1 | 12/25/2025 |
| 1.2.1 | 1 | 12/25/2025 |
| 1.2.1-alpha.8 | 1 | 12/25/2025 |
| 1.2.0 | 1 | 12/25/2025 |
| 1.1.3 | 1 | 12/25/2025 |
| 1.1.2.1 | 1 | 12/25/2025 |
| 1.1.2-alpha.5 | 1 | 12/25/2025 |
| 1.1.1 | 1 | 12/25/2025 |
| 1.1.0.1 | 1 | 12/25/2025 |
| 1.0.2 | 1 | 12/25/2025 |
| 1.0.1 | 1 | 12/25/2025 |
| 1.0.0 | 0 | 06/03/2024 |
| 0.10.3 | 0 | 05/22/2024 |
| 0.10.2 | 0 | 04/21/2024 |
| 0.10.1 | 0 | 03/18/2024 |
| 0.9.2 | 1 | 12/25/2025 |
| 0.9.1 | 1 | 12/25/2025 |
| 0.9.0.3 | 1 | 12/25/2025 |
| 0.9.0 | 1 | 12/25/2025 |
| 0.8.1 | 1 | 12/25/2025 |
| 0.8.0 | 1 | 12/25/2025 |
| 0.7.1 | 1 | 12/25/2025 |
| 0.6.1 | 1 | 12/25/2025 |
| 0.4.0.10 | 1 | 12/25/2025 |
| 0.4.0.1 | 0 | 07/06/2022 |
| 0.4.0 | 1 | 12/25/2025 |
| 0.2.9.1 | 0 | 09/24/2021 |
| 0.2.9 | 1 | 12/25/2025 |
| 0.1.3 | 1 | 12/25/2025 |
| 0.1.2 | 1 | 12/25/2025 |
| 0.1.1 | 0 | 04/09/2021 |
| 0.1.0 | 1 | 12/25/2025 |

