<?php
return [
    'default' => 'mysql',
    'connections' => [
        'mysql' => [
            'driver' => env('DB_TYPE', 'mysql'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', 3306),
            'database' => env('DB_NAME', 'saiadmin'),
            'username' => env('DB_USER', 'root'),
            'password' => env('DB_PASSWORD', '123456'),
            'charset' => env('DB_CHARSET', 'utf8mb4'),
            'collation' => env('DB_COLLATION', 'utf8mb4_general_ci'),
            'prefix' => env('DB_PREFIX', ''),
            'strict' => true,
            'engine' => null,
            'options' => [
                PDO::ATTR_EMULATE_PREPARES => false, // Must be false for Swoole and Swow drivers.
            ],
            'pool' => [
                'max_connections' => (int) env('DB_POOL_MAX', 20),
                'min_connections' => (int) env('DB_POOL_MIN', 2),
                'wait_timeout' => (float) env('DB_POOL_WAIT_TIMEOUT', 1.0),
                'idle_timeout' => (int) env('DB_POOL_IDLE_TIMEOUT', 60),
                'heartbeat_interval' => 50,
            ],
        ],
    ],
];