PHPackages                             gioco-plus/hyperf-postgres - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. gioco-plus/hyperf-postgres

ActiveLibrary[Database &amp; ORM](/categories/database)

gioco-plus/hyperf-postgres
==========================

0291PHP

Since Jan 20Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/gioco-play/hyperf-postgres)[ Packagist](https://packagist.org/packages/gioco-plus/hyperf-postgres)[ RSS](/packages/gioco-plus-hyperf-postgres/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

hyperf postgresdb pool
======================

[](#hyperf-postgresdb-pool)

```
composer require gioco-plus/hyperf-postgres

php bin/hyperf.php vendor:publish "gioco-plus/hyperf-postgres"

```

動態切換連結池
=======

[](#動態切換連結池)

```
    /**
     * @Inject
     * @var ConfigInterface
     */
    protected $config;

    /**
     * @Inject()
     * @var PostgreSQL
     */
    protected $postgresClient;

    # 使用方式
    $config =  postgres_pool_config('192.168.30.xx', 'ezadmin_yb', 5432, 'gf_db'); # 建立連結資訊
    $this->config->set("postgres.dbYB", $config); # 前綴 "postgresdb."

    $this->postgresClient->setPool("dbYB")->insert("hyperf_test", [
        'aaa'=>'a',
        'bbb'=>'b',
        'ccc'=>'c'
    ]);
```

config
------

[](#config)

在/config/autoload目录里面创建文件 postgres.php 添加以下内容

```
return [
    'default' => [
        'username' => env('POSTGRES_USERNAME', ''),
        'password' => env('POSTGRES_PASSWORD', ''),
        'host' => env('POSTGRES_HOST', '127.0.0.1'),
        'port' => env('POSTGRES_PORT', 5432),
        'database' => env('POSTGRES_DB', 'test'),
        'pool' => [
            'min_connections' => 1,
            'max_connections' => 100,
            'connect_timeout' => 10.0,
            'wait_timeout' => 3.0,
            'heartbeat' => -1,
            'max_idle_time' => (float)env('POSTGRES_MAX_IDLE_TIME', 60),
        ],
    ],
];
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance52

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/52188579?v=4)[goldenfdev](/maintainers/goldenfdev)[@goldenfdev](https://github.com/goldenfdev)

---

Top Contributors

[![Yanghsuanming](https://avatars.githubusercontent.com/u/40749214?v=4)](https://github.com/Yanghsuanming "Yanghsuanming (13 commits)")[![q90016200](https://avatars.githubusercontent.com/u/37729578?v=4)](https://github.com/q90016200 "q90016200 (1 commits)")

### Embed Badge

![Health badge](/badges/gioco-plus-hyperf-postgres/health.svg)

```
[![Health](https://phpackages.com/badges/gioco-plus-hyperf-postgres/health.svg)](https://phpackages.com/packages/gioco-plus-hyperf-postgres)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
