UDataset.DuckDB
0.14.2
dotnet add package UDataset.DuckDB --version 0.14.2
NuGet\Install-Package UDataset.DuckDB -Version 0.14.2
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="UDataset.DuckDB" Version="0.14.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UDataset.DuckDB" Version="0.14.2" />
<PackageReference Include="UDataset.DuckDB" />
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 UDataset.DuckDB --version 0.14.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: UDataset.DuckDB, 0.14.2"
#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 UDataset.DuckDB@0.14.2
#: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=UDataset.DuckDB&version=0.14.2
#tool nuget:?package=UDataset.DuckDB&version=0.14.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
UDataset.DuckDB
UDataset.DuckDB is a DuckDB implementation for UDataset cross-database data access framework. It provides DuckDB-specific implementations of core UDataset interfaces, enabling seamless data operations with DuckDB databases.
Features
- In-Process Database: DuckDB runs as an in-process database, eliminating need for a separate server setup
- Column-Oriented Storage: Optimized for analytical workloads (OLAP) with columnar storage
- File-Based or In-Memory: Supports both persistent file databases (
*.db) and in-memory databases - High-Performance Analytics: Optimized for complex analytical queries and data warehousing
- JSON Support: Native JSON data type support with efficient querying capabilities
- Full UDataset Features: Complete implementation of all UDataset features including CRUD, transactions, and schema management
- SQL Transformation: Automatic transformation for DuckDB-specific SQL syntax
- Connection Management: Efficient connection pooling and management
Installation
dotnet add package UDataset.Core
dotnet add package UDataset.DuckDB
Quick Start
1. Register Provider
using UDataset.Core;
using UDataset.DuckDB;
// Register DuckDB provider at application startup
DuckDbBootstrapper.Register();
2. Create Connection
// File-based database (persistent)
string connectionString = "DataSource=C:\\Data\\my_database.db";
IConnection connection = ProviderFactory.CreateConnection("DuckDB", connectionString);
// In-memory database (data lost after connection closes)
string memoryConnectionString = "DataSource=:memory:";
IConnection memoryConnection = ProviderFactory.CreateConnection("DuckDB", memoryConnectionString);
3. Basic Operations
// Create table
var schemaManager = ProviderFactory.CreateSchemaManager("DuckDB", connectionString);
var table = new Table("sales_data")
.WithAutoIncrementPK("id")
.WithoutVersionControl();
table.Attributes.Add(new Column("product_name", DataType.String) { Properties = { [ColumnProperty.Length] = 200 } });
table.Attributes.Add(new Column("amount", DataType.Decimal));
table.Attributes.Add(new Column("sale_date", DataType.DateTime));
schemaManager.Create(table);
// Insert data
var sale = new Row("sales_data")
{
["product_name"] = "Product A",
["amount"] = 99.99m,
["sale_date"] = DateTime.UtcNow
};
await connection.Create(sale);
// Analytical query (DuckDB's strength)
var query = new QueryExpression("sales_data");
query.AddSelect("product_name", "Product");
query.AddSelect("SUM(amount)", "TotalSales");
query.AddSelect("AVG(amount)", "AverageSale");
query.GroupBy = new List<string> { "product_name" };
query.AddOrderBy("TotalSales", SortDirection.Descending);
var results = await connection.Query(query);
Use Cases
DuckDB is ideal for:
- Data Analytics: Processing and analyzing large datasets with complex aggregations
- Data Warehousing: Building analytical data warehouses with columnar storage
- Local Analysis: Running analytical queries on CSV, Parquet, and JSON files
- Embedded Applications: Applications that need database functionality without external dependencies
- ETL Pipelines: Extract, Transform, Load operations with high-performance batch processing
- Prototyping: Quick prototyping and data exploration with zero setup
Compatibility
- DuckDB 1.5.x (DuckDB.NET.Data.Full 1.5.0)
- .NET 8.0
- Windows, Linux, macOS
- File-based and in-memory databases
Performance Characteristics
- Analytical Queries: Optimized for SELECT queries with aggregations, GROUP BY, and joins
- Batch Inserts: Efficient bulk insert operations with automatic parameter batching (max 10,000 parameters)
- Columnar Storage: Reads only required columns, reducing I/O
- Vectorized Execution: Leverages CPU vectorization for faster query processing
Limitations
- DuckDB is not optimized for transactional (OLTP) workloads
- Concurrent writes have limitations compared to traditional databases
- Not suitable for applications requiring high write throughput
- File-based databases are single-user by default
Requirements
- .NET 8.0
- DuckDB.NET.Data.Full 1.5.0
Dependencies
- UDataset.Core
- DuckDB.NET.Data.Full 1.5.0
- Dapper 2.1.66
- System.Data.Common
- System.Text.Json
Version History
0.14.0 (2026-08-06)
- WhenNotExists dispatched to conditional check path
- Full regression passed: 8 functional groups, 0 failures
0.11.0 (2026-04-16)
- Added DM (Dameng) and KingbaseES database support to UDataset framework
- Note: KingbaseES support is experimental and not recommended for production use
For general usage examples and advanced features, please refer to UDataset.Core documentation.
| 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 was computed. 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.
-
net8.0
- Dapper (>= 2.1.66)
- DuckDB.NET.Data.Full (>= 1.5.0)
- UDataset.Core (>= 0.14.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.14.2 | 96 | 8/9/2026 |
| 0.14.1 | 101 | 8/9/2026 |
| 0.14.0 | 94 | 8/7/2026 |
| 0.13.0 | 107 | 5/7/2026 |
| 0.12.2 | 108 | 4/30/2026 |
| 0.12.1 | 111 | 4/29/2026 |
| 0.12.0 | 114 | 4/28/2026 |
| 0.11.3 | 125 | 4/23/2026 |
| 0.11.2 | 114 | 4/19/2026 |
| 0.11.1 | 112 | 4/17/2026 |
| 0.11.0 | 102 | 4/16/2026 |
| 0.10.4 | 136 | 3/28/2026 |
| 0.10.3 | 119 | 3/24/2026 |
| 0.10.2 | 120 | 3/24/2026 |
| 0.9.12 | 126 | 2/25/2026 |
| 0.9.11 | 128 | 2/8/2026 |
| 0.9.10 | 129 | 2/5/2026 |
Loading failed