arrowphp/database

Add Database support to Arrow.

v0.1.20190203 2019-02-03 06:07 UTC

This package is not auto-updated.

Last update: 2024-04-18 22:49:40 UTC


README

Software License

This is the Arrow Database plugin. It adds Database capability to any Arrow powered application.

Install

Via project composer.json

  "require": {
    "arrowphp/arrow": "@dev",
    "arrowphp/database": "@dev"
  }

Usage

// Get the PDO instance of the default database connection
$pdo = $container->get(\Arrow\Database\Constant::CONTAINER_DATABASE());
// or get the PDO instance by config name
$pdo = $container->get(\Arrow\Database\Constant::CONTAINER_DATABASE('legacy-db'));

Implementation

Update your existing config.php or add a new config file config.database.php and update with below config.


return [
    'package' => [
        'arrowphp/database' => [
            'Connections' => [
                'default' => [
                    // For more information on dsn, see https://phpdelusions.net/pdo#dsn
                    'dsn' => '<dsn>',
                    'user' => '<user>',
                    'password' => '<password>',
                    'attributes' => [
                        // eg \PDO::ATTR_PERSISTENT => true,
                    ],
                ],
            ],
        ],
    ],
];

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please contact Chris Pennycuick directly instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.