PHP code example of hyperf / database-pgsql-incubator

1. Go to this page and download the library: Download hyperf/database-pgsql-incubator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hyperf / database-pgsql-incubator example snippets




return [
    'pgsql' => [
        'driver' => 'pgsql',
        'host' => '127.0.0.1',
        'database' => 'hyperf',
        'port' => 5435,
        'username' => 'postgres',
        'password' => "",
        'charset' => env('DB_CHARSET', 'utf8'),
        'collation' => env('DB_COLLATION', 'utf8_unicode_ci'),
        'prefix' => '',
        'schema' => 'public',
        'pool' => [
            'min_connections' => 1,
            'max_connections' => 10,
            'connect_timeout' => 10.0,
            'wait_timeout' => 3.0,
            'heartbeat' => -1,
            'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60),
        ],
        'commands' => [
            'gen:model' => [
                'path' => 'app/Model',
                'force_casts' => false,
                'inheritance' => 'Model',
                'refresh_fillable' => true
            ],
        ],
    ],
    'pgsql-swoole' => [
        'driver' => 'pgsql-swoole',
        'host' => '127.0.0.1',
        'database' => 'hyperf',
        'port' => 5435,
        'username' => 'postgres',
        'password' => "",
        'charset' => env('DB_CHARSET', 'utf8'),
        'collation' => env('DB_COLLATION', 'utf8_unicode_ci'),
        'prefix' => '',
        'schema' => 'public',
        'pool' => [
            'min_connections' => 1,
            'max_connections' => 10,
            'connect_timeout' => 10.0,
            'wait_timeout' => 3.0,
            'heartbeat' => -1,
            'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60),
        ],
        'commands' => [
            'gen:model' => [
                'path' => 'app/Model',
                'force_casts' => false,
                'inheritance' => 'Model',
                'refresh_fillable' => true
            ],
        ],
    ],
];