Cozy Database
![Software License][ico-license]
![Coverage Status][ico-scrutinizer]
![Total Downloads][ico-downloads], (*1)
Powerful database toolkit for PHP 7+ that wraps PDO with many features to
provide an expressive query builder and data mapper. It also serves as the
database layer of the Cozy PHP Framework., (*2)
Install
Via Composer, (*3)
``` bash
$ composer require cozy/database, (*4)
## Usage
``` php
$pdo = new PDO('mysql:host=127.0.0.1;port=3306;dbname=test', 'user', 'password');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // optional
$db = new Cozy\Database\Connection($pdo);
$result = $db
->prepare('SELECT * FROM table WHERE id = ?')
->mapParams(['str'])
->bindValues(['aapg'])
->fetchAllAsArray();
Change log
Please see CHANGELOG for more information on what has changed recently., (*5)
Testing
bash
$ composer test
, (*6)
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details., (*7)
Security
If you discover any security related issues, please email info@nestorpicado.com instead of using the issue tracker., (*8)
Credits
License
The MIT License (MIT). Please see License File for more information., (*9)