Fixed bug that connection->select() cannot work for database-pgsql. (#5016)

Co-authored-by: 李铭昕 <715557344@qq.com>
This commit is contained in:
kingIZZZY 2022-08-15 07:50:37 -04:00 committed by GitHub
parent 15155bce0d
commit 733e4e5185
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -54,7 +54,7 @@ composer analyse
- [#4908](https://github.com/hyperf/hyperf/pull/4908) Added `Db::beforeExecuting()` to register a hook which to be run just before a database query is executed.
- [#4909](https://github.com/hyperf/hyperf/pull/4909) Added `ConsumerMessageInterface::getNums()` to change the number of amqp consumer by dynamically.
- [#4918](https://github.com/hyperf/hyperf/pull/4918) Added `LoadBalancerInterface::afterRefreshed()` to register a hook which to be run after refresh nodes.
- [#4994](https://github.com/hyperf/hyperf/pull/4994) Added component `hyperf/database-pgsql` which you can be used to connect pgsql server.
- [#4994](https://github.com/hyperf/hyperf/pull/4994) [#5016](https://github.com/hyperf/hyperf/pull/5016) Added component `hyperf/database-pgsql` which you can be used to connect pgsql server.
## Optimized

View File

@ -31,6 +31,8 @@ class PostgreSqlSwooleExtConnection extends Connection
*/
protected mixed $pdo;
protected int $fetchMode = SW_PGSQL_ASSOC;
/**
* Get a schema builder instance for the connection.
*/
@ -108,7 +110,7 @@ class PostgreSqlSwooleExtConnection extends Connection
throw new QueryException($query, [], new \Exception($this->pdo->error));
}
return $this->pdo->fetchAll($result) ?: [];
return $statement->fetchAll($this->fetchMode) ?: [];
});
}