Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lmangani authored Jul 9, 2024
1 parent dc0472e commit 787827d
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,29 @@

# DuckDB ClickHouse SQL extension

This DuckDB extension allows aliasing of common ClickHouse SQL functions and commands

⭐ designed for [Quackpipe](https://github.com/metrico/quackpipe)

This extension allows queries in DuckDB using familiar ClickHouse syntax, making it easier to transition between the two database systems.

## Examples
```sql
-- Type conversion
SELECT toInt32(123456789) as int32;
SELECT toUInt64(1234567890123) as uint64;

-- Default values
SELECT toInt64OrZero('abc') as int64_or_zero;
SELECT toFloatOrNull('abc') as float_or_null;

-- Arithmetic
SELECT intDiv(10, 3) as int_div;

-- String matching
SELECT match('hello world', '%world%') as match_result;
```

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!_

<br>

## Building
Expand Down

0 comments on commit 787827d

Please sign in to comment.