From 1812b87fb49a359ebffbc06f7d6764c5a63b71a4 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 8 Apr 2021 19:28:05 +0200 Subject: [PATCH] another fix --- core/Driver/SQL/PostgreSQL.class.php | 5 +++++ 1 file changed, 5 insertions(+) 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]; }