Databases
ClickHouse
This is the implementation of the ClickHouse data handler for MindsDB.
ClickHouse is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).
Prerequisites
Before proceeding, ensure the following prerequisites are met:
- Install MindsDB locally via Docker or use MindsDB Cloud.
- To connect ClickHouse to MindsDB, install the required dependencies following this instruction.
- Install or ensure access to ClickHouse.
Implementation
This handler was implemented using the standard clickhouse-sqlalchemy
library.
The required arguments to establish a connection are as follows:
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 todefault
. It is the database name to use when connecting with the ClickHouse server.protocol
defaults tonative
. It is an optional parameter. Its supported values arehttp
andhttps
.
Usage
In order to make use of this handler and connect to the ClickHouse database in MindsDB, the following syntax can be used:
You can use this established connection to query your table as follows:
If you want to switch to a different database instead of the one you have connected, you can include it in the query as: