# ClickHouseServerResource

- Module: [Aspire.Hosting.ClickHouse](/reference/api/typescript/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

```typescript
interface ClickHouseServerResource
  extends IComputeResource,
    IExpressionValue,
    IManifestExpressionProvider,
    IResource,
    IResourceWithArgs,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IValueProvider,
    IValueWithReferences {
  readonly connectionStringExpression: ReferenceExpression;
  readonly databases: Dict<string,string>;
  readonly host: EndpointReferenceExpression;
  readonly passwordParameter: ParameterResource;
  readonly port: EndpointReferenceExpression;
  readonly primaryEndpoint: EndpointReference;
  readonly userNameParameter: ParameterResource;
  readonly userNameReference: ReferenceExpression;
  addDatabase(
      name: string,
      databaseName?: string): ClickHouseDatabaseResource;
  withDataBindMount(
      source: string,
      isReadOnly?: boolean): ClickHouseServerResource;
  withDataVolume(
      name?: string,
      isReadOnly?: boolean): ClickHouseServerResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the connection string expression for the ClickHouse server.
- `databases`: `Dict<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/typescript/aspire.hosting.clickhouse/clickhouseserverresource/adddatabase.md) -- `method` -- Adds a ClickHouse database to the application model.
    ```typescript
  addDatabase(name: string, databaseName?: string): ClickHouseDatabaseResource
  ```
- [withDataBindMount](/reference/api/typescript/aspire.hosting.clickhouse/clickhouseserverresource/withdatabindmount.md) -- `method` -- Adds a bind mount for the data folder to a ClickHouse container resource.
    ```typescript
  withDataBindMount(source: string, isReadOnly?: boolean): ClickHouseServerResource
  ```
- [withDataVolume](/reference/api/typescript/aspire.hosting.clickhouse/clickhouseserverresource/withdatavolume.md) -- `method` -- Adds a named volume for the data folder to a ClickHouse container resource.
    ```typescript
  withDataVolume(name?: string, isReadOnly?: boolean): ClickHouseServerResource
  ```
