PHPackages                             ziyoren/database - 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. ziyoren/database

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

ziyoren/database
================

Database components supporting connection pooling.

1.1.0(5y ago)130MITPHPPHP &gt;=7.1

Since Dec 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ziyoren/database)[ Packagist](https://packagist.org/packages/ziyoren/database)[ RSS](/packages/ziyoren-database/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

A database component based on [meboo](https://github.com/catfan/Medoo), which can run in php-fpm and [swoole](https://github.com/swoole/swoole-src) environment, and support database connection pool in swoole.

Requirement
-----------

[](#requirement)

- PHP7.1+
- PDO extension installed.
- Swoole 4.4+

Get Started
-----------

[](#get-started)

### Install

[](#install)

```
$ composer require ziyoren/database

```

### update

[](#update)

```
$ composer update

```

### PDO Databases

[](#pdo-databases)

```
require 'vendor/autoload.php';

use ziyoren\Database\BaseModel; // swoole(支持数据库连接池)
//use ziyoren\Database\PDO;       // 传统的php-fpm 无连接池

//For database configuration, see ziyoren\Database\DbConfig.php
$db = new BaseModel(); //swoole模式下使用
//$db = new PDO(); //php-fpm模式下使用

$db->insert('account', [
    'user_name' => 'foo',
    'email' => 'foo@bar.com'
]);

$data = $db->select('account', [
    'user_name',
    'email'
], [
    'user_id' => 50
]);

echo json_encode($data);
```

### Redis pools

[](#redis-pools)

```
require 'vendor/autoload.php';

use ziyoren\Database\BaseRedis;

//For Redis configuration, see /config/redis.php
$redis = new BaseRedis();
$redis->set('key', 'value');
$rst = $redis->get('key');

echo $rst; //value
```

License
-------

[](#license)

ziyoren/database is under the MIT license.

Links
-----

[](#links)

- Databases Doc:
- Redis Doc: [https://github.com/phpredis/phpredis/blob/develop/README.markdown](https://medoo.in/doc)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Every ~2 days

Total

3

Last Release

1984d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/32029608?v=4)[Sunline](/maintainers/ziyoren)[@ziyoren](https://github.com/ziyoren)

### Embed Badge

![Health badge](/badges/ziyoren-database/health.svg)

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

PHPackages © 2026

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