File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,11 @@ Once installed, the [macro functions](https://community-extensions.duckdb.org/ex
30
30
Here's a random example out of 100s using the ` IPv4StringToNum ` and ` IPv4NumToString ` functions:
31
31
32
32
``` sql
33
+ -- - Install and load chsql
33
34
D INSTALL chsql FROM community;
34
35
D LOAD chsql;
36
+
37
+ -- - Use any of the 100+ ClickHouse Macros
35
38
D SELECT IPv4StringToNum(' 127.0.0.1' ), IPv4NumToString(2130706433 );
36
39
┌──────────────────────────────┬─────────────────────────────┐
37
40
│ ipv4stringtonum(' 127.0.0.1' ) │ ipv4numtostring(2130706433 ) │
@@ -45,6 +48,15 @@ D SELECT IPv4StringToNum('127.0.0.1'), IPv4NumToString(2130706433);
45
48
The built-in ` ch_scan ` function can be used to query remote ClickHouse servers using the HTTP/s API
46
49
47
50
``` sql
51
+ -- - Set optional X-Header Authentication
52
+ D CREATE SECRET extra_http_headers (
53
+ TYPE HTTP,
54
+ EXTRA_HTTP_HEADERS MAP{
55
+ ' X-ClickHouse-User' : ' user' ,
56
+ ' X-ClickHouse-Key' : ' password'
57
+ }
58
+ );
59
+ -- - Query using the HTTP API
48
60
D SELECT * FROM ch_scan(" SELECT number * 2 FROM numbers(10)" , " https://play.clickhouse.com" );
49
61
```
50
62
You can’t perform that action at this time.
0 commit comments