another fix

This commit is contained in:
Roman 2021-04-08 19:28:05 +02:00
parent adf7f19df7
commit 1812b87fb4

@ -21,6 +21,7 @@ use Driver\SQL\Expression\DateAdd;
use Driver\SQL\Expression\Expression; use Driver\SQL\Expression\Expression;
use Driver\SQL\Query\CreateProcedure; use Driver\SQL\Query\CreateProcedure;
use Driver\SQL\Query\CreateTrigger; use Driver\SQL\Query\CreateTrigger;
use Driver\SQL\Query\Insert;
use Driver\SQL\Query\Query; use Driver\SQL\Query\Query;
use Driver\SQL\Strategy\Strategy; use Driver\SQL\Strategy\Strategy;
use Driver\SQL\Strategy\UpdateStrategy; use Driver\SQL\Strategy\UpdateStrategy;
@ -180,6 +181,10 @@ class PostgreSQL extends SQL {
return $columns ? (" RETURNING " . $this->columnName($columns)) : ""; return $columns ? (" RETURNING " . $this->columnName($columns)) : "";
} }
public function executeQuery(Query $query, bool $fetchResult = false) {
return parent::executeQuery($query, $fetchResult || ($query instanceof Insert && !empty($query->getReturning())));
}
protected function fetchReturning($res, string $returningCol) { protected function fetchReturning($res, string $returningCol) {
$this->lastInsertId = $res[0][$returningCol]; $this->lastInsertId = $res[0][$returningCol];
} }