Integrating with ClickHouse
Connect a ClickHouse database and sync its tables and views into Drivetrain
Overview
Drivetrain connects to ClickHouse over its HTTPS interface. One ClickHouse connector covers one database, once you connect it, you choose which tables and views inside that database to sync. You don't create a separate connector for each table.
Connection details
Provide these values when you add the connector:
Hostname
Your ClickHouse host, e.g. abc123.us-east-1.aws.clickhouse.cloud
Port
The HTTPS interface port, 8443 on ClickHouse Cloud
Username
A read-only user (see Permissions below)
Password
Password for that user
Database
The database whose tables you want to sync, e.g. analytics
Drivetrain validates the credentials by running SELECT 1 against the database before saving the connection.
Selecting tables and views
Once the connection validates, Drivetrain lists every table and view in the database that your user can read. Select as many as you need, each one syncs into its own table in Drivetrain, and you can add or remove objects later without recreating the connector.
Because the database is already set on the connection, names appear unqualified (orders, not analytics.orders). There's nowhere in setup to type a table name or a SQL query, you select from the list.
Syncing more than one database
Table listing is scoped to the database in the connection. To sync tables from a second database, add a second ClickHouse connector with that database name. The host, port, and credentials can stay the same.
Permissions
The user needs:
SELECTon each table or view you sync.Read access to the underlying tables of any view you sync.
Tip: Use a dedicated read-only user scoped to just the objects you want to share.
Using views to shape what you share
Selecting a raw table works, Drivetrain reads its full contents. Views are optional, and they give you tighter control over what leaves your warehouse and over sync volume. A view lets you:
Expose only the columns Drivetrain needs, instead of a whole wide table.
Pre-aggregate or pre-filter, for example, restrict to the last 24 months.
Encapsulate joins so Drivetrain reads one object instead of several.
Create the view in the database you connected and grant your Drivetrain user SELECT on it. It appears in the list alongside regular tables, and you select it the same way, no different connector, credentials, or setup steps.
Last updated
Was this helpful?