Skip to main content
All CollectionsLineage
Extracting Lineage from Doctrine (ORM for PHP)
Extracting Lineage from Doctrine (ORM for PHP)
Updated over a week ago

What is Doctrine?

Doctrine is a powerful PHP ORM (Object-Relational Mapping) library that simplifies database interactions by mapping PHP objects to database tables. It enables developers to perform database operations without writing complex SQL, allowing for more maintainable and scalable code. Doctrine also provides direct database access through its Database Abstraction Layer (DBAL) for those who need more granular control.

The Importance of Lineage and Schema Management in Doctrine

Doctrine often serves as the backbone for managing operational databases. In modern data workflows, these databases may feed into data warehouses like BigQuery or Snowflake via ETL pipelines (e.g., Fivetran). Once in the warehouse, data gets transformed (e.g., via dbt) and consumed by BI tools like Tableau or by data science teams.

Changes made to upstream Doctrine entities can ripple through the entire data stack, affecting everything from BI dashboards to machine learning workflows. It’s critical to ensure that teams downstream are aware of these changes, so they can take appropriate measures to avoid data quality issues.

Automating Schema and Lineage Extraction for Doctrine

Foundational simplifies this process by automating the extraction of schema and lineage information directly from Doctrine code. This approach allows users to preview changes during the development phase, including pending Pull Requests, and evaluate potential downstream effects before deployment.

A Unique Approach Compared to Traditional Database Schemas

Example of Doctrine definitions


Unlike vendors who pull schema information from databases post-deployment, Foundational extracts Doctrine schema directly from the codebase. This allows teams to catch potential issues earlier in the development cycle, minimizing the risk of breaking changes affecting downstream applications.

How Foundational Extracts Doctrine Schema

Foundational’s Code Engine scans repositories to detect Doctrine definitions, such as dcm.yml files. It then processes these schema files to extract relevant information like table names, column names, column types, and other metadata from the definitions.

How to Set Up

To enable Doctrine schema extraction, simply connect your repository containing the Doctrine entity definitions. Foundational’s Code Engine will automatically identify and extract the relevant schema, helping you manage lineage and impact analysis effortlessly.


Did this answer your question?