Skip to content

Commit 787827d

Browse files
authored
Update README.md
1 parent dc0472e commit 787827d

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,29 @@
22

33
# DuckDB ClickHouse SQL extension
44

5-
This DuckDB extension allows aliasing of common ClickHouse SQL functions and commands
6-
75
⭐ designed for [Quackpipe](https://github.com/metrico/quackpipe)
86

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!_
27+
928
<br>
1029

1130
## Building

0 commit comments

Comments
 (0)