Provides extension methods and resource definitions for the Aspire AppHost to support creating and running DuckDB databases.
DuckDB is an in-process analytical (OLAP) database, ideal for analytics workloads, Parquet/CSV querying, and data processing.
By default, the DuckDB resource will create a new DuckDB database in a temporary location. You can also specify a path to an existing DuckDB database file.
In your AppHost project, install the package using the following command:
dotnet add package CommunityToolkit.Aspire.Hosting.DuckDB
Then, in the Program.cs file of AppHost, define a DuckDB resource, then call AddDuckDB:
var duckdb = builder.AddDuckDB("analytics");To use a read-only database for analytics:
var duckdb = builder.AddDuckDB("warehouse")
.WithReadOnly();