LineageRunner
LineageRunner is the entry point for SQLLineage core processing logic. After parsing command-line options, a string representation of SQL statements will be fed to LineageRunner for processing. From a bird’s-eye view, it contains three steps:
Calling
sqlparse.parse
function to parse string-base SQL statements into a list ofsqlparse.sql.Statement
Calling
sqllineage.core.analyzer.LineageAnalyzer
to analyze eachsqlparse.sql.Statement
and return a list ofsqllineage.core.holders.StatementLineageHolder
.Calling
sqllineage.core.holders.SQLLineageHolder.of
function to assemble the list ofsqllineage.core.holders.StatementLineageHolder
into onesqllineage.core.holders.SQLLineageHolder
.
sqllineage.core.holders.SQLLineageHolder
then will serve for lineage summary, in text or in visualization
form.
sqllineage.runner.LineageRunner
- class sqllineage.runner.LineageRunner(sql: str, encoding: Optional[str] = None, verbose: bool = False, draw_options: Optional[Dict[str, str]] = None)[source]
The entry point of SQLLineage after command line options are parsed.
- Parameters
sql – a string representation of SQL statements.
encoding – the encoding for sql string
verbose – verbose flag indicate whether statement-wise lineage result will be shown