Integrating MotherDuck with SQL Cell: Query and Profile Data Directly in Google Sheets Sidebar
I’ve integrated MotherDuck into SQL Cell, a Google Sheets add-on I’ve been building. You can query MotherDuck tables from the sidebar, profile the result, and write it back into the sheet. One use case I’ve found especially useful is joining a table in MotherDuck with a small mapping table maintained in Sheets. The warehouse has the data, while the spreadsheet has the business-specific context. You can combine both in the same query. A note for anyone attempting something similar in a constrained frame. An Apps Script sidebar is a sandboxed iframe inside docs.google.com, so it is not cross-origin isolated and never can be — COOP/COEP belong to the top-level document, which is Google's. That rules out motherduck/wasm-client, which needs SharedArrayBuffer. What does work is the motherduck extension installed into the DuckDB-WASM instance that was already there: INSTALL motherduck FROM the version-keyed repo, LOAD, SET motherduck_token, ATTACH 'md:'. Both api.motherduck.com and ext.motherduck.com send permissive CORS headers, so an arbitrary origin is fine. It fails on the v1.4.3 extension build and works on v1.5.2+. The engine version was the whole story. Thanks for shipping a build that loads without cross-origin isolation. It's the reason this exists at all. The result profiler borrows your Inspector's layout, since it turns out to be the right one: a row per column with type, a distribution silhouette, and either a range or a cardinality. It runs SUMMARIZE against the materialised result rather than the source, so profiling a query incurs no additional network overhead. Anyway, very happy to finally have MotherDuck working inside Sheets. Here is the marketplace link workspace.google.com/marketplace/app/sql_cell/178915154116
.png)