Skip to content

Commit 041aa8e

Browse files
committed
Update the README again
1 parent 12f3f94 commit 041aa8e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ A simple embedded language for running inline SQL in Python programs.
99
from inline_sql import sql, sql_val
1010

1111
assert sql_val^ "SELECT 1 + 1" == 2
12-
assert sql_val^ "SELECT COUNT() FROM 'disasters.csv'" == 803
12+
13+
x = 5
14+
assert sql_val^ "SELECT $x * 2" == 10
15+
16+
df = sql^ "SELECT * FROM (VALUES (1, 10), (2, 20)) df (x, y)"
17+
assert sql_val^ "SELECT SUM(x) + SUM(y) FROM df" == 33
1318
```
1419

15-
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/).
20+
Operations in the `inline_sql` library run directly inside your process. You can query local datasets (pandas frames), CSV files, and even interpolate variables seamlessly. This is implemented as a small wrapper around [DuckDB](https://duckdb.org/), so it is [extremely fast](https://duckdb.org/2021/05/14/sql-on-pandas.html).
1621

1722
## Installation
1823

@@ -87,6 +92,8 @@ print(sql_val^ """
8792
""")
8893
```
8994

95+
In general, `sql_val` is used to run scalar queries, while `sql` is used to run queries that return tables.
96+
9097
## Acknowledgements
9198

9299
Created by Eric Zhang ([@ekzhang1](https://twitter.com/ekzhang1)). Licensed under the [MIT license](LICENSE).

0 commit comments

Comments
 (0)