Skip to main content

Connect to ClickHouse

Credentials

DirectQuery delegates the credentials handling to the ClickHouse server.

The credentials, based on a username and password, are passed via ClickhouseConfiguration to the server:

final ClickhouseProperties properties = ClickhouseProperties.builder()
.host(HOST)
.protocol(ClickHouseProtocol.HTTP)
.port(port)
.database("TUTORIAL")
.userName(USERNAME)
.password(PASSWORD)
.build();

The ClickHouse server can be configured to handle these credentials in various ways, such as checking internally or externally with an LDAP server.

Permissions

ClickHouse is using standard SQL permissions via the granting of roles to the user.

For DirectQuery, the user should at a minimum have read permissions on some system tables (system.databases, system.tables and system.columns) and all the tables containing relevant data.

The permissions can be granted by following this role guide.