qqq
This commit is contained in:
+4
-12
@@ -77,8 +77,8 @@ class Command extends Component
|
|||||||
*/
|
*/
|
||||||
public function all(): bool|array
|
public function all(): bool|array
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$client = $this->connection->getConnection();
|
$client = $this->connection->getConnection();
|
||||||
|
try {
|
||||||
if (($prepare = $client->prepare($this->sql)) === false) {
|
if (($prepare = $client->prepare($this->sql)) === false) {
|
||||||
throw new Exception($client->errorInfo()[1]);
|
throw new Exception($client->errorInfo()[1]);
|
||||||
}
|
}
|
||||||
@@ -91,11 +91,9 @@ class Command extends Component
|
|||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
} finally {
|
} finally {
|
||||||
if (isset($client)) {
|
|
||||||
$this->connection->release($client);
|
$this->connection->release($client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool|array|null
|
* @return bool|array|null
|
||||||
@@ -103,8 +101,8 @@ class Command extends Component
|
|||||||
*/
|
*/
|
||||||
public function one(): null|bool|array
|
public function one(): null|bool|array
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$client = $this->connection->getConnection();
|
$client = $this->connection->getConnection();
|
||||||
|
try {
|
||||||
if (($prepare = $client->prepare($this->sql)) === false) {
|
if (($prepare = $client->prepare($this->sql)) === false) {
|
||||||
throw new Exception($client->errorInfo()[1]);
|
throw new Exception($client->errorInfo()[1]);
|
||||||
}
|
}
|
||||||
@@ -117,11 +115,9 @@ class Command extends Component
|
|||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
} finally {
|
} finally {
|
||||||
if (isset($client)) {
|
|
||||||
$this->connection->release($client);
|
$this->connection->release($client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
@@ -129,8 +125,8 @@ class Command extends Component
|
|||||||
*/
|
*/
|
||||||
public function fetchColumn(): mixed
|
public function fetchColumn(): mixed
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$client = $this->connection->getConnection();
|
$client = $this->connection->getConnection();
|
||||||
|
try {
|
||||||
if (($prepare = $client->prepare($this->sql)) === false) {
|
if (($prepare = $client->prepare($this->sql)) === false) {
|
||||||
throw new Exception($client->errorInfo()[1]);
|
throw new Exception($client->errorInfo()[1]);
|
||||||
}
|
}
|
||||||
@@ -143,11 +139,9 @@ class Command extends Component
|
|||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
} finally {
|
} finally {
|
||||||
if (isset($client)) {
|
|
||||||
$this->connection->release($client);
|
$this->connection->release($client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -167,8 +161,8 @@ class Command extends Component
|
|||||||
*/
|
*/
|
||||||
private function _execute(): bool|int
|
private function _execute(): bool|int
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$client = $this->connection->getConnection();
|
$client = $this->connection->getConnection();
|
||||||
|
try {
|
||||||
if (($prepare = $client->prepare($this->sql)) === false) {
|
if (($prepare = $client->prepare($this->sql)) === false) {
|
||||||
throw new Exception($client->errorInfo()[1]);
|
throw new Exception($client->errorInfo()[1]);
|
||||||
}
|
}
|
||||||
@@ -188,11 +182,9 @@ class Command extends Component
|
|||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
} finally {
|
} finally {
|
||||||
if (isset($client)) {
|
|
||||||
$this->connection->release($client);
|
$this->connection->release($client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Throwable $throwable
|
* @param Throwable $throwable
|
||||||
|
|||||||
Reference in New Issue
Block a user