Skip to content

Commit cce6699

Browse files
committed
Update README text
1 parent 438c8dd commit cce6699

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ print(sql_val^ """
3030
""")
3131
```
3232

33-
`inline_sql` operates directly on an in-memory database. You can access local datasets (pandas frames), CSV files, and interpolate variables seamlessly into queries. Internally, this is implemented as a small wrapper around [DuckDB](https://duckdb.org/).
33+
Operations in the `inline_sql` library directly use an in-memory database. You can access local datasets (pandas frames), CSV files, and interpolate variables seamlessly into queries. Internally, this is implemented as a small wrapper around [DuckDB](https://duckdb.org/).
3434

3535
## Installation
3636

@@ -46,23 +46,30 @@ The exported `sql` and `sql_val` variables are magic objects that can be used to
4646

4747
```python
4848
>>> from inline_sql import sql, sql_val
49+
4950
>>> sql_val^ "SELECT 1 + 1"
5051
2
52+
5153
>>> x = 5
54+
5255
>>> sql_val^ "SELECT 2 * $x"
5356
10
57+
5458
>>> sql^ "SELECT * FROM 'disasters.csv' LIMIT 5"
5559
Entity Year Deaths
5660
0 All natural disasters 1900 1267360
5761
1 All natural disasters 1901 200018
5862
2 All natural disasters 1902 46037
5963
3 All natural disasters 1903 6506
6064
4 All natural disasters 1905 22758
65+
6166
>>> def total_deaths(entity: str) -> float:
6267
... return sql_val^ "SELECT SUM(deaths) FROM disasters WHERE Entity = $entity"
6368
...
69+
6470
>>> total_deaths("Drought")
6571
11731294.0
72+
6673
>>> total_deaths("Earthquake")
6774
2576801.0
6875
```

0 commit comments

Comments
 (0)