dbal is a free, open source databases project written in PHP and released under MIT. It has 9,707 GitHub stars, 1,377 forks and 304 open issues, and was last pushed 6 days ago. On this registry it ranks #82 of 143 tracked projects in Databases, with 5 head-to-head comparisons available.

What is dbal?

Doctrine DBAL is an MIT-licensed PHP database abstraction layer, maintained as part of the Doctrine project, that provides one API for database schema introspection and schema management across IBM Db2, MariaDB, MySQL, Oracle, PostgreSQL, SQL Server and SQLite — and it is aimed at PHP developers and teams that must write database code portable across those engines instead of hand-writing driver-specific SQL for each one.

What it is

Doctrine DBAL is a PHP library that sits between application code and the underlying database driver. It presents a single, consistent interface for talking to seven engines named in the project topics: IBM Db2, MariaDB, MySQL, Oracle, PostgreSQL, SQL Server and SQLite. The README describes it as a "Powerful Database Abstraction Layer with many features for database schema introspection and schema management," which places its emphasis on two areas rather than only on query dispatch: reading the structure of an existing database, and managing that structure programmatically.

The concrete problem it solves is the multiplication of vendor-specific database code. Without an abstraction layer, an application that must run on MySQL for one deployment and PostgreSQL or SQL Server for another carries divergent query code, divergent driver handling and divergent schema tooling per engine. Doctrine DBAL replaces that hand-written, per-engine access and schema code with one portable API, so the differences between engines are handled inside the layer rather than duplicated in every application that needs portability. It lives in the PHP ecosystem, is published through the Doctrine project website and documentation site, and is distributed as a library rather than as a server or service.

Key capabilities

  • One abstraction over the seven platforms listed in the project topics: ibm-db2, mariadb, mysql, oracle, postgresql, sql-server and sqlite.
  • Database schema introspection, so existing database structures can be read rather than assumed.
  • Database schema management, covering planned changes to schema structure through the same portable layer.
  • Four release lines maintained in parallel: 5.0-dev, 4.5-dev, 4.4 and 3.10.
  • Continuous Integration through GitHub Actions on each of those branches, with the workflow continuous-integration.yml.
  • Per-branch Code Coverage reporting on Codecov for 5.0.x, 4.5.x, 4.4.x and 3.10.x.
  • MIT licence, so the layer itself carries no per-seat or per-deployment cost.

Who uses it and how

  • PHP teams whose product ships to customers running different engines, where the same codebase must behave correctly on MySQL for one customer and SQL Server or PostgreSQL for another.
  • Applications that need to inspect a live database schema at runtime rather than relying on an out-of-date description of it.
  • Teams that manage schema structure as part of their application code and want that work expressed once instead of once per supported engine.
  • Projects remaining on the 3.10 line while newer work proceeds on 4.4, 4.5 and 5.0, since all four lines are still published and tested.
  • Codebases in the wider Doctrine ecosystem, given that the library is documented and released as a Doctrine project component.

Getting started

The README excerpt reviewed here does not include an install or run command; it points to the project website at doctrine-project.org/projects/dbal.html and to the documentation at docs.doctrine-project.org/projects/doctrine-dbal/en/latest/. Installation and usage details should be taken from those pages and from the branch listing for 5.0-dev, 4.5-dev, 4.4 or 3.10.

How it compares

The facts provided name no other comparable tool and no list of paid products that this project replaces, so Doctrine DBAL stands alone in this registry on that axis. Any comparison against alternatives would have to be supplied from outside the material gathered here.

When to use it — and when not to

There is nothing to host: Doctrine DBAL is a PHP library, with no separate database, object storage or SMTP service for an operator to run, so adoption cost is limited to adding a dependency and choosing a release line. It is a poor fit for a project that targets exactly one engine and wants the native driver API directly, since the abstraction adds a layer that such a project gains nothing from. Honest caveats from the available facts: the README excerpt is thin and carries no install instructions, the repository holds 304 open issues, and its documentation and issue tracker are the practical sources of support rather than the README itself.

project readme (upstream, from github) — read inline

Frequently asked questions

Is dbal free to use?

dbal is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does dbal do?

Doctrine Database Abstraction Layer

What is dbal written in?

dbal is primarily written in PHP. Its source is publicly available at https://github.com/doctrine/dbal, and it has 9,707 GitHub stars.