Skip to main content
Version: 1.8.0

ClickHouseConn

class ClickHouseConn(
host: str,
staging: StagingConfig,
port: int = 8123,
database: str = 'default',
credentials: UserPasswordCredentials | None = None,
secure: bool = False,
enforce_connection_params: bool = True,
cx_src_configs_clickhouse: dict | None = None,
cx_dst_configs_clickhouse: dict | None = None,
)

Bases: Conn

Categories: connections

Represents a connection configuration for ClickHouse with cloud-staged bulk loading.

ClickHouse ingests data via cloud storage (S3, Azure Blob, or GCS): files are first uploaded to the configured staging area and then loaded into ClickHouse using the matching table function (s3(), azureBlobStorage(), or s3() pointed at GCS).

Represents a connection configuration for ClickHouse with cloud-staged bulk loading.

ClickHouse ingests data via cloud storage (S3, Azure Blob, or GCS): files are first uploaded to the configured staging area and then loaded into ClickHouse using the matching table function (s3(), azureBlobStorage(), or s3() pointed at GCS).

Parameters

parameter
host

ClickHouse server hostname or IP address.

parameter
staging

Cloud storage staging configuration. Provide one of: * :class:~tabsdata._io.cloud_staging.common.storage_config.S3Config — stage files in Amazon S3 and read with ClickHouse's s3() table function. * :class:~tabsdata._io.cloud_staging.common.storage_config.AzureConfig — stage files in Azure Blob Storage and read with azureBlobStorage(). * :class:~tabsdata._io.cloud_staging.common.storage_config.GCSConfig — stage files in Google Cloud Storage and read with ClickHouse's s3() table function via the GCS S3-compatible HMAC API.

parameter
port

HTTP(S) port of the ClickHouse server. Use 8123 for plain HTTP (default) and 8443 for HTTPS/TLS.

parameter
database

Target database name. Defaults to "default".

parameter
credentials

:class:~tabsdata.UserPasswordCredentials for ClickHouse authentication. When None the ClickHouse default user with no password is used.

parameter
secure

If True, connect to ClickHouse over HTTPS/TLS. Defaults to False.

parameter
enforce_connection_params

Whether to enforce connection parameters for the ClickHouse connection. Applicable only for connections to a ClickHouse destination. Defaults to True.

parameter
cx_src_configs_clickhouse

Source-specific configuration parameters for the ClickHouse connection. Defaults to None.

parameter
cx_dst_configs_clickhouse

Destination-specific configuration parameters for the ClickHouse connection. Defaults to None.

Properties

property
credentialsUserPasswordCredentials | None

The credentials used to authenticate with ClickHouse. None if no credentials were provided (ClickHouse default user, no password).

property
cx_dst_configs_clickhousedict

Destination-specific configuration parameters for the ClickHouse connection.

property
cx_src_configs_clickhousedict

Source-specific configuration parameters for the ClickHouse connection.

property
databasestr

The target ClickHouse database name.

property
enforce_connection_paramsbool

Whether to enforce connection parameters for the ClickHouse connection.

property
hoststr

The ClickHouse server hostname or IP address.

property
portint

The HTTP(S) port of the ClickHouse server.

property
securebool

Whether to connect to ClickHouse over HTTPS/TLS.

property
stagingStagingConfig

The cloud storage staging configuration (S3Config, AzureConfig, or GCSConfig).