DEV.co
Open-Source Databases · reata

sqllineage

SQLLineage is a Python tool that analyzes SQL queries to identify source and target tables, supporting multiple SQL dialects and providing both table-level and column-level lineage tracking. It uses pluggable parsers (sqlfluff, sqlparse) and graph visualization to map data flow through complex SQL pipelines.

Source: GitHub — github.com/reata/sqllineage
1.7k
GitHub stars
280
Forks
Python
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryreata/sqllineage
Ownerreata
Primary languagePython
LicenseMIT — OSI-approved
Stars1.7k
Forks280
Open issues51
Latest releasev1.5.8 (2026-05-16)
Last updated2026-06-24
Sourcehttps://github.com/reata/sqllineage

What sqllineage is

A Python-based SQL lineage analyzer that leverages sqlfluff/sqlparse for AST parsing, networkx for graph representation, and supports dialect-aware parsing (ANSI, Hive, SparkSQL, etc.). Provides CLI and programmatic APIs for extracting table/column-level lineage, with optional metadata enrichment via SQLAlchemy and DAG visualization.

Quickstart

Get the sqllineage source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/reata/sqllineage.gitcd sqllineage# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Data Governance & Audit Trails

Map data dependencies across SQL pipelines to satisfy compliance, audit, and data lineage requirements. Track which source tables feed into critical downstream datasets.

Data Discovery & Documentation

Automatically generate lineage diagrams and metadata for data catalogs, reducing manual documentation effort and improving data consumer visibility into pipeline dependencies.

ETL Pipeline Impact Analysis

Identify upstream and downstream impacts of schema changes, table deprecations, or data quality issues without manual query inspection.

Implementation considerations

  • Validate all SQL dialects used in your environment against the supported list (ansi, hive, sparksql, etc.) before deployment.
  • Plan for metadata enrichment if column-level lineage is required; requires SQLAlchemy-compatible database access and environment variable configuration (SQLLINEAGE_DEFAULT_SCHEMA).
  • Test parsing robustness on a representative sample of your SQL codebase; edge cases or non-standard syntax may raise InvalidSyntaxException.
  • Integrate CLI or programmatic API into your data catalog, workflow orchestration, or governance platform; consider batch processing for large SQL file collections.
  • Monitor dependency on underlying parser libraries (sqlfluff, sqlparse, networkx); keep them updated for bug fixes and dialect support.

When to avoid it — and what to weigh

  • Real-Time Query Execution — SQLLineage performs static analysis only; it does not execute queries or provide runtime lineage from actual data flows. Not suitable for capturing dynamic lineage from running systems.
  • Non-SQL Data Pipelines — Limited to SQL-based workflows. If your data lineage spans Python, Spark code, or non-SQL tools, you will need complementary solutions.
  • Unsupported Dialects or Complex Syntax — Dialect support is finite (ansi, hive, sparksql, etc.); proprietary or bleeding-edge SQL syntax may fail parsing. Requires validation against your specific SQL dialect.
  • Full Column-Level Lineage Without Metadata — Column-level lineage is incomplete without external schema metadata. Wildcard expansion and unqualified column resolution require database connection and schema introspection.

License & commercial use

Licensed under MIT (MIT License), a permissive open-source license permitting commercial use, modification, and distribution with minimal restrictions.

MIT License is permissive and explicitly allows commercial use. No restrictions on embedding in proprietary software, SaaS offerings, or internal enterprise tools. However, review the full license terms and ensure compliance with any dependencies (sqlfluff, sqlparse, networkx). No warranty or liability protections are implied; consider risk assessment for mission-critical deployments.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

No inherent security vulnerabilities documented in provided data. Tool performs static SQL parsing without executing queries. If connecting to live databases via SQLAlchemy for metadata, credential management and database access control are the operator's responsibility. Bandit security linter is run (per badge in README), indicating security-conscious development. Evaluate risk of parsing untrusted SQL input (potential DoS via pathological queries).

Alternatives to consider

Apache Atlas / OpenLineage

Enterprise-grade data lineage platforms with broader ecosystem support, runtime lineage capture, and UI/API for governance. Heavier operational footprint but more integrated for large-scale data governance.

dbt (data build tool)

Provides native lineage tracking and DAG visualization for SQL-based ELT pipelines. Better suited if dbt is already your transformation framework; SQLLineage is agnostic to pipeline orchestration.

sqlparse / sqlfluff standalone

Lower-level SQL parsing libraries used by SQLLineage. Use directly if you need fine-grained AST control or wish to avoid the lineage abstraction layer.

Software development agency

Build on sqllineage with DEV.co software developers

Implement SQLLineage for data governance, compliance tracking, and impact analysis. Our team can help integrate it into your data platform and optimize lineage workflows.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

sqllineage FAQ

Does SQLLineage execute SQL or connect to the database by default?
No. SQLLineage performs static parsing only. Database connection is optional and only used if you provide metadata for column-level lineage enrichment via SQLAlchemy.
What SQL dialects are supported?
ANSI (default), Hive, SparkSQL, and others. Run `sqllineage --dialects` to list all supported dialects. Dialect awareness is critical for accurate lineage on non-ANSI syntax (e.g., INSERT OVERWRITE).
Can SQLLineage handle stored procedures, functions, or dynamic SQL?
Not clearly stated in documentation. Static parsing of inline SQL is the primary use case; procedural constructs and dynamic SQL (e.g., EXECUTE) are likely not fully supported. Requires testing.
How do I integrate SQLLineage into my data catalog or workflow tool?
Use the Python API programmatically or call the CLI tool via subprocess. Examples in documentation cover basic usage; custom integration requires coding to your platform's plugin/API model.

Software developers & web developers for hire

DEV.co helps companies turn open-source tools like sqllineage into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source databases stack.

Ready to Map Your Data Lineage?

Implement SQLLineage for data governance, compliance tracking, and impact analysis. Our team can help integrate it into your data platform and optimize lineage workflows.