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