Skip to content

Latest commit

 

History

History
68 lines (52 loc) · 1.5 KB

README.md

File metadata and controls

68 lines (52 loc) · 1.5 KB

MageMojo

SplitDb

Magento 2 module to redirect SELECT queries to another database connection.

Version 1.6.0

Contributing

See CONTRIBUTING.md.

Manual Install

  • Download this ZIP and paste in your root folder.

  • Add a new connection in your file app/etc/env.php called readonly and readonly_setup, like the example env.php file below.

'db' =>
  array (
    'table_prefix' => '',
    'connection' =>
    array (
      'default' =>
      array (
        'host' => 'default_writer',
        'dbname' => 'db_name',
        'username' => 'user_name',
        'password' => 'yourpassword',
        'active' => '1',
      ),

      'readonly' =>
      array (
        'host' => 'reader_host',
        'dbname' => 'db_name',
        'username' => 'user_name',
        'password' => 'yourpassword',
        'active' => '1',
      ),

    ),
  ),
  'resource' =>
  array (
    'default_setup' =>
    array (
      'connection' => 'default',
    ),
    'readonly' =>
    array (
      'connection' => 'readonly',
    ),
  ),

  • Run these commands in your terminal:
bin/magento module:enable MageMojo_SplitDb
bin/magento setup:upgrade

License

License: MIT