https://github.com/shinjin/pdo
A PDO wrapper, because the internet needed another PDO wrapper
https://github.com/shinjin/pdo
pdo pdo-wrapper php
Last synced: about 1 month ago
JSON representation
A PDO wrapper, because the internet needed another PDO wrapper
- Host: GitHub
- URL: https://github.com/shinjin/pdo
- Owner: shinjin
- License: mit
- Created: 2018-02-14T07:45:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-21T17:23:52.000Z (almost 8 years ago)
- Last Synced: 2025-07-21T03:27:01.212Z (7 months ago)
- Topics: pdo, pdo-wrapper, php
- Language: PHP
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Pdo
[![Build Status][ico-travis]][link-travis]
[![Coverage Status][ico-coveralls]][link-coveralls]
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
``` bash
$ composer require shinjin/pdo
```
## Usage
``` php
$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](docs/Usage.md) for a complete list of examples.
## Change log
See [CHANGELOG](CHANGELOG.md).
## Testing
``` bash
$ composer test
```
## Contributing
Bugfixes and updates to support new db drivers are welcome. Please submit pull requests to [Github][link-github].
## Authors
- [Rick Shin][link-author]
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
[ico-coveralls]: https://coveralls.io/repos/github/shinjin/pdo/badge.svg
[ico-travis]: https://img.shields.io/travis/shinjin/pdo/master.svg?style=flat-square
[link-author]: https://github.com/shinjin
[link-github]: https://github.com/shinjin/pdo
[link-coveralls]: https://coveralls.io/github/shinjin/pdo
[link-travis]: https://travis-ci.org/shinjin/pdo