Explore

Storage

SQL Workbench

Run SQL against your data lake in the browser

The SQL Workbench is the in-app query editor. You write SQL in the browser, and Alloy runs it on its servers against your Storage tables. There is no client to install and no credentials to manage.

Open the workbench

Open Storage → Workbench from the sidebar. The workbench is a page of its own.

The workbench needs a provisioned Storage data lake. Topic tables appear after at least one file is Ingested. Upload something first if you don't see your data.

Layout

  • Table browser (left): find a table with Find table..., and expand a table to see its columns. Saved queries sits in the same panel. Drag the divider to resize it.
  • Query editor (top right): a Monaco editor with SQL syntax highlighting and autocomplete for table and column names.
  • Results (bottom right): tabular results with sortable columns.

Run a query

Write standard SQL against the tables in the table browser. Click Run, or press ⌘/Ctrl+Enter:

SELECT file_type, count(*) AS files
FROM alloy.mesh.files
WHERE deleted = false
GROUP BY file_type
ORDER BY files DESC;

alloy.mesh.files lists every file in Storage, including deleted files. Filter on deleted = false to skip them. Each recorded topic has its own table in alloy.fleet. The topic name is lowercased, / and . become __, and leading or trailing underscores are dropped. For example, /diagnostics becomes alloy.fleet.diagnostics.

Results show 500 rows at a time. Click Show N more rows to see more. The preview returns at most 1,000 rows.

Source Registry orgs

Some organizations use the Source Registry catalog instead of the Topic Catalog. If a query fails because alloy.mesh.files, alloy.mesh.file_meta, alloy.mesh.file_channels, alloy.mesh.table_schemas or an alloy.fleet.<topic> table does not exist, use the Source Registry name. Open the table browser to see which tables your organization has.

Topic CatalogSource Registry
alloy.mesh.filesalloy.mesh.file_list
alloy.mesh.file_metaalloy.mesh.metadata
alloy.mesh.file_channelsalloy.mesh.channels
alloy.mesh.table_schemasalloy.mesh.schemas
alloy.fleet.<topic>alloy.mesh.messages with WHERE topic = '<topic>'

alloy.mesh.messages holds every topic in one table, so always filter on topic. metadata, channels and schemas keep the legacy column names.

SELECT file_type, count(*) AS files
FROM alloy.mesh.file_list
WHERE deleted = false
GROUP BY file_type
ORDER BY files DESC;
SELECT log_time, data
FROM alloy.mesh.messages
WHERE topic = '/diagnostics'
LIMIT 100;

Save queries

Name a query and click Save query to keep it. The workbench stores up to 20 saved queries in your browser's local storage, so they stay on that browser only. The first time you open the workbench in a browser, it adds two example queries that match your organization's tables.

Export results

Click Export CSV next to Run to download the results. Export runs the full query again without the 1,000-row preview limit, so you get the full result set.

Limitations

  • Read-only. Only SELECT (and WITH ... SELECT) queries run. No INSERT, UPDATE, DELETE, or CREATE TABLE against the data lake.
  • No cross-org joins. You can only query your own organisation's tables.
  • In-flight files don't show up. Data appears in tables only once the file is Ingested. If you don't see your data, check the status badge.

On this page