PHPackages                             mondrake/drudbal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. mondrake/drudbal

AbandonedArchivedDrupal-module[Database &amp; ORM](/categories/database)

mondrake/drudbal
================

Drupal driver for Doctrine DBAL.

82.8k1[1 issues](https://github.com/mondrake/drudbal/issues)[1 PRs](https://github.com/mondrake/drudbal/pulls)PHP

Since Oct 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mondrake/drudbal)[ Packagist](https://packagist.org/packages/mondrake/drudbal)[ RSS](/packages/mondrake-drudbal/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (8)Used By (0)

DruDbal
=======

[](#drudbal)

[![MySql via PDO](https://github.com/mondrake/drudbal/actions/workflows/mysql.yml/badge.svg)](https://github.com/mondrake/drudbal/actions/workflows/mysql.yml)[![MySql via mysqli](https://github.com/mondrake/drudbal/actions/workflows/mysqli.yml/badge.svg)](https://github.com/mondrake/drudbal/actions/workflows/mysqli.yml)[![SQLite via PDO](https://github.com/mondrake/drudbal/actions/workflows/sqlite.yml/badge.svg)](https://github.com/mondrake/drudbal/actions/workflows/sqlite.yml)[![Oracle via oci8](https://github.com/mondrake/drudbal/actions/workflows/oracle.yml/badge.svg)](https://github.com/mondrake/drudbal/actions/workflows/oracle.yml)[![PHPStan level](https://camo.githubusercontent.com/70fa70e931ea22a2963ebc07c4dcd986053837b21a1ba4f97610df0cddc9315f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2532306c6576656c2d352d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/mondrake/drudbal/actions/workflows/code-quality.yml)[![License](https://camo.githubusercontent.com/5e27f45e232fe6634722ff60b1f0c6233c32d9cb03d12cfb8eac712bce9e8cbe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6f6e6472616b652f6472756462616c2e737667)](https://packagist.org/packages/mondrake/drudbal)

(This README updated March 30, 2020)

An **experimental** Drupal database driver for Doctrine DBAL. **Do not use if not for trial. No support, sorry :)**

RequiresMinimum versionDrupal11.xDoctrine DBAL4Drush13.xPHP8.3Concept
-------

[](#concept)

The concept is to use Doctrine DBAL as an additional database abstraction layer. The code of the DBAL Drupal database driver is meant to be 'database agnostic', i.e. the driver should be able to execute on any db platform that DBAL supports (in theory, practically there still need to be db-platform specific hacks through the concept of DBAL extensions, see below).

The Drupal database `Connection` class that this driver implements opens a `DBAL\Connection`, and hands over statements' execution to it. `DBAL\Connection` itself wraps a lower level driver connection (`PDO`for pdo\_mysql and pdo\_sqlite drivers, `mysqli` for the mysqli driver). Similarly, the `StatementWrapper` wraps a `DBAL\Statement`, which itself wraps a DBAL-driver level `Statement`. The DBAL connection provides additional features like the Schema Manager that can introspect a database schema and build DDL statements, a Query Builder that can build SQL statements based on the database platform in use, etc. etc.

To overcome DBAL limitations and/or fit Drupal specifics, the DBAL Drupal database driver also instantiates an additional object called `DBALExtension`, unique for the DBAL Driver in use, to which some operations that are db- or Drupal-specific are delegated.

Status
------

[](#status)

The code in the `master` branch is working on a **MySql database**, using either the 'mysql' or the 'mysqli' DBAL drivers, on a **SQlite database**, using the 'sqlite' DBAL driver, or on a **Oracle database** using the 'oci8' database driver.

'Working' means:

1. it is possible to install a Drupal site via the installer, selecting 'Doctrine DBAL' as the database of choice;
2. it is passing a selection of core PHPUnit tests , executed on GitHub Actions CI. The latest patches for the issues listed in 'Related Drupal issues' below need to be applied to get a clean test run.

Installation
------------

[](#installation)

Very rough instructions to install Drupal from scratch with this db driver under the hood:

1. Get the DruDbal module from Packagist via Composer, it will install Doctrine DBAL as well:

```
$ composer require mondrake/drudbal:dev-master

```

2. Launch the interactive installer. Proceed as usual and when on the db selection form, select 'Doctrine DBAL' and enter a 'database URL' compliant with Doctrine DBAL syntax. **Note:** the driver works only with *mysql, mysqli, oci8 or sqlite* DBAL drivers.

[![configuration](https://cloud.githubusercontent.com/assets/1174864/24586418/7f86feb4-17a0-11e7-820f-eb1483dad07f.png)](https://cloud.githubusercontent.com/assets/1174864/24586418/7f86feb4-17a0-11e7-820f-eb1483dad07f.png)

3. If everything goes right, when you're welcomed to the new Drupal installation, visit the Status Report. The 'database' section will report something like:

[![status_report](https://user-images.githubusercontent.com/1174864/29685128-ca25375c-8914-11e7-8305-9ba369f68067.png)](https://user-images.githubusercontent.com/1174864/29685128-ca25375c-8914-11e7-8305-9ba369f68067.png)

Related DBAL issues/PRs
-----------------------

[](#related-dbal-issuesprs)

IssueDescriptionInfo[doctrine/dbal#1349](https://github.com/doctrine/dbal/issues/1349)DBAL-182: Insert and Merge Query Objects[doctrine/dbal#1320](https://github.com/doctrine/dbal/issues/1320)DBAL-163: Upsert support in DBAL[doctrine/dbal#2762](https://github.com/doctrine/dbal/pull/2762)Bulk inserts[doctrine/dbal#1033](https://github.com/doctrine/dbal/issues/1033)DBAL-1096: schema-tool:update does not understand columnDefinition correctly[doctrine/migrations#17](https://github.com/doctrine/migrations/issues/17)Data loss on table renaming.[doctrine/dbal#2415](https://github.com/doctrine/dbal/pull/2415)Add some MySQL platform data in Tablesfixed in 2.9.0Related Drupal issues
---------------------

[](#related-drupal-issues)

IssueDescriptiontbdAdd tests for Upsert with default valuestbdEnsure that when INSERTing a NULL value in a database column, SELECTing it back returns NULL and not empty string - for all fetch modestbdUpdateTestBase::runUpdate should reset database schema after updating[\#2992274](https://www.drupal.org/project/drupal/issues/2992274)Installer tests fail if contrib driver hides database credentials form fields

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance24

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2028b17254bcd883f1624cfbd0839b1176c619adfa667c95d8be7a23447ba9c0?d=identicon)[mondrake](/maintainers/mondrake)

---

Top Contributors

[![mondrake](https://avatars.githubusercontent.com/u/1174864?v=4)](https://github.com/mondrake "mondrake (353 commits)")

### Embed Badge

![Health badge](/badges/mondrake-drudbal/health.svg)

```
[![Health](https://phpackages.com/badges/mondrake-drudbal/health.svg)](https://phpackages.com/packages/mondrake-drudbal)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
