- Gather your connection details
To connect to ClickHouse with HTTP(S) you need this information:
| Parameter(s) | Description |
|---|---|
HOST and PORT | Typically, the port is 8443 when using TLS or 8123 when not using TLS. |
DATABASE NAME | Out of the box, there is a database named default, use the name of the database that you want to connect to. |
USERNAME and PASSWORD | Out of the box, the username is default. Use the username appropriate for your use case. |
curl command.
If you’re using self-managed ClickHouse, the connection details are set by your ClickHouse administrator.
- Create a ClickHouse connection type
You add a database connection using Embeddable API. This connection is used to connect to your ClickHouse service. You can add a connection using the following API call:
Query
Response
CREATE action, but all CRUD operations are available.
The apiKey can be found by clicking “Publish” on one of your Embeddable dashboards.
The name is a unique name to identify this connection.
- By default your data models will look for a connection called “default”, but you can supply your models with different
data_sourcenames to support connecting different data models to different connections (simply specify the data_source name in the model)
type tells Embeddable which driver to use
- Here you’ll want to use
clickhouse, but you can connect multiple different data sources to one Embeddable workspace so you may use others such as:postgres,bigquery,mongodb, etc.
credentials is a JavaScript object containing the necessary credentials expected by the driver
- These are securely encrypted and only used to retrieve exactly the data you have described in your data models. Embeddable strongly encourage you to create a read-only database user for each connection (Embeddable will only ever read from your database, not write).