Skip to content

Commit d3a7823

Browse files
committed
Add runtime usage example and README reference.
Provide a concrete script demonstrating query execution, metadata, records, and normalized history/result helper usage in hotdata-runtime.
1 parent 631e57e commit d3a7823

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ uv pip install hotdata-runtime
1111
# or: pip install hotdata-runtime
1212
```
1313

14+
Example:
15+
16+
```bash
17+
python examples/basic_usage.py
18+
```
19+
1420
Development (uses **uv**; creates `.venv/` in this repo):
1521

1622
```bash

examples/basic_usage.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""Basic hotdata-runtime usage."""
2+
3+
from hotdata_runtime import from_env
4+
5+
6+
def main() -> None:
7+
client = from_env()
8+
result = client.execute_sql("SELECT 1 AS ok")
9+
10+
print("result metadata:", result.metadata_dict())
11+
print("records:", result.to_records(max_rows=5))
12+
13+
print("recent results:")
14+
for item in client.list_recent_results(limit=5, offset=0):
15+
print(item.to_dict())
16+
17+
print("run history:")
18+
for item in client.list_run_history(limit=5, offset=0):
19+
print(item.to_dict())
20+
21+
client.close()
22+
23+
24+
if __name__ == "__main__":
25+
main()

0 commit comments

Comments
 (0)