PHPackages                             hyperf/db-pgsql-incubator - 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. hyperf/db-pgsql-incubator

AbandonedArchivedLibrary

hyperf/db-pgsql-incubator
=========================

v0.2.0(4y ago)53.6k5[1 issues](https://github.com/hyperf/db-pgsql-incubator/issues)[1 PRs](https://github.com/hyperf/db-pgsql-incubator/pulls)MITPHPPHP &gt;=7.3

Since Feb 27Pushed 3y ago2 watchersCompare

[ Source](https://github.com/hyperf/db-pgsql-incubator)[ Packagist](https://packagist.org/packages/hyperf/db-pgsql-incubator)[ RSS](/packages/hyperf-db-pgsql-incubator/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (4)Dependencies (10)Versions (6)Used By (0)

PgSQL driver for Hyperf DB Component
====================================

[](#pgsql-driver-for-hyperf-db-component)

安装
--

[](#安装)

> hyperf/db 组件版本必须大于等于 v2.1.8

```
composer require hyperf/db-pgsql-incubator

```

配置
--

[](#配置)

修改 `autoload/db.php` 配置

```
use Hyperf\DB\PgSQL\PgSQLPool;

return [
    'default' => [
        'driver' => PgSQLPool::class,
        'host' => '127.0.0.1',
        'port' => 5432,
        'database' => 'postgres',
        'username' => 'postgres',
        'password' => 'root',
        'pool' => [
            'min_connections' => 1,
            'max_connections' => 32,
            'connect_timeout' => 10.0,
            'wait_timeout' => 3.0,
            'heartbeat' => -1,
            'max_idle_time' => 60,
        ],
    ],
];
```

使用
--

[](#使用)

具体使用方式与 PDO 一致，只不过需要注意，`pgsql` 中的变量使用 `$1` 而不是 `?` 代表。

例如下述代码

```
