Skip to content
DocsTry Aspire
DocsTry

DuckDBResourceBuilderExtensions Methods

ClassMethods2 members
Provides extension methods for adding DuckDB resources to an application builder.
AddDuckDB(IDistributedApplicationBuilder, string, string?, string?)Section titled AddDuckDB(IDistributedApplicationBuilder, string, string?, string?)extensionIResourceBuilder<DuckDBResource>
Adds a DuckDB resource to the application builder.
public static class DuckDBResourceBuilderExtensions
{
public static IResourceBuilder<DuckDBResource> AddDuckDB(
this IDistributedApplicationBuilder builder,
string name,
string? databasePath = null,
string? databaseFileName = null)
{
// ...
}
}
builderIDistributedApplicationBuilderThe application builder.
namestringThe name of the resource.
databasePathstring?optionalThe optional path to the database file. If no path is provided the database is stored in a temporary location.
databaseFileNamestring?optionalThe filename of the database file. Must include extension. If no file name is provided, a randomly generated file name is used.
IResourceBuilder<DuckDBResource>A resource builder for the DuckDB resource.
WithReadOnly(IResourceBuilder<DuckDBResource>)Section titled WithReadOnly(IResourceBuilder<DuckDBResource>)extensionIResourceBuilder<DuckDBResource>
Configures the DuckDB resource to open the database in read-only mode.
public static class DuckDBResourceBuilderExtensions
{
public static IResourceBuilder<DuckDBResource> WithReadOnly(
this IResourceBuilder<DuckDBResource> builder)
{
// ...
}
}
builderIResourceBuilder<DuckDBResource>The resource builder.
IResourceBuilder<DuckDBResource>A resource builder for the DuckDB resource.