PHPackages                             phpple/mysql - 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. phpple/mysql

ActiveLibrary

phpple/mysql
============

The PHP Mysql Graceful Library

v0.0.1(7y ago)0101[1 PRs](https://github.com/phpple/mysql/pulls)MITPHPCI failing

Since Aug 28Pushed 5y ago1 watchersCompare

[ Source](https://github.com/phpple/mysql)[ Packagist](https://packagist.org/packages/phpple/mysql)[ RSS](/packages/phpple-mysql/feed)WikiDiscussions master Synced 2mo ago

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

Phpple Mysql
============

[](#phpple-mysql)

`Phpple Mysql`一个基于PHP语言的Mysql类库，具有使用简单、操作优雅、代码严谨、效率优先等诸多优点。

[![Latest Stable Version](https://camo.githubusercontent.com/be1215188eb1826155bc16312942fe527355f8ef0525e7d7ee12b5c14dcd9833/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706870706c652f6d7973716c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpple/mysql)[![Minimum PHP Version](https://camo.githubusercontent.com/90eed33e7df559b70b174e97d37a4907946803c7ab691640166d2518d8cd2118/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e302d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Build Status](https://camo.githubusercontent.com/0307f1a75e25c44ff2d17b5f9d733f532f2f08e42310b079b25814a01ba65ab3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f706870706c652f6d7973716c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/phpple/mysql)[![codecov](https://camo.githubusercontent.com/7ad71f7cea15ed16eef8b9365b0202657130af64b307c5e963927d3460141684/68747470733a2f2f636f6465636f762e696f2f67682f706870706c652f6d7973716c2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/phpple/mysql)

`Phpple Mysql`提供如下优秀的特性：

- SQL构建器
- yield支持
- 主/从库支持
- 长连接支持
- 分表/分库支持
- psr-4支持

### 使用示例

[](#使用示例)

```
use Phpple\Mysql\Conf;
use Phpple\Mysql\Sql\SqlBuilder;
use Phpple\Mysql\Db;

// 初始化数据库配置
$confs = [
    'db' => [
        'demo' => [
            'dbname' => 'phpple',
            'instance' => 'ip1'
        ],
    ],
    'instance' => [
        'ip1' => [
            'host' => '127.0.0.1',
            'port' => 3306,
            'user' => 'root',
            'pass' => '',
            'charset' => 'utf8'
        ],
    ]
];
Conf::init($confs);

$id = 12030;
// 创建一个Sql构建器
$sqlBuilder = SqlBuilder::withTable('u_user')
    ->fields('view_num')
    ->setData([
        '@view_num' => '(view_num+1)'
    ])
    ->where('id', $id);
// 绑定Sql构建器到Db对象
$db = Db::get('demo')->sqlBuilder($sqlBuilder);

// 获取原始view_num
$viewNum = $db->getSingle();
echo 'before:' . $viewNum . PHP_EOL;

// view_num 自增1
$db->update();

// 重新获取view_num
$newViewnum = $db->getSingle();
echo 'after:' . $newViewnum . PHP_EOL;
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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

2816d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a34df4dd25b4a8efe5c4a59f25f84737df592207c5d177ece3f7a3f5f0a01de?d=identicon)[comdeng](/maintainers/comdeng)

---

Top Contributors

[![comdeng](https://avatars.githubusercontent.com/u/5013951?v=4)](https://github.com/comdeng "comdeng (13 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phpple-mysql/health.svg)

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

PHPackages © 2026

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