From 06625a11f069cbb6fafce64167bf4400d79f72ec Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Sat, 13 Jul 2024 21:23:21 +0200 Subject: [PATCH] Update README.md --- README.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b34fe3f..ca6f37a 100644 --- a/README.md +++ b/README.md @@ -19,29 +19,30 @@ LOAD chsql; ``` If you previously installed the `chsql` extension, upgrade using the FORCE command -``` +```sql FORCE INSTALL chsql FROM community; +LOAD chsql; ``` +## Supported Functions -## Usage 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; +The [list of supported functions](https://community-extensions.duckdb.org/extensions/chsql.html#added-functions) is available on the [dedicated extension page](https://community-extensions.duckdb.org/extensions/chsql.html). --- Arithmetic -SELECT intDiv(10, 3) as int_div; +## Usage Examples +Once installed, macro functions provided by the extension can be used just like built-in functions. --- String matching -SELECT match('hello world', '%world%') as match_result; +```sql +D INSTALL chsql FROM community; +D LOAD chsql; +D SELECT IPv4StringToNum('127.0.0.1'), IPv4NumToString(2130706433); +┌──────────────────────────────┬─────────────────────────────┐ +│ ipv4stringtonum('127.0.0.1') │ ipv4numtostring(2130706433) │ +│ int32 │ varchar │ +├──────────────────────────────┼─────────────────────────────┤ +│ 2130706433 │ 127.0.0.1 │ +└──────────────────────────────┴─────────────────────────────┘ ``` -Find a [full list of supported functions](https://community-extensions.duckdb.org/extensions/chsql.html#added-functions) on the [extension page](https://community-extensions.duckdb.org/extensions/chsql.html).