pub fn extract(
sql: &str,
dialect: &dyn Dialect,
) -> Result<Lineage, LineageError>Expand description
Extracts column lineage from a single SQL statement.
Handles read queries (SELECT) and write statements (INSERT, UPDATE,
DELETE, CREATE TABLE AS SELECT, MERGE); writes set Lineage::target.
Other statements (SHOW, DESCRIBE, USE, EXPLAIN) succeed empty.
§Errors
Returns LineageError if the SQL fails to parse, contains more than one
statement, or any projected column cannot be resolved to a concrete source
(fail closed — no partial result).