Demo project for my article: Working With ClickHouse From Spring Data Using MySql Driver
- Open the docker folder:
cd docker
- Run Clickhouse:
docker-compose up -d
- Create tables:
docker-compose run clickhouse-client --host clickhouse-server --user admin --password admin --multiquery < ../sql/script.sql
- Login to DB using clickhouse client:
docker-compose run clickhouse-client --host clickhouse-server --user admin --password admin
./gradlew bootRun
Note: Java 11 or later has to be installed to run the demo project.
- Create an item
curl --header "Content-Type: application/json" \ --request POST \ --data '{ "itemId": "12323", "timestamp": "2009-09-22T16:47:08.432", "data": "123","list": {"list": ["1", "2", "3"]}}' \ localhost:8080/v1/demo/item
- List items
curl localhost:8080/v1/demo/item