Skip to content

Commit

Permalink
Fixed bug that PgSQLSwooleConnection::unprepared cannot work. (#5332)
Browse files Browse the repository at this point in the history

Co-authored-by: 李铭昕 <[email protected]>
  • Loading branch information
kingIZZZY and limingxinleo authored Jan 20, 2023
1 parent 595c4c8 commit 4dd3068
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/PostgreSqlSwooleExtConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,21 @@ public function str_replace_once($needle, $replace, $haystack)
return substr_replace($haystack, $replace, $pos, strlen($needle));
}

public function unprepared(string $query): bool
{
return $this->run($query, [], function ($query) {
if ($this->pretending()) {
return true;
}

$this->recordsHaveBeenModified(
$change = $this->getPdo()->query($query) !== false
);

return $change;
});
}

/**
* Get the default query grammar instance.
* @return \Hyperf\Database\Grammar
Expand Down

0 comments on commit 4dd3068

Please sign in to comment.