speedwork/database

This package is abandoned and no longer maintained. No replacement package was suggested.

Speedwork database Library

v1.0.4 2017-07-29 11:27 UTC

This package is not auto-updated.

Last update: 2018-08-08 05:24:59 UTC


README

=============================================

Latest Stable Version Latest Unstable Version License Total Downloads Build Status

Sample Connection Configuration


    'sample' => [
        'driver'     => 'mysqli',
        'persistent' => false,
        'host'       => env('DB_HOST', '127.0.0.1'),
        'database'   => env('DB_DATABASE', 'speedwork'),
        'username'   => env('DB_USERNAME', 'root'),
        'password'   => env('DB_PASSWORD', ''),
        'charset'    => 'utf8',
        'collation'  => 'utf8_general_ci',
        'prefix'     => env('DB_PREFIX', 'speed_'),
    ],

    // With failover connection
    'sample1' => [
        'driver'     => 'mysqli',
        'persistent' => false,
        'host'       => env('DB_HOST', '127.0.0.1'),
        'database'   => env('DB_DATABASE', 'speedwork'),
        'username'   => env('DB_USERNAME', 'root'),
        'password'   => env('DB_PASSWORD', ''),
        'charset'    => 'utf8',
        'collation'  => 'utf8_general_ci',
        'prefix'     => env('DB_PREFIX', 'speed_'),
        'masters' => [
            ['host' => '172.16.1.207'],
            ['host' => '172.16.1.184'],
        ],
    ],

    'master' => [
        'driver'     => 'mysqli',
        'persistent' => false,
        'wrapper'    => 'MasterSlave',
        'database'   => env('DB_DATABASE', 'speedwork'),
        'username'   => env('DB_USERNAME', 'root'),
        'password'   => env('DB_PASSWORD', ''),
        'charset'    => 'utf8',
        'collation'  => 'utf8_general_ci',
        'prefix'     => env('DB_PREFIX', 'speed_'),
        'master'     => [
            'host' => '172.16.1.213',
        ],
        'slaves' => [
            ['host' => '172.16.1.207'],
            ['host' => '172.16.1.184'],
        ],
        'connections' => [
            'select' => 'slave',
            'update' => 'master',
            'other'  => 'master',
        ],
    ],
    
    'master' => [
            'driver'     => 'mysqli',
            'persistent' => false,
            'wrapper'    => 'MasterSlaveExtended',
            'database'   => env('DB_DATABASE', 'speedwork'),
            'username'   => env('DB_USERNAME', 'root'),
            'password'   => env('DB_PASSWORD', ''),
            'charset'    => 'utf8',
            'collation'  => 'utf8_general_ci',
            'prefix'     => env('DB_PREFIX', 'speed_'),
            'master'     => [
                'host' => '172.16.1.213',
            ],
            'slaves' => [
                ['host' => '172.16.1.207'],
                ['host' => '172.16.1.184'],
            ],
            'connections' => [
                'types' => [
                    'select' => 'slave',
                    'update' => 'master',
                    'other'  => 'master',
                ],
                'patterns' => [
                    'table_name' => 'salve'
                ]
            ],
        ],

#Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Make your changes
  4. Run the tests, adding new ones for your own code if necessary (phpunit)
  5. Commit your changes (git commit -am 'Added some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create new Pull Request