mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 18:27:44 +08:00
Fixed bug that connection->select()
cannot work for database-pgsql
. (#5016)
Co-authored-by: 李铭昕 <715557344@qq.com>
This commit is contained in:
parent
15155bce0d
commit
733e4e5185
@ -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
|
||||
|
||||
|
@ -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) ?: [];
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user