This little hack loads DuckDB WASM as a Google Sheets Library to execute, parse and return data.
No query data is sent to the extension, google or anywhere. Everything remains local.
- Open a Google Sheets document
- Browse to
Extensions
>Apps Script
- At the left of the Apps Script editor, next to
Libraries
click ➕ - In the
Script ID
field, paste1BacEJir06S0Kojb53TqhX6ECUO1tNZX6SbQoKAPueC_qdZzij3KkBc1M
- Click
Look up
and choose the latest version - Click
Add
and Authorize the Library
Type a query in a cell and execute it with DuckDB. Example:
SELECT * FROM 'https://duckdb.org/data/schedule.csv'
- Add Query Form in the sidebar
- Read Table into DuckDB memory
- Add dropdown with quick examples
Follow these steps if you'd like to fork and create your own library based on this code. Not needed for testing.
Browse to Extensions > Apps Script
Copy the .gs
+ .html
and Deploy as Library
That's it! You can start using your own custom script in Google Sheets