This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Cross-framework module for doctrine/dbal

v0.4.1 2017-12-14 12:44 UTC

This package is auto-updated.

Last update: 2021-10-06 17:37:50 UTC


This package integrates Doctrine DBAL in any container-interop compatible framework/container.


composer require thecodingmachine/dbal-universal-module

Once installed, you need to register the TheCodingMachine\DbalServiceProvider into your container.

If your container supports thecodingmachine/discovery integration, you have nothing to do. Otherwise, refer to your framework or container's documentation to learn how to register service providers.


This service provider is meant to provide one connection to your database. If you need more than one connection to your database, please configure your container directly.

Expected values / services

This service provider expects the following configuration / services to be available:

Name Compulsory Description no The database host. Defaults to localhost
dbal.user no The database user. Defaults to root
dbal.password no The database password. Defaults to empty
dbal.port no The database port. Defaults to 3306
dbal.dbname yes The database name.
dbal.charset no The database character set.
dbal.driverOptions no An array of driver options. Defaults to [1002 =>"SET NAMES utf8"]
dbal.params no An array of parameters directly passed to the Connection object. If this parameter is set, all parameters above are ignored.
Doctrine\DBAL\Driver no The DBAL driver to use to create the connection. Defaults to DBAL's PDO_MySQL Driver service

Provided services

This service provider provides the following services:

Service name Description
Doctrine\DBAL\Connection A DBAL connection to your database

Extended services

This service provider does not extend any service.