iamdevice/codeception-multidb

Codeception extension for work with multiple databases

1.0.11 2018-06-04 12:20 UTC

This package is auto-updated.

Last update: 2022-07-29 01:04:14 UTC


README

This module based on original Db module

Installation

composer require iamdevice/codeception-multidb

Config example

modules:
   enabled:
     - MultiDb
   config:
     MultiDb:
       connections:
         masterDb:
           dsn: 'mysql:host=localhost;port=3306;dbname=database'
           user: 'username'
           password: 'password'
           primary: true
           dump: ''
           populate: true
           cleanup: false
           reconnect: true
         slaveDb:
           dsn: 'mysql:host=localhost;port=3307;dbname=database'
           user: 'username'
           password: 'password'
           dump: ''
           populate: true
           cleanup: false
           reconnect: true

Before actions with base you need to select Db like

$I->amConnectedToDb('primary')

or you must define one of the connections as primary with

primary: true

Aleksandr Kozhevnikov © 2017