/extract-tables

List every table reference in the SQL (fully-qualified where possible). Offline AST walk.

Category: slash-commands

Syntax

/extract-tables <sql>

Description

## Overview `/extract-tables` walks the parsed AST and returns a flat, de-duplicated list of every table reference in the script. Unlike `/lineage-sql`, it does not split inbound and outbound; the goal is simply to enumerate what the script touches. Fully offline. ## Behavior - CTEs and subquery aliases are filtered out; only catalog-resolvable names are reported. - Names are returned as written in the script (schema-qualified when the script qualifies them). - Table functions and lateral joins are included where they reference a table-like source. - Useful for quick dependency scans, for dashboards that render what a pipeline reads, and as input to `/describe` (copy a name from the output, drill in with `/open N`).

Examples

/extract-tables SELECT * FROM sales.orders JOIN inventory.items USING(sku)
/extract-tables SELECT o.*, c.name FROM sales.orders o LEFT JOIN marketing.campaigns c ON o.campaign_id = c.id
/extract-tables WITH x AS (SELECT * FROM a.b) SELECT * FROM x JOIN c.d ON x.id = c.d.id

See Also

Open in interactive docs →   DeltaForge home →