docs/integrations/data-integrations/clickhouse.mdx
This documentation describes the integration of MindsDB with ClickHouse, a high-performance, column-oriented SQL database management system (DBMS) for online analytical processing (OLAP). The integration allows MindsDB to access data from ClickHouse and enhance ClickHouse with AI capabilities.
Before proceeding, ensure the following prerequisites are met:
Establish a connection to ClickHouse from MindsDB by executing the following SQL command and providing its handler name as an engine.
CREATE DATABASE clickhouse_conn
WITH ENGINE = 'clickhouse',
PARAMETERS = {
"host": "127.0.0.1",
"port": "8443",
"user": "root",
"password": "mypass",
"database": "test_data",
"protocol" : "https"
}
Required connection parameters include the following:
host: is the hostname or IP address of the ClickHouse server.port: is the TCP/IP port of the ClickHouse server.user: is the username used to authenticate with the ClickHouse server.password: is the password to authenticate the user with the ClickHouse server.database: defaults to default. It is the database name to use when connecting with the ClickHouse server.protocol: defaults to native. It is an optional parameter. Its supported values are native, http and https.The following usage examples utilize the connection to ClickHouse made via the CREATE DATABASE statement and named clickhouse_conn.
Retrieve data from a specified table by providing the integration and table name.
SELECT *
FROM clickhouse_conn.table_name
LIMIT 10;