Mysqli

安装

  1. composer require easyswoole/mysqli

Client 用法

  1. $config = new \EasySwoole\Mysqli\Config([
  2. 'host' => '',
  3. 'port' => 3300,
  4. 'user' => '',
  5. 'password' => '',
  6. 'database' => '',
  7. 'timeout' => 5,
  8. 'charset' => 'utf8mb4',
  9. ]);
  10. $client = new \EasySwoole\Mysqli\Client($config);
  11. go(function ()use($client){
  12. //构建sql
  13. $client->queryBuilder()->get('user_list');
  14. //执行sql
  15. var_dump($client->execBuilder());
  16. });

需要调用execBuilder()才会执行