Setup
Let’s first create a virtual environment:ipython to run the commands in the rest of the guide, which you can launch by running:
Installing clickhouse-local
Downloading and installing clickhouse-local is the same as downloading and installing ClickHouse. We can do this by running the following command:--path:
Ingesting data into clickhouse-local
The default database only stores data in memory, so we’ll need to create a named database to make sure any data we ingest is persisted to disk.exit; from the CLI as only one process can hold a lock on this directory.
If we don’t do that, we’ll get the following error when we try to connect to the database from chDB:
Connecting to a clickhouse-local database
Go back to theipython shell and import the session module from chDB:
demo.chdb: