shinjin / pdo
A PDO wrapper, because the internet needed another PDO wrapper
0.6.3
2018-04-05 23:22 UTC
Requires
- php: ^5.6 || ^7.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.0
- phpunit/dbunit: ^2.0
- phpunit/phpunit: ^5.0
README
A PDO wrapper, because the internet needed another PDO wrapper.
Use shinjin/pdo if you need a thin wrapper that:
- uses arrays to unpack query values
- uses prepared statements to execute queries and bulk operations
- supports upserts (insert or update on duplicate key)
- supports nested transactions
Install
Via Composer
$ composer require shinjin/pdo
Usage
$connection_parameters = array( 'driver' => 'mysql', 'dbname' => 'dbtest', 'user' => 'shinjin', 'password' => 'awesomepasswd' ); $db = new Db($connection_parameters); $statement = 'SELECT * FROM guestbook WHERE id = ?'; $parameters = array(1); $result = $db->query($statement, $parameters)->fetchAll();
See Usage for a complete list of examples.
Change log
See CHANGELOG.
Testing
$ composer test
Contributing
Bugfixes and updates to support new db drivers are welcome. Please submit pull requests to Github.
Authors
License
The MIT License (MIT). Please see License File for more information.