How doctrine/dbal works
Doctrine DBAL is a PHP database abstraction layer: an application configures a connection, builds or submits SQL, and receives results through a database-specific driver. It also provides schema introspection and schema management, including portable schema models and platform-specific SQL generation. The graph highlights those two product workflows and the type-conversion layer. Some runtime files were not sampled; connections to database services and several internal handoffs are therefore omitted rather than inferred.
Main entry points: Schema.php Schema model · Connection.php Connection · QueryBuilder.php Query builder · DriverManager.php Driver manager
Components 21
Connection setup
- Driver manager
src/DriverManager.php - Connection
src/Connection.php - Middleware
src/Driver/Middleware.php - Database drivers
src/Driver
Query execution
- Query builder
src/Query/QueryBuilder.php - Query and parameters
src/Query.php - Query result
src/Result.php
Schema management
- Schema manager
src/Schema/AbstractSchemaManager.php - Metadata introspection
src/Schema/Introspection/IntrospectingSchemaProvider.php - Schema model
src/Schema/Schema.php - Table and columns
src/Schema/Table.php - Column definition
src/Schema/Column.php - Sequence definition
src/Schema/Sequence.php - View definition
src/Schema/View.php - Foreign key
src/Schema/ForeignKeyConstraint.php - Schema names
src/Schema/Name/Parsers.php - Schema SQL builders
src/SQL/Builder/CreateSchemaObjectsSQLBuilder.php
Shared internals
- Database platform
src/Platforms/AbstractPlatform.php - Type conversion
src/Types/Type.php
Other components
- Application
- Database
Connections 22
- Application → Driver manager: configures
src/DriverManager.php - Driver manager → Connection: creates
src/DriverManager.php - Driver manager → Middleware: wraps driver
src/DriverManager.php - Connection → Query builder: creates builder
src/Query/QueryBuilder.php - Query builder → Query and parameters: builds query
src/Query/QueryBuilder.php - Query builder → Connection: executes query
src/Query/QueryBuilder.php - Connection → Database drivers: dispatches
- Database drivers → Database: sends SQL
- Connection → Query result: returns result
- Query builder → Database platform: gets platform
src/Query/QueryBuilder.php - Column definition → Type conversion: resolves type
src/Schema/Column.php - Schema manager → Metadata introspection: creates provider
src/Schema/AbstractSchemaManager.php - Schema manager → Database platform: requests metadata
src/Schema/AbstractSchemaManager.php - Metadata introspection → Schema model: provides schema
- Schema model → Schema SQL builders: builds create SQL
src/Schema/Schema.php - Schema model → Table and columns: holds tables
src/Schema/Schema.php - Table and columns → Column definition: holds columns
- Schema model → Sequence definition: holds sequences
src/Schema/Schema.php - Schema model → View definition: holds views
src/Schema/View.php - Schema model → Foreign key: models constraints
src/Schema/ForeignKeyConstraint.php - Schema model → Schema names: parses names
src/Schema/Schema.php - Schema SQL builders → Database platform: generates SQL