PHPackages                             emeka/fetcher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. emeka/fetcher

ActivePhp[Database &amp; ORM](/categories/database)

emeka/fetcher
=============

Fetcher is a super light weight PHP database driver, that helps you sync and fetch data from any PDO database in your application.

1.0.0(10y ago)136MITPHPPHP &gt;=5.3.0

Since Oct 9Pushed 10y ago1 watchersCompare

[ Source](https://github.com/andela-eosuagwu/Fetcher)[ Packagist](https://packagist.org/packages/emeka/fetcher)[ RSS](/packages/emeka-fetcher/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD

Candy
=====

[](#candy)

[![Build Status](https://camo.githubusercontent.com/f54430d4268eec18ee32b0d7888789da19c577c3a0b506cf6ece50ced7753d1c/68747470733a2f2f7472617669732d63692e6f72672f616e64656c612d656f7375616777752f43616e64792e737667)](https://travis-ci.org/andela-eosuagwu/Candy)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/87e477440153452b70aeec7f165c344955ae89cda3631863e8297c1b90c4ed21/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e64656c612d656f7375616777752f43616e64792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/andela-eosuagwu/Candy/?branch=master)

#### Candy is lightweight ORM based in php

[](#candy-is-lightweight-orm-based-in-php)

\#Testing The phpunit framework for testing is used to perform unit test on the classes. The TDD principle has been employed to make the application robust

Run this on bash to execute the tests

```
/vendor/bin/phpunit
```

\#Install

- To install this package, PHP 5.5+ and Composer are required

```
composer require emeka/candy
```

\#Usage

- Save a model in the database

```
$user = new User();
$user->username = "john";
$user->password = "password";
$user->email = "john@doe.co";
$user->save();

```

- Find a model

```
$user = User::find($id);

```

- Update a record

```
$user = User::find($id);
$user->password = "s†røngerPaSswoRd";
$user->save();

```

- Delete a record -- returns a boolean

```
$result = User::destroy($id):

```

Change log
----------

[](#change-log)

Please check out [CHANGELOG](CHANGELOG.md) file for information on what has changed recently.

Contributing
------------

[](#contributing)

Please check out [CONTRIBUTING](CONTRIBUTING.md) file for detailed contribution guidelines.

Credits
-------

[](#credits)

Candy is maintained by `Emeka Osuagwu`.

License
-------

[](#license)

Urban dictionary is released under the MIT Licence. See the bundled [LICENSE](LICENSE.md) file for more details.

======= [![Build Status](https://camo.githubusercontent.com/a91e2016312f75aa5808ee72ec05becc354cc8463de71a8c1f42062f892e6976/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e64656c612d656f7375616777752f466574636865722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/andela-eosuagwu/Fetcher/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/58ea13b60af8c36b3e35d331c2c2cbb28379c7bbd96dada85a658478dbad31d7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e64656c612d656f7375616777752f466574636865722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/andela-eosuagwu/Fetcher/?branch=master)[![Build Status](https://camo.githubusercontent.com/4b957f0b4e1c5024e143ef09b1342abc2fdc5e5018030bb15b6388809d57a428/68747470733a2f2f7472617669732d63692e6f72672f616e64656c612d656f7375616777752f466574636865722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/andela-eosuagwu/Fetcher)

Fetcher
=======

[](#fetcher)

Fetcher is a super light weight PHP database driver, that helps you sync and fetch data from any PDO database in your application.

Install
=======

[](#install)

Via Composer

To add open-source-fetcher as a dependency, run the following in your project directory.

```
$ composer install emeka/fetcher
```

Then to install, run

```
$ composer install
```

Usage
=====

[](#usage)

\###First

Create .env file in your root `Directory`

Then add the following

- db\_user = "database\_user"
- db\_host = "database\_host"
- db\_name = "database\_name"
- database = "database\_type"
- db\_password = "database\_password"

### Then

[](#then)

```
use Emeka\Fetcher\Fetcher\Fetch;
$fetcher = new Fetch();
$fetch->query('Select * from posts');
echo $fetcher->fetchObj();
echo $fetcher->fetchLazy();
echo $fetcher->fetchBoth();
echo $fetcher->fetchAssoc();

```

Testing
=======

[](#testing)

To test, type the following into the terminal from the project directory

```
$ phpunit

```

or

```
$ composer test

```

Security
========

[](#security)

f you discover any security related issues, please email [](emekaosuagwuandela@gmail.com) or [@dev\_emeka](https://twitter.com/dev_emeka) instead of using the issue tracker.

Credit
======

[](#credit)

\###Emeka Osuagwu

License
=======

[](#license-1)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

> > > > > > > a5823c5d97cfe4787d130a303bd4f19457aa2579

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3920d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aaf341d1508a15aadbeeff94e5674ec4c13c962ae1e8aebdccd754c882458bce?d=identicon)[Emeka](/maintainers/Emeka)

---

Top Contributors

[![emeka-osuagwu](https://avatars.githubusercontent.com/u/13197724?v=4)](https://github.com/emeka-osuagwu "emeka-osuagwu (31 commits)")

---

Tags

fetchdatabase driverfetchersycn databasepdo drivephp database driverfetch pdo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/emeka-fetcher/health.svg)

```
[![Health](https://phpackages.com/badges/emeka-fetcher/health.svg)](https://phpackages.com/packages/emeka-fetcher)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[ntanduy/cloudflare-d1-database

Cloudflare D1 database driver for Laravel — full Eloquent &amp; Query Builder support.

267.8k](/packages/ntanduy-cloudflare-d1-database)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
