diff --git a/core/Driver/SQL/PostgreSQL.class.php b/core/Driver/SQL/PostgreSQL.class.php index 3e86775..2ed6946 100644 --- a/core/Driver/SQL/PostgreSQL.class.php +++ b/core/Driver/SQL/PostgreSQL.class.php @@ -21,6 +21,7 @@ use Driver\SQL\Expression\DateAdd; use Driver\SQL\Expression\Expression; use Driver\SQL\Query\CreateProcedure; use Driver\SQL\Query\CreateTrigger; +use Driver\SQL\Query\Insert; use Driver\SQL\Query\Query; use Driver\SQL\Strategy\Strategy; use Driver\SQL\Strategy\UpdateStrategy; @@ -180,6 +181,10 @@ class PostgreSQL extends SQL { 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) { $this->lastInsertId = $res[0][$returningCol]; }