This article covers:
To make a connection to Clickhouse, navigate to the Connections page, select New Connection, then select the Clickhouse from the New Connection modal. You'll be asked to provide a host, key and token:
https is allowed here in order to securely transfer data over the wire. The structure of the host url expects: https://url-to-clickhouse-db:port/database
By default, the plugin will connect to the 'default' database and the 443 port. By providing a database after the '/' you can configure which database to connect to.Please refer to the examples in our developer documentation to find out how to create a connection to Clickhouse via our API.
Notes:
Distributed table engine some Luzmo-charts might fail when distributed_product_mode is deny. This should only occur, however, if you link the table to another table and use that link in a chart. In that case make sure to set the distributed_product_mode to another option that makes sense for you within your Clickhouse cluster. If you are using Clickhouse Cloud you can safely ignore this setting.{{metadata.< parameter name >|< default value >}}. Find out more about parameterized SQL Datasets.Also make sure to check out this article on Preparing your data for analytics.
To find out how to add datasets using our API, please refer to the examples in our developer documentation.
When generating an Authorization token to grant a user acces to your embedded dashboards it is possible to override the data source properties in the authorization request to dynamically use different properties. Find out more about connection overrides.
The fields available for overriding a Clickhouse connection are as follows:
Our developer documentation has more info about connection overrides and an example of a Clickhouse connection override.
Example code demonstrating how to override a Clickhouse connection:
import Luzmo from '@luzmo/nodejs-sdk';
const client = new Luzmo({
api_key: '<your Luzmo API key>',
api_token: '<your Luzmo API token>',
host: 'https://api.luzmo.com:443'
});
const response = await client.create('authorization',
{
type: "embed",
username: "< A unique and immutable identifier for your user >",
name: "< user name >",
email: "< user email >",
suborganization: "< a suborganization name >",
access: {
collections: [
{
id: "<collection_id>",
inheritRights: "use"
}
]
},
account_overrides: {
<your connection_id>: {
host: "<The new database host URL to connect to>",
key: "<username>",
token: "<password>"
}
}
}
);
| Data Type In Clickhouse | Data Type In Luzmo |
|---|---|
| Date | datetime |
| LowCardinality(Date) | datetime |
| Array(Date) | datetime[] |
| Array(LowCardinality(Date)) | datetime[] |
| Date32 | datetime |
| Array(Date32) | datetime[] |
| DateTime | datetime |
| LowCardinality(DateTime) | datetime |
| Array(DateTime) | datetime[] |
| Array(LowCardinality(DateTime)) | datetime[] |
| DateTime64 | datetime |
| Array(DateTime64) | datetime[] |
| Decimal | numeric |
| Array(Decimal) | numeric[] |
| Float | numeric |
| LowCardinality(Float) | numeric |
| Array(Float) | numeric[] |
| Array(LowCardinality(Float)) | numeric[] |
| Int | numeric |
| LowCardinality(Int) | numeric |
| Array(Int) | numeric[] |
| Array(LowCardinality(Int)) | numeric[] |
| UInt | numeric |
| LowCardinality(UInt) | numeric |
| Array(UInt) | numeric[] |
| Array(LowCardinality(UInt)) | numeric[] |
| Bool | hierarchy |
| Array(Bool) | hierarchy[] |
| Enum8 | hierarchy |
| Array(Enum8) | hierarchy[] |
| Enum16 | hierarchy |
| Array(Enum16) | hierarchy[] |
| FixedString | hierarchy |
| LowCardinality(FixedString) | hierarchy |
| Array(FixedString) | hierarchy[] |
| Array(LowCardinality(FixedString)) | hierarchy[] |
| IPv4 | hierarchy |
| Array(IPv4) | hierarchy[] |
| IPv6 | hierarchy |
| Array(IPv6) | hierarchy[] |
| String | hierarchy |
| LowCardinality(String) | hierarchy |
| Array(String) | hierarchy[] |
| Array(LowCardinality(String)) | hierarchy[] |
| UUID | hierarchy |
| Array(UUID) | hierarchy[] |