Skip to content

Commit

Permalink
Merge release 3.2.2 into 3.3.x (#5186)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Jan 18, 2022
2 parents e839cec + d1e581d commit a4b37db
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions docs/en/reference/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ and a ``Doctrine\DBAL\Result`` wraps a ``Doctrine\DBAL\Driver\Result``.
and ``Doctrine\DBAL\Driver\Result`` are just interfaces.
These interfaces are implemented by concrete drivers.

What do the wrapper components add to the underlying driver
implementations? The enhancements include SQL logging, events and
control over the transaction isolation level in a portable manner,
among others.

Apart from the three main components, a DBAL driver should also provide
an implementation of the ``Doctrine\DBAL\Driver`` interface that
has two primary purposes:
Expand All @@ -26,18 +21,40 @@ has two primary purposes:
2. Act as a factory of other driver-specific components like
platform, schema manager and exception converter.

The driver components can be decorated using the four driver interfaces in
order to add driver-independent functionality like logging or profiling. Those
decorators are configured as a middleware.

The wrapper components ``Connection``, ``Statement`` and ``Result`` are the
objects that the application usually interacts with directly. They wrap the
middleware stack as well as the driver at the bottom of that stack.

The DBAL is separated into several different packages that
separate responsibilities of the different RDBMS layers.

Drivers
-------

The drivers abstract a PHP specific database API by enforcing three
The drivers abstract a PHP specific database API by enforcing four
interfaces:

- ``\Doctrine\DBAL\Driver\Connection``
- ``\Doctrine\DBAL\Driver\Statement``
- ``\Doctrine\DBAL\Driver\Result``
- ``Doctrine\DBAL\Driver``
- ``Doctrine\DBAL\Driver\Connection``
- ``Doctrine\DBAL\Driver\Statement``
- ``Doctrine\DBAL\Driver\Result``

Middlewares
-----------

A middleware sits in the middle between the wrapper components and the driver.
By implementing the ``Doctrine\DBAL\Driver\Middleware``, it decorates the
``Driver`` component of either the actual driver or a lower middleware. If
necessary, the middleware might also decorate ``Connection``, ``Statement``
and ``Result``.

An example for a middleware implementation is
``Doctrine\DBAL\Logging\Middleware`` which implements logging capabilities
on top of a driver.

Platforms
---------
Expand Down Expand Up @@ -72,4 +89,3 @@ The types offer an abstraction layer for the converting and
generation of types between Databases and PHP. Doctrine comes
bundled with some common types but offers the ability for
developers to define custom types or extend existing ones easily.

0 comments on commit a4b37db

Please sign in to comment.