PondPilot Interactive SQL Demo
Run SQL queries directly in your browser using DuckDB WASM. All widgets share a single DuckDB instance.
Features
✅ Shared DuckDB instance - All widgets on the page share the same instance
✅ Persistent state - Tables created in one widget are accessible in all others
✅ Load .duckdb files - Specify duckdb: "/data/file.duckdb" in frontmatter to preload data
✅ Theme auto-detection - Matches your site’s dark/light mode automatically
✅ Editable/Read-only - Control editing with data-editable parameter
✅ Keyboard shortcuts - Ctrl+Enter or Cmd+Enter to run queries
✅ No backend needed - Everything runs in your browser
Quick Start
Click “Run” or press Ctrl+Enter (or Cmd+Enter on Mac):
Shared Instance Test
Create a table in one widget:
Query it in another (proves shared instance):
Read-Only Widget
Make widgets read-only with data-editable="false":
Window Functions
Features Summary
✅ Single shared instance - All widgets share the same DuckDB instance
✅ Persistent state - Tables created in one widget are accessible in all others
✅ Load .duckdb files - Add duckdb: "/data/file.duckdb" in frontmatter to preload data
✅ Theme auto-detection - Matches your site’s dark/light mode
✅ Editable/Read-only - Control editing with data-editable="true"/"false"
✅ Keyboard shortcuts - Ctrl+Enter or Cmd+Enter to run
✅ No backend needed - Everything runs in your browser
Usage
Basic Widget
\`\`\`sql {pw}SELECT 'Hello, World!' as message;\`\`\`Read-Only Widget
\`\`\`sql {pw data-editable="false"}SELECT * FROM products;\`\`\`Load .duckdb File
Add to your post’s frontmatter:
---title: "SQL Tutorial"duckdb: "/data/sample.duckdb"---Put sample.duckdb in the public/data/ folder. All widgets on that page will have access to the preloaded database!
Supported Parameters
data-editable-"true"(default) or"false"- Control if SQL can be editeddata-theme-"light","dark", or"auto"- Override theme (auto-detected by default)