Function rewrite
pub fn rewrite(sql: &str, opts: &Options) -> StringExpand description
Substitute every standalone FROM changes / JOIN changes in sql with
the lineage-resolved source table when opts.use_canonical_lineage is on.
Handles two SQL conventions:
FROM changes ... changes.col(no per-query alias) → addsAS changesso qualified column references continue to resolve.FROM changes c ... c.col(existing per-query alias likec,cchg) → replaces only the table name; the existing alias is preserved.
Word-boundary anchoring (regex \b) prevents touching changes_bucketed,
changes_lineage, or any column named changes_*.
§Panics
Panics if the embedded regex fails to compile — unreachable since the pattern is a compile-time literal, validated by the unit tests in this module.