# ClickHouseServerResource

- Module: [Aspire.Hosting.ClickHouse](/reference/api/go/aspire.hosting.clickhouse.md)
- Version: `13.5.3`
- Kind: `handle`
- Source: [GitHub](https://github.com/ClickHouse/ClickHouse.Aspire/tree/cabd9edc0899714407e6ad81dc4954eb01302af0)

A resource that represents a ClickHouse container.

## Definition

```go
type ClickHouseServerResource interface {
    ExpressionValue
    IComputeResource
    Resource
    ResourceWithArgs
    ResourceWithConnectionString
    ResourceWithEndpoints
    ResourceWithEnvironment
    ResourceWithWaitSupport
}
```

## Embeds

- `ExpressionValue`
- `IComputeResource`
- `Resource`
- `ResourceWithArgs`
- `ResourceWithConnectionString`
- `ResourceWithEndpoints`
- `ResourceWithEnvironment`
- `ResourceWithWaitSupport`

## Properties

- `ConnectionStringExpression`: `*ReferenceExpression` `get` -- Gets the connection string expression for the ClickHouse server.
- `Databases`: `map[string]string` `get` -- A dictionary where the key is the resource name and the value is the database name.
- `Host`: `EndpointReferenceExpression` `get` -- Gets the host expression for this resource.
- `PasswordParameter`: `ParameterResource` `get` -- Gets the parameter that contains the ClickHouse server password.
- `Port`: `EndpointReferenceExpression` `get` -- Gets the port expression for this resource.
- `PrimaryEndpoint`: `EndpointReference` `get` -- Gets the primary endpoint for the ClickHouse server.
- `UserNameParameter`: `ParameterResource` `get` -- Gets the parameter that contains the ClickHouse server username.
- `UserNameReference`: `*ReferenceExpression` `get` -- Gets a reference to the user name for the ClickHouse server.

## Methods

- [AddDatabase](/reference/api/go/aspire.hosting.clickhouse/clickhouseserverresource/adddatabase.md) -- `method` -- Adds a ClickHouse database to the application model.
  ```go
  AddDatabase(name string, options ...*AddDatabaseOptions) ClickHouseDatabaseResource
  ```
- [WithDataBindMount](/reference/api/go/aspire.hosting.clickhouse/clickhouseserverresource/withdatabindmount.md) -- `method` -- Adds a bind mount for the data folder to a ClickHouse container resource.
  ```go
  WithDataBindMount(source string, options ...*WithDataBindMountOptions) ClickHouseServerResource
  ```
- [WithDataVolume](/reference/api/go/aspire.hosting.clickhouse/clickhouseserverresource/withdatavolume.md) -- `method` -- Adds a named volume for the data folder to a ClickHouse container resource.
  ```go
  WithDataVolume(options ...*WithDataVolumeOptions) ClickHouseServerResource
  ```
