Skip to content
DocsTry Aspire
DocsTry

ClickHouseBuilderExtensions Methods

ClassMethods5 members
Provides extension methods for adding ClickHouse resources to an Hosting.IDistributedApplicationBuilder.
AddClickHouse(IDistributedApplicationBuilder, string, int?)Section titled AddClickHouse(IDistributedApplicationBuilder, string, int?)extensionIResourceBuilder<ClickHouseServerResource>
Adds a ClickHouse resource to the application model. A container is used for local development.
public static class ClickHouseBuilderExtensions
{
public static IResourceBuilder<ClickHouseServerResource> AddClickHouse(
this IDistributedApplicationBuilder builder,
string name,
int? port)
{
// ...
}
}
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder.
namestringThe name of the resource. This name will be used as the connection string name when referenced in a dependency.
portint?The host port for ClickHouse.
IResourceBuilder<ClickHouseServerResource>A reference to the ApplicationModel.IResourceBuilder`1.
This version of the package defaults to the tag of the container image.
AddClickHouse(IDistributedApplicationBuilder, string, int?, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>)Section titled AddClickHouse(IDistributedApplicationBuilder, string, int?, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>)extensionIResourceBuilder<ClickHouseServerResource>
public static class ClickHouseBuilderExtensions
{
public static IResourceBuilder<ClickHouseServerResource> AddClickHouse(
this IDistributedApplicationBuilder builder,
string name,
int? port = null,
IResourceBuilder<ParameterResource>? userName = null,
IResourceBuilder<ParameterResource>? password = null)
{
// ...
}
}
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder.
namestringThe name of the resource. This name will be used as the connection string name when referenced in a dependency.
portint?optionalThe host port for ClickHouse.
userNameIResourceBuilder<ParameterResource>optionalA parameter that contains the ClickHouse server user name, or null to use a default value.
passwordIResourceBuilder<ParameterResource>optionalA parameter that contains the ClickHouse server password, or null for no password.
IResourceBuilder<ClickHouseServerResource>A reference to the ApplicationModel.IResourceBuilder`1.
This overload is not available in polyglot AppHosts. Use ClickHouseBuilderExtensions.AddClickHouseForPolyglot instead.
AddDatabase(IResourceBuilder<ClickHouseServerResource>, string, string?)Section titled AddDatabase(IResourceBuilder<ClickHouseServerResource>, string, string?)extensionIResourceBuilder<ClickHouseDatabaseResource>
Adds a ClickHouse database to the application model.
public static class ClickHouseBuilderExtensions
{
public static IResourceBuilder<ClickHouseDatabaseResource> AddDatabase(
this IResourceBuilder<ClickHouseServerResource> builder,
string name,
string? databaseName = null)
{
// ...
}
}
builderIResourceBuilder<ClickHouseServerResource>The ClickHouse server resource builder.
namestringThe name of the resource. This name will be used as the connection string name when referenced in a dependency.
databaseNamestring?optionalThe name of the database. If not provided, this defaults to the same value as name.
IResourceBuilder<ClickHouseDatabaseResource>A reference to the ApplicationModel.IResourceBuilder`1.
WithDataBindMount(IResourceBuilder<ClickHouseServerResource>, string, bool)Section titled WithDataBindMount(IResourceBuilder<ClickHouseServerResource>, string, bool)extensionIResourceBuilder<ClickHouseServerResource>
Adds a bind mount for the data folder to a ClickHouse container resource.
public static class ClickHouseBuilderExtensions
{
public static IResourceBuilder<ClickHouseServerResource> WithDataBindMount(
this IResourceBuilder<ClickHouseServerResource> builder,
string source,
bool isReadOnly = false)
{
// ...
}
}
builderIResourceBuilder<ClickHouseServerResource>The resource builder.
sourcestringThe source directory on the host to mount into the container.
isReadOnlybooloptionalA flag that indicates if this is a read-only mount.
IResourceBuilder<ClickHouseServerResource>The ApplicationModel.IResourceBuilder`1.
WithDataVolume(IResourceBuilder<ClickHouseServerResource>, string?, bool)Section titled WithDataVolume(IResourceBuilder<ClickHouseServerResource>, string?, bool)extensionIResourceBuilder<ClickHouseServerResource>
Adds a named volume for the data folder to a ClickHouse container resource.
public static class ClickHouseBuilderExtensions
{
public static IResourceBuilder<ClickHouseServerResource> WithDataVolume(
this IResourceBuilder<ClickHouseServerResource> builder,
string? name = null,
bool isReadOnly = false)
{
// ...
}
}
builderIResourceBuilder<ClickHouseServerResource>The resource builder.
namestring?optionalThe name of the volume. Defaults to an auto-generated name based on the application and resource names.
isReadOnlybooloptionalA flag that indicates if this is a read-only volume.
IResourceBuilder<ClickHouseServerResource>The ApplicationModel.IResourceBuilder`1.