Skip to content

Commit 367a9ff

Browse files
committed
docs: add marimo feature overview
Document the widget helpers, mo.sql engine integration, catalog browsing, and display helpers exposed by the Marimo adapter.
1 parent 0e1113d commit 367a9ff

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
Marimo UI helpers for [Hotdata](https://hotdata.dev): run SQL from a notebook, browse catalog metadata, and render results as tables.
44

5+
## Features
6+
7+
- **Workspace-aware setup** — build a `HotdataClient` from environment variables, or use `workspace_selector_from_env()` to choose a workspace interactively when no workspace is pinned.
8+
- **Connection health** — show a compact status callout with API, workspace, and optional sandbox context.
9+
- **Catalog browsing** — browse Hotdata connections, schemas, tables, and columns from Marimo UI controls.
10+
- **SQL editor widget** — run SQL against Hotdata, cache the latest successful result, and render results in downstream reactive cells.
11+
- **Native `mo.sql` engine** — register `HotdataMarimoEngine` so Marimo SQL cells can execute through a live `HotdataClient` with `engine=client`.
12+
- **Result display helpers** — render query results, recent results, and run history as notebook-friendly UI.
13+
- **Marimo UI aliases** — importing `hotdata_marimo` attaches helpers such as `mo.ui.hotdata_sql_editor` and `mo.ui.hotdata_table_browser` for discoverability.
14+
515
## Install
616

717
```bash
@@ -39,6 +49,28 @@ Importing `hotdata_marimo` registers discoverability aliases on Marimo’s UI na
3949

4050
Use `hm.connection_status(client)` (or `mo.ui.hotdata_connection_status(client)`) for a small API/workspace health callout.
4151

52+
## Marimo SQL Cells
53+
54+
Register the Hotdata SQL engine once during setup, then pass a `HotdataClient` to Marimo SQL cells:
55+
56+
```python
57+
import hotdata_marimo as hm
58+
59+
hm.register_hotdata_sql_engine()
60+
client = hm.from_env()
61+
```
62+
63+
```python
64+
_df = mo.sql(
65+
"""
66+
SELECT 1 AS example_value
67+
""",
68+
engine=client,
69+
)
70+
```
71+
72+
The engine also exposes Hotdata catalog metadata to Marimo's data-source UI. Hotdata connections are labeled **Hotdata** in the SQL connection picker.
73+
4274
## Two-cell pattern
4375

4476
Keep the editor in one cell and consume `editor.result` in another. The editor caches the last successful run so downstream cells do not re-query the API on every refresh; click **Run on Hotdata** again after you change SQL. While a query is running, a Marimo status spinner is shown.

0 commit comments

Comments
 (0)