Extract script-level inbound (sources) and outbound (targets) tables from a SQL snippet. Offline.
/lineage-sql <sql>
## Overview `/lineage-sql` parses the argument script and emits two lists: inbound tables (read-from) and outbound tables (written-to). It is the script-level complement to the catalog's `/lineage` command, which resolves registered pipelines. Runs offline from the embedded parser. ## Behavior - Inbound: every table referenced in a FROM, JOIN, USING, or scalar-subquery source position. - Outbound: every table targeted by INSERT, UPDATE, DELETE, MERGE, CREATE TABLE AS SELECT, or INSERT OVERWRITE. - CTEs do not appear in either list: they are scope-local names, not catalog tables. - Names are returned as written. If the script uses unqualified table names, so does the output; the command does not apply any session default schema. - Useful for reviewing a pipeline source file before registering it, or for producing a quick lineage preview without hitting the control plane.
/lineage-sql INSERT INTO sales.orders SELECT * FROM raw.events WHERE event='order'
/lineage-sql MERGE INTO gold.customers USING silver.customer_updates ON ... WHEN MATCHED THEN UPDATE SET ...
/lineage-sql WITH agg AS (SELECT * FROM bronze.clicks) INSERT INTO silver.sessions SELECT * FROM agg