Use the driverConnection executeUpdate method
This commit is contained in:
parent
a2c2393574
commit
eec12ecd23
|
@ -126,7 +126,7 @@ class Connection
|
|||
'available_at' => '?',
|
||||
]);
|
||||
|
||||
$this->executeQuery($queryBuilder->getSQL(), [
|
||||
$this->executeUpdate($queryBuilder->getSQL(), [
|
||||
$body,
|
||||
json_encode($headers),
|
||||
$this->configuration['queue_name'],
|
||||
|
@ -179,7 +179,7 @@ class Connection
|
|||
->set('delivered_at', '?')
|
||||
->where('id = ?');
|
||||
$now = new \DateTime();
|
||||
$this->executeQuery($queryBuilder->getSQL(), [
|
||||
$this->executeUpdate($queryBuilder->getSQL(), [
|
||||
$now,
|
||||
$doctrineEnvelope['id'],
|
||||
], [
|
||||
|
@ -329,6 +329,25 @@ class Connection
|
|||
return $stmt;
|
||||
}
|
||||
|
||||
private function executeUpdate(string $sql, array $parameters = [], array $types = [])
|
||||
{
|
||||
try {
|
||||
$stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types);
|
||||
} catch (TableNotFoundException $e) {
|
||||
if ($this->driverConnection->isTransactionActive()) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
// create table
|
||||
if ($this->autoSetup) {
|
||||
$this->setup();
|
||||
}
|
||||
$stmt = $this->driverConnection->executeUpdate($sql, $parameters, $types);
|
||||
}
|
||||
|
||||
return $stmt;
|
||||
}
|
||||
|
||||
private function getSchema(): Schema
|
||||
{
|
||||
$schema = new Schema([], [], $this->driverConnection->getSchemaManager()->createSchemaConfig());
|
||||
|
|
Reference in New Issue