Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lmangani authored Jan 2, 2025
1 parent 0bea03c commit 0ec6aef
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<a href="https://quackpipe.fly.dev" target="_blank"><img src="https://user-images.githubusercontent.com/1423657/231310060-aae46ee6-c748-44c9-905e-20a4eba0a814.png" width=220 /></a>
<a href="https://quackpipe.fly.dev" target="_blank"><img src="https://github.com/user-attachments/assets/790afacb-96d9-4cdf-af48-1948049e0385" width=220 /></a>

> _a pipe for quackheads_
> _a data pipe for quackheads_
# :baby_chick: quackpipe

Expand Down Expand Up @@ -95,6 +95,40 @@ Execute queries using STDIN
hello,v1.1.1
```

### :fist_right: Clickhouse SQL (chsql)
Quackpipe speaks a little ClickHouse SQL using the [chsql](https://community-extensions.duckdb.org/extensions/chsql.html) DuckDB Extension providing users with [100+ ClickHouse SQL Command Macros](https://community-extensions.duckdb.org/extensions/chsql.html#added-functions) two clients _(HTTP/S and Native)_ to interact with remote ClickHouse APIs

#### Example
```sql
--- Install and load chsql
D INSTALL chsql FROM community;
D LOAD chsql;

--- Use any of the 100+ ClickHouse Function Macros
D SELECT IPv4StringToNum('127.0.0.1'), IPv4NumToString(2130706433);
┌──────────────────────────────┬─────────────────────────────┐
│ ipv4stringtonum('127.0.0.1') │ ipv4numtostring(2130706433) │
│ int32 │ varchar
├──────────────────────────────┼─────────────────────────────┤
2130706433127.0.0.1
└──────────────────────────────┴─────────────────────────────┘
```

### Remote Queries
The built-in `ch_scan` function can be used to query remote ClickHouse servers using the HTTP/s API
```sql
--- Set optional X-Header Authentication
D CREATE SECRET extra_http_headers (
TYPE HTTP,
EXTRA_HTTP_HEADERS MAP{
'X-ClickHouse-User': 'user',
'X-ClickHouse-Key': 'password'
}
);
--- Query using the HTTP API
D SELECT * FROM ch_scan("SELECT number * 2 FROM numbers(10)", "https://play.clickhouse.com");
```

### :fist_right: Extensions
Several extensions are pre-installed by default in [Docker images](https://github.com/metrico/quackpipe/blob/main/Dockerfile#L9), including _parquet, json, httpfs_<br>
When using HTTP API, _httpfs, parquet, json_ extensions are automatically pre-loaded by the wrapper.
Expand Down

0 comments on commit 0ec6aef

Please sign in to comment.