diff --git a/README.md b/README.md index e79e145..6024be4 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,16 @@ echo "INSTALL httpfs;" | ./quackpipe --stdin --params "?extension_directory=/tmp ./quackpipe --port 8123 --host 0.0.0.0 --params "?extension_directory=/tmp/" ``` +### ClickHouse HTTP + +Quackpipe can be used to query a remote instance of itself and/or ClickHouse using the HTTP API + +```sql +CREATE OR REPLACE MACRO quackpipe(query, server := 'https://play.clickhouse.com', user := 'play', format := 'JSONEachRow') AS TABLE + SELECT * FROM read_json_auto(concat(server, '/?default_format=', format, '&user=', user, '&query=', query)); + +SELECT * FROM quackpipe("SELECT number as once, number *2 as twice FROM numbers(10)") +``` ### ClickHouse UDF