# ClickHouseServerResource.AddDatabase

- Module: [Aspire.Hosting.ClickHouse](/reference/api/go/aspire.hosting.clickhouse.md)
- Defined on: [ClickHouseServerResource](/reference/api/go/aspire.hosting.clickhouse/clickhouseserverresource.md)
- Version: `13.5.3`
- Kind: `method`

Adds a ClickHouse database to the application model.

## Definition

```go
type ClickHouseServerResource interface {
    // ... omitted for brevity
    AddDatabase(
        name string,
        options ...*AddDatabaseOptions,
    ) ClickHouseDatabaseResource
}
```

## Signature

```go
AddDatabase(
    name string,
    options ...*AddDatabaseOptions,
) ClickHouseDatabaseResource
```

## Parameters

- `name` (`string`) -- The name of the resource. This name will be used as the connection string name when referenced in a dependency.
- `options` (`...*AddDatabaseOptions`) -- optional settings, see [Options](#options)

## Options

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

- `DatabaseName` (`*string`) -- The name of the database. If not provided, this defaults to the same value as `name`.

## Returns

[`ClickHouseDatabaseResource`](/reference/api/go/aspire.hosting.clickhouse/clickhousedatabaseresource.md) -- The ClickHouse database resource.

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

## Defined on

- [ClickHouseServerResource](/reference/api/go/aspire.hosting.clickhouse/clickhouseserverresource.md) -- `handle`
