SQL workspace

The SQL workspace is a SQL tab in the data tables pane that lets you query the data behind your map with spatial SQL. It runs a full DuckDB engine, with its spatial extension, entirely in your browser - your query and your data never leave the page.

Querying your layers

Every data-bearing layer on the map is registered as a view named layer_... (based on the layer's name). Each view exposes the layer's columns plus a spatial geom column, so you can filter, join, aggregate, and run spatial functions across layers - for example, joining points to the polygons that contain them, or buffering and counting.

Write your query in the editor and press Ctrl+Enter (or the Run button) to run it. Results appear in the familiar data-table grid. For a bare SELECT, the preview is limited to the first 10,000 rows to keep the grid responsive.

Using the results

From a result set you can:

  • Copy the rows as CSV or TSV.
  • In editing mode, save to OneLake as GeoJSON and add the result to the map as a Shapes from file layer. The SQL that produced the layer is kept with it as provenance, so you can always see - and re-run - the query behind a derived layer.

Query history

Your recent queries are kept in a history list so you can re-run or refine them. History is stored per browser, on your machine - it isn't saved into the map item or shared with other authors.

Private by design

The SQL workspace is built for security-conscious environments:

  • No query or data leaves the browser. All SQL executes client-side; there is no query service and no new network endpoint.
  • The DuckDB engine and its spatial extension are served from the workload's own origin - nothing is fetched from a third-party CDN.
  • Reads from OneLake use the same user-delegated access as the rest of Icon Map, so you can only query data you already have permission to see.

See the security whitepaper for the wider data-flow picture.

Availability

Like the rest of the data tables pane, the SQL workspace is an authoring aid: it's available in editing mode and is not shown in the published viewer.

Next steps