sjdskl/dbpool
Composer 安装命令:
composer require sjdskl/dbpool
包简介
db link pool
README 文档
README
Based on multi threads Database link pools
- pthreads extension
- php >= 7.2
Featrues
- DB Driver used catfan/medoo, you can call its method at client just like local call
- Chain Call
- very easy to use
$client = DbPool\Client\DbPoolClient::getInstance('127.0.0.1', AF_INET, 1122);
for($i = 0; $i < 10; $i ++) {
$res = $client->query('select * from test.bairong where id=' . ($i + 1) . ' limit 1;')->fetchAll(\PDO::FETCH_ASSOC)->excute();
print_r($res);
}
$res = $client->select('bairong', ['id', 'realname', 'phone'], ['id[<=]' => 10])->excute();
- Two link code you can run up server
$server = new \DbPool\Server\DbPoolServer('127.0.0.1', AF_INET, 1122);
//$server = new \DbPool\Server\DbPoolServer('/tmp/skl.sock', AF_UNIX);
$server->loop();
5.Support Transcation
$client->action(function() use ($client) {
$client->update('bairong', ['realname' => '你大爷xxxx'], [
'id' => 1,
])->excute();
//true -> ommit,false -> rollback, just like medoo
return true;
});
6.Support DB Link Heartbeat
public static $HeartBeatTime = 600;
public static $HeartBeatCheckTime = 60;
7.Custom Message Event
8.Support AES And RSA Encrypt
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2018-03-13