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 13, 2024
1 parent 803a814 commit 06625a1
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
├──────────────────────────────┼─────────────────────────────┤
2130706433127.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).

<br>

Expand Down

0 comments on commit 06625a1

Please sign in to comment.