You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-2Lines changed: 21 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,29 @@
2
2
3
3
# DuckDB ClickHouse SQL extension
4
4
5
-
This DuckDB extension allows aliasing of common ClickHouse SQL functions and commands
6
-
7
5
⭐ designed for [Quackpipe](https://github.com/metrico/quackpipe)
8
6
7
+
This extension allows queries in DuckDB using familiar ClickHouse syntax, making it easier to transition between the two database systems.
8
+
9
+
## Examples
10
+
```sql
11
+
-- Type conversion
12
+
SELECT toInt32(123456789) as int32;
13
+
SELECT toUInt64(1234567890123) as uint64;
14
+
15
+
-- Default values
16
+
SELECT toInt64OrZero('abc') as int64_or_zero;
17
+
SELECT toFloatOrNull('abc') as float_or_null;
18
+
19
+
-- Arithmetic
20
+
SELECT intDiv(10, 3) as int_div;
21
+
22
+
-- String matching
23
+
SELECT match('hello world', '%world%') as match_result;
24
+
```
25
+
26
+
Find more examples in the [tests]([test/sql/chsql.sql](https://github.com/lmangani/duckdb-extension-clickhouse-sql/blob/main/test/sql/chsql.test)) and [source code](https://github.com/lmangani/duckdb-extension-clickhouse-sql/blob/main/src/chsql_extension.cpp#L31). _Contributions and fixes are extremely welcome!_
0 commit comments