protected function getPgClient() {
        if (!isset($this->_pgClient)) {
            $config = [
                'dbCredentials' => [
                    'host' => $this->host,
                    'port' => $this->port,
                    'user' => $this->username,
                    'password' => $this->password,
                    'database' => $this->database,
                ],
                //'autoDisconnect' => true,
                //'maxConnections' => 5,
                'loop' => Reaction::$app->loop
            ];
            $this->_pgClient = new PgClient($config);
        }
        return $this->_pgClient;
    }