Skip to content

Commit 4dd3068

Browse files
Fixed bug that PgSQLSwooleConnection::unprepared cannot work. (#5332)
Co-authored-by: 李铭昕 <[email protected]>
1 parent 595c4c8 commit 4dd3068

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/PostgreSqlSwooleExtConnection.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,21 @@ public function str_replace_once($needle, $replace, $haystack)
175175
return substr_replace($haystack, $replace, $pos, strlen($needle));
176176
}
177177

178+
public function unprepared(string $query): bool
179+
{
180+
return $this->run($query, [], function ($query) {
181+
if ($this->pretending()) {
182+
return true;
183+
}
184+
185+
$this->recordsHaveBeenModified(
186+
$change = $this->getPdo()->query($query) !== false
187+
);
188+
189+
return $change;
190+
});
191+
}
192+
178193
/**
179194
* Get the default query grammar instance.
180195
* @return \Hyperf\Database\Grammar

0 commit comments

Comments
 (0)