Runner
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
sqllineage.utils.helpers.splitfunction to split string-base SQL statements into a list ofstrstatements.Calling
sqllineage.core.analyzer.LineageAnalyzerto analyze each one statement sql string. Get a list ofsqllineage.core.holders.StatementLineageHolder.Calling
sqllineage.core.holders.SQLLineageHolder.offunction to assemble the list ofsqllineage.core.holders.StatementLineageHolderinto 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, dialect: str = 'ansi', metadata_provider: MetaDataProvider = <sqllineage.core.metadata.dummy.DummyMetaDataProvider object>, verbose: bool = False, silent_mode: bool = False, draw_options: dict[str, ~typing.Any] | None=None, file_path: str = '.')[source]
The entry point of SQLLineage after command line options are parsed.
- Parameters:
sql – a string representation of SQL statements.
dialect – sql dialect
metadata_provider – metadata service object providing table schema
verbose – verbose flag indicating whether statement-wise lineage result will be shown
silent_mode – boolean flag indicating whether to skip lineage analysis for unknown statement types
file_path – path of the SQL file.