This commit is contained in:
2023-04-02 23:28:23 +08:00
parent cd9327f5c2
commit d9fd802312
3 changed files with 24 additions and 3 deletions
+1 -1
View File
@@ -208,7 +208,7 @@ class Command extends Component
} }
/** /**
* @return array<PDO, PDOStatement>|bool * @return array<Mysql\PDO, PDOStatement>|bool
* @throws Exception * @throws Exception
*/ */
private function search(): bool|array private function search(): bool|array
+1 -1
View File
@@ -160,7 +160,7 @@ class Connection extends Component
} }
/** /**
* @return PDO * @return Mysql\PDO
* @throws Exception * @throws Exception
*/ */
public function getSlaveClient(): Mysql\PDO public function getSlaveClient(): Mysql\PDO
+22 -1
View File
@@ -13,7 +13,7 @@ use Kiri\Server\Abstracts\StatusEnum;
use Swoole\Timer; use Swoole\Timer;
/** /**
* * @mixin \PDO
*/ */
class PDO implements StopHeartbeatCheck class PDO implements StopHeartbeatCheck
{ {
@@ -89,6 +89,27 @@ class PDO implements StopHeartbeatCheck
} }
/**
* @param string $name
* @param array $arguments
* @return mixed
*/
public function __call(string $name, array $arguments)
{
return $this->_pdo()->{$name}(...$arguments);
}
/**
* @param string $sql
* @return PDOStatement|bool
*/
public function prepare(string $sql): PDOStatement|bool
{
return $this->_pdo()->prepare($sql);
}
/** /**
* *
*/ */