PHPackages                             natterbox/codeception-multidb - 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. natterbox/codeception-multidb

Abandoned → [redmatter/codeception-multidb](/?search=redmatter%2Fcodeception-multidb)Library[Database &amp; ORM](/categories/database)

natterbox/codeception-multidb
=============================

Switch between multiple databases in a Codeception Test

1.0.2(9y ago)1215817[6 issues](https://github.com/redmatter/Codeception-MultiDb/issues)[1 PRs](https://github.com/redmatter/Codeception-MultiDb/pulls)MITPHPPHP &gt;=5.4.0

Since Nov 8Pushed 12mo ago11 watchersCompare

[ Source](https://github.com/redmatter/Codeception-MultiDb)[ Packagist](https://packagist.org/packages/natterbox/codeception-multidb)[ RSS](/packages/natterbox-codeception-multidb/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (8)Used By (0)

Codeception MultiDb Extension
=============================

[](#codeception-multidb-extension)

[![Downloads](https://camo.githubusercontent.com/c96c8984e1d7ef9b7572283ade2b2990e77d742d7e0936d37e08645eb00e7a8b/68747470733a2f2f706f7365722e707567782e6f72672f7265646d61747465722f636f646563657074696f6e2d6d756c746964622f642f746f74616c2e737667)](https://packagist.org/packages/redmatter/codeception-multidb)[![License](https://camo.githubusercontent.com/47038f8f120289b59debccf6a52599efecd7ccf2a44886d3144ec5bec9f2b83d/68747470733a2f2f706f7365722e707567782e6f72672f7265646d61747465722f636f646563657074696f6e2d6d756c746964622f6c6963656e73652e737667)](https://packagist.org/packages/redmatter/codeception-multidb)

This extension supports multiple dabatase backends, providing equivalant service as the [Db module](http://codeception.com/docs/modules/Db). Additionally it provides capability to safely switch between database connectors and multi-level transaction support.

Currently the only database supported is MySQL; but it is pretty straight forward to add support for other databases.

It is still in development, but is stable enough for anyone to give it a try.

Installation
============

[](#installation)

For codeception v2.0, please use `v1.0.0` using the `composer` command below.

```
composer require "redmatter/codeception-multidb: ~1.0.0"

```

A version that supports codeception v2.1 is under active development. You can install it by using the `composer` command below.

```
composer require "redmatter/codeception-multidb: ~2.0@dev"

```

NOTE: Even though there has not yet been a stable release for `2.0`, it is fully compatible with `1.0` for features and its API. Please do log an issue for any bugs or possible improvemnts you identify.

Usage
=====

[](#usage)

Please see [`DemoCest`](examples/tests/acceptance/DemoCest.php) and [`acceptance.suite.yml`](examples/tests/acceptance.suite.yml) in [examples](examples).

In order to avoid MultiDb (or even the Db module from codeception) leaving behind modifications in the database, due to the user aborting a test run by pressing `Ctrl+C`, leading to breaking tests during further runs, consider using the `natterbox/codeception-ctrlc` module.

How to contribute?
==================

[](#how-to-contribute)

Please feel free to fork and submit a pull request. Bug fixes and general usability comments would be much appreciated.

If you are to contribute a feature or bug-fix, please do log an issue before starting to work on the code. Then branch from the appropriate release branch, to make those changes (see below for details).

Coding standard that is followed here is `PSR-2`.

Why version `2.0`?
------------------

[](#why-version-20)

Version `2.0` will be the branch for migrating MultiDb to Codeception version `2.1`.

What is happening to version `1.0`?
-----------------------------------

[](#what-is-happening-to-version-10)

Version `1.0` is still a supported version; any major feature additions or bug fixes will be done for both versions.

Is `master` the same as `2.0`?
------------------------------

[](#is-master-the-same-as-20)

It is essentially the same; but for the purpose of submitting pull requests, you should choose the appropriate branch, depending on the codeception version you have developed against.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 98.2% 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.

###  Release Activity

Cadence

Every ~37 days

Total

7

Last Release

3622d ago

Major Versions

1.0.0 → 2.0.0-RC12015-11-19

1.0.2 → 2.0.0-RC22016-06-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/482e4d123ddfbe5ed61fd256f7ed0eeb2ac086175469960d1e04637e0f59f85f?d=identicon)[redmatter](/maintainers/redmatter)

---

Top Contributors

[![codemedic](https://avatars.githubusercontent.com/u/691011?v=4)](https://github.com/codemedic "codemedic (55 commits)")[![abulford](https://avatars.githubusercontent.com/u/9605766?v=4)](https://github.com/abulford "abulford (1 commits)")

---

Tags

codeceptioncodeception-multidbdatabase

### Embed Badge

![Health badge](/badges/natterbox-codeception-multidb/health.svg)

```
[![Health](https://phpackages.com/badges/natterbox-codeception-multidb/health.svg)](https://phpackages.com/packages/natterbox-codeception-multidb)
```

###  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)
