# AddDuckDB

- Module: [CommunityToolkit.Aspire.Hosting.DuckDB](/reference/api/go/communitytoolkit.aspire.hosting.duckdb.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: `DistributedApplicationBuilder`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Adds a DuckDB resource to the application builder.

## Definition

```go
func (DistributedApplicationBuilder) AddDuckDB(
    name string,
    options ...*AddDuckDBOptions,
) DuckDBResource
```

## Parameters

- `name` (`string`) -- The name of the resource.
- `options` (`...*AddDuckDBOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*AddDuckDBOptions` argument.

- `DatabasePath` (`*string`) -- The optional path to the database file. If no path is provided the database is stored in a temporary location.
- `DatabaseFileName` (`*string`) -- The filename of the database file. Must include extension. If no file name is provided, a randomly generated file name is used.

## Returns

[`DuckDBResource`](/reference/api/go/communitytoolkit.aspire.hosting.duckdb/duckdbresource.md) -- A resource builder for the DuckDB resource.

Returns a handle; failures surface later via `Err()`.

## Applies to

- `DistributedApplicationBuilder`
