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
Librariesclick ➕ - In the
Script IDfield, paste1BacEJir06S0Kojb53TqhX6ECUO1tNZX6SbQoKAPueC_qdZzij3KkBc1M - Click
Look upand choose the latest version - Click
Addand 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



