DuckDB.NET.Data.Full 1.5.6.1

dotnet add package DuckDB.NET.Data.Full --version 1.5.6.1
                    
NuGet\Install-Package DuckDB.NET.Data.Full -Version 1.5.6.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DuckDB.NET.Data.Full" Version="1.5.6.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DuckDB.NET.Data.Full" Version="1.5.6.1" />
                    
Directory.Packages.props
<PackageReference Include="DuckDB.NET.Data.Full" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DuckDB.NET.Data.Full --version 1.5.6.1
                    
#r "nuget: DuckDB.NET.Data.Full, 1.5.6.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DuckDB.NET.Data.Full@1.5.6.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DuckDB.NET.Data.Full&version=1.5.6.1
                    
Install as a Cake Addin
#tool nuget:?package=DuckDB.NET.Data.Full&version=1.5.6.1
                    
Install as a Cake Tool

DuckDB.NET

DuckDB bindings for C#

GitHub Workflow Status Coveralls License Ko-Fi Discord

NuGet DuckDB.NET.Data NuGet DuckDB.NET.Bindings

NuGet DuckDB.NET.Data.Full NuGet DuckDB.NET.Bindings.Full

Project Icon

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

Contributors

Sponsors

A big thanks to DuckLabs and AWS Open Source Software Fund for sponsoring the project!

DuckLabs

AWS

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (68)

Showing the top 5 NuGet packages that depend on DuckDB.NET.Data.Full:

Package Downloads
Kurrent.Quack

Package Description

UnifiedBlazor.Shared.DataAccess

UnifiedBlazor框架的DataAccess共享库

Kurrent.Surge.DuckDB

Package Description

DuckDB.InteractiveExtension

DuckDB support for Polyglot Notebooks

ShiftSoftware.ADP.SyncAgent

Package Description

GitHub repositories (13)

Showing the top 13 popular GitHub repositories that depend on DuckDB.NET.Data.Full:

Repository Stars
DapperLib/Dapper
Dapper - a simple object mapper for .Net
DotNetNext/SqlSugar
.Net aot ORM SqlServer ORM Mongodb ORM MySql 瀚高 Postgresql ORM DB2 Hana 高斯 Duckdb C# VB.NET Sqlite ORM Oracle ORM Mysql Orm 虚谷数据库 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET9 ORM .NET8 ORM ClickHouse ORM QuestDb ,TDengine ORM,OceanBase ORM,GaussDB ORM,Tidb ORM Object/Relational Mapping
dotnetcore/FreeSql
.NET aot orm, VB.NET/C# orm, Mysql/PostgreSQL/SqlServer/Oracle orm, Sqlite/Firebird/Clickhouse/DuckDB orm, 达梦/金仓/虚谷/翰高/高斯 orm, 神通 orm, 南大通用 orm, 国产 orm, TDengine orm, QuestDB orm, MsAccess orm.
linq2db/linq2db
Linq to database provider.
dotnet/interactive
.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
mukunku/ParquetViewer
Simple Windows desktop application for viewing & querying Apache Parquet files
brianluft/sqlnotebook
SQL Notebook — Casual data exploration in SQL
Hitmasu/OpenCNPJ
API pública de busca e consulta de CNPJs do Brasil
J-Tech-Japan/Sekiban
Sekiban - an Opinionated Event Sourcing and CQRS Framework using C#. It can store data into Azure Cosmos DB, AWS Dynamo DB or Postgres
BDFFZI/Alife
一款专注于桌宠方向的AIAgent。特点是一键安装、功能齐全、极低开销、完全暴露上下文、全功能插件化、AI自主插件开发、永久唯一会话、类游戏引擎交互策略。具有极高的扩展性和拟人程度上限,非常适合想长期培养和自定义需求高的用户。
ErrorLSC/Polars.NET
.NET DataFrame Engine, powered by Arrow and Polars
RusselWebber/xlDuckDb
Use DuckDB within Excel with the xlDuckDb addin
idaholab/DeepLynx
DeepLynx Nexus is version 2 of the DeepLynx data warehouse, and acts as the central integration point for the DeepLynx data ecosystem. Nexus is a functional data catalog and digital thread tool, allowing users to track metadata from disparate sources and identify ontological and semantic connections between data. It is written in C# and React.
Version Downloads Last Updated
1.5.6.1 2 10/15/2026
1.5.6 42,879 9/28/2026
1.5.5 377,735 7/26/2026
1.5.3 393,682 5/24/2026
1.5.2 151,725 4/24/2026
1.5.0 186,579 3/10/2026
1.4.4 187,152 2/3/2026
1.4.4-alpha.2 3,585 12/19/2025
1.4.3 121,285 12/11/2025
1.4.1 210,247 10/13/2025
1.3.2 222,495 7/8/2025
1.3.0 212,731 6/3/2025
1.2.1 620,439 3/5/2025
1.2.1-alpha.8 425 2/19/2025
1.2.0 180,882 2/6/2025
1.1.3 420,676 11/7/2024
1.1.2.1 88,237 10/21/2024
1.1.2-alpha.5 227 10/10/2024
1.1.1 102,291 9/24/2024
Loading failed

- Built on DuckDB v1.5.6

New features:
- Read a TIME column as TimeSpan
- Read FLOAT as double, DOUBLE as float, and both as decimal, in columns, list items, maps and structs
- Read HUGEINT and UHUGEINT columns as DuckDBHugeInt and DuckDBUHugeInt with GetFieldValue and GetProviderSpecificValue
- The mapped appender now accepts DuckDBDateOnly and DuckDBTimeOnly properties, and scalar functions accept them as parameters and results
- BigInteger values can now be bound and appended to UHUGEINT columns as unsigned values, including through the mapped appender
- A table function over an array now uses the length of the array as its cardinality hint when none is given

Performance (measured against 1.5.6 on .NET 10 with a million rows; the gains are in moving values between DuckDB and .NET, so bulk appends, reading large results and queries that call C# functions benefit most, while queries dominated by DuckDB's own work change little):
- Reading numbers and booleans through GetInt32, GetFieldValue<T> and the other typed getters 3.5 to 6 times faster, an integer column read as double 12 times faster
- Reading short strings up to 1.35 times faster
- Reading dates, times and timestamps 3 to 12 times faster, appending a DateTime 14 to 26 times faster
- UUID, DECIMAL and HUGEINT reads 1.7 to 7 times faster
- Typed scalar functions 5 to 8 times faster, 1.6 times with a string argument
- Table functions 2.5 to 6 times faster
- With projection pushdown, the columns a query does not read are no longer computed: a query that reads one column of a four-column table function is about 6 times faster, and the gain grows with the number of unread columns
- LIST, STRUCT and MAP columns read into .NET types up to 6 times faster
- Appending BigInteger, lists, strings, C# enums and through the mapped appender 1.3 to 4 times faster; numbers 1.2 to 1.4 times faster; decimals of up to 18 digits 1.3 to 2 times faster depending on the CPU, wider decimals more than twice as fast

Memory (per million rows, against 1.5.6):
- Appending no longer allocates for each value. 1.5.6 allocated about 750 bytes for every DateTime (2.9 GB for four TIMESTAMP columns), 756 MB for a record of mixed types in the mapped appender, 211 MB for lists of int?, 188 MB for C# enums and up to 315 MB for BigInteger; each is now about 0.1 MB
- Scalar functions with nullable arguments or results, and table functions over structs or rows with nullable columns, no longer allocate for each row: 21 to 47 MB in 1.5.6, now about 0.1 MB
- An integer read as double no longer allocates (375 MB for eight million values in 1.5.6), a DECIMAL wider than 18 digits is read without a BigInteger (107 MB, now none), and a large HUGEINT read as BigInteger allocates a third as much
- LIST, STRUCT and MAP reads allocate up to 60% less, and GetValues 9 to 17% less

Fixes:
- A Read() after the end of a streaming result, and the first Read() of an empty streaming result, no longer throw (#358)
- Reading an ENUM column as a type other than string no longer reads past the stored value
- Reading a BIT column as an unsupported type throws InvalidCastException instead of ending the process with a stack overflow
- Negative intervals can be read as TimeSpan, bound and appended
- A TIMETZ read as DateTimeOffset no longer throws for a time earlier in the day than its positive offset
- -2^127 is accepted as a HUGEINT value, and the HUGEINT limits no longer fail under cultures with another minus sign
- A decimal parameter is sent with the exact number of its digits; 1000 was sent as DECIMAL(3,0)
- A list parameter that DuckDB cannot build is refused instead of crashing the process
- The exception of a scalar function that throws in WHERE or HAVING is now the InnerException of the error
- A table function projection that calls a constructor (a record or a tuple) is refused with a clear message instead of a NullReferenceException
- The mapped appender disposes its appender when validation fails
- DuckDBClientFactory.CanCreateCommandBuilder and CanCreateDataAdapter return false instead of throwing

Behavior changes:
- Appending a decimal too wide for its column throws instead of storing a value the column cannot hold
- A TimeSpan parameter where DuckDB cannot infer the type is bound as an INTERVAL instead of as text; declare DbType.Time to bind it as a time
- Looking up a missing parameter by name through DbParameterCollection throws IndexOutOfRangeException, as the typed indexer does
- A TIMETZ read as DateTimeOffset is placed on 0001-01-02 instead of 0001-01-01
- A BigInteger parameter where DuckDB cannot infer the type is bound as HUGEINT if it fits, as UHUGEINT up to 2^128 - 1 and as BIGNUM beyond, instead of throwing for values outside the HUGEINT range