One report, four languages
SQL pulls orders out of SQLite, C# shapes the result, Python draws the chart, and Mermaid documents the flow. Four languages, one variable store, one page.
One report, four languages
Every cell in this notebook works on the same data, and none of them copy it around. A SQL cell reads order data out of SQLite and publishes the result. A C# cell picks it up by name, shapes it, and leaves a few plain variables behind. A Python cell reads those variables as if Python had defined them and draws the chart. Verso's shared variable store is what makes that ordinary.
1#r "nuget: Microsoft.Data.Sqlite, 8.0.8"
- Microsoft.Data.Sqlite, 8.0.8
Transitive dependencies (6)
- Microsoft.Data.Sqlite.Core, 8.0.8
- SQLitePCLRaw.bundle_e_sqlite3, 2.1.6
- SQLitePCLRaw.core, 2.1.6
- SQLitePCLRaw.lib.e_sqlite3, 2.1.6
- SQLitePCLRaw.provider.e_sqlite3, 2.1.6
- System.Memory, 4.5.3
1#!sql-connect --name orders --connection-string "Data Source=orders.db" --provider Microsoft.Data.Sqlite --default
Connected 'orders' (default) using Microsoft.Data.Sqlite — database: main Connection string: Data Source=orders.db
1SELECT ordered_on, region, product, quantity, unit_price2FROM orders3ORDER BY ordered_on4LIMIT 6
| ordered_on | region | product | quantity | unit_price |
|---|---|---|---|---|
| 2026-01-01 | East | Arc Bookshelf | 4 | 265 |
| 2026-01-01 | West | Fountain Pen No. 4 | 1 | 56 |
| 2026-01-01 | West | Aurora Desk Lamp | 1 | 68 |
| 2026-01-01 | East | Halo Pendant Light | 4 | 149 |
| 2026-01-02 | South | Aurora Desk Lamp | 1 | 68 |
| 2026-01-02 | West | Slate Writing Desk | 1 | 420 |
1--name regionalRevenue2SELECT region AS Region,3 COUNT(*) AS Orders,4 CAST(SUM(quantity * unit_price) AS INT) AS Revenue5FROM orders6GROUP BY region7ORDER BY Revenue DESC
| Region | Orders | Revenue |
|---|---|---|
| West | 400 | 224388 |
| East | 306 | 147572 |
| Central | 266 | 105900 |
| South | 228 | 67781 |
From result set to variables
The --name directive on the query above published its result as regionalRevenue.
To C#, that is just a DataTable waiting in the variable store.
1using System.Data;23var table = Variables.Get<DataTable>("regionalRevenue")!;45var regions = new List<string>();6var revenue = new List<double>();7foreach (DataRow row in table.Rows)8{9 regions.Add((string)row["Region"]);10 revenue.Add(Convert.ToDouble(row["Revenue"]));11}1213var topRegion = regions[0];14var topShare = revenue[0] / revenue.Sum();1516$"{topRegion} leads with {topShare:P0} of first-half revenue."
West leads with 41% of first-half revenue.
1import matplotlib.pyplot as plt23# regions and revenue were left behind by the C# cell above4labels = [str(r) for r in regions]5values = [float(v) for v in revenue]67fig, ax = plt.subplots(figsize=(7.2, 3.8))8bars = ax.bar(labels, values, color="#0078d4")9ax.bar_label(bars, fmt="${:,.0f}", padding=3)10ax.set_title("Revenue by region, January to June 2026")11ax.set_ylabel("Revenue")12ax.spines[["top", "right"]].set_visible(False)13plt.tight_layout()14plt.show()
1graph LR2 DB[("orders.db")] --> Q["SQL cell<br/>publishes regionalRevenue"]3 Q --> CS["C# cell<br/>shapes and shares variables"]4 CS --> PY["Python cell<br/>draws the chart"]5 CS --> MD["Mermaid cell<br/>renders this diagram"]6 MD --> TOP["Leading region: @topRegion"]
Take it home
Download this notebook and orders.db from the gallery page, then open it in VS Code
with the Verso extension or serve it in a browser with verso serve sales-report.verso.
Swap the query, rerun, and the chart follows.
Run it yourself
Nothing on this page is executable; the outputs were baked in by a real run. Download the notebook and it runs anywhere Verso does: VS Code, the browser, or the terminal.
dotnet tool install --global Verso.Cliverso serve sales-report.versoThis notebook reads orders.db; download it into the same folder as the notebook.
What this shows
SQL pulls orders out of SQLite, C# shapes the result, Python draws the chart, and Mermaid documents the flow. Four languages, one variable store, one page.
Every language in this notebook reads and writes the same variable store, so a value produced in one cell is simply there in the next, whatever the language.