swoole/ext-postgresql

when i use PDOPool, it throw exception invalid connection option "charset"

Dorkdomain opened this issue · 2 comments

code:
$pool = new PDOPool((new PDOConfig) ->withDriver(PDOConfig::DRIVER_PGSQL) ->withHost('127.0.0.1') ->withPort(5432) ->withDbName('postgres') ->withUsername('postgres') ->withPassword('password') ->withCharset('utf8') );

exception:
thrown in @swoole-src/library/core/Database/PDOPool.php on line 44 PHP Fatal Error 'yii\base\ErrorException' with message 'Uncaught PDOException: SQLSTATE[08006] [7] invalid connection option "charset" in @swoole-src/library/core/Database/PDOPool.php:44 Stack trace: #0 @swoole-src/library/core/Database/PDOPool.php(44): PDO->__construct('pgsql:host=127....', 'postgres', 'password', Array) #1 @swoole-src/library/core/Database/PDOProxy.php(41): Swoole\Database\PDOPool->Swoole\Database\{closure}() #2 @swoole-src/library/core/ConnectionPool.php(89): Swoole\Database\PDOProxy->__construct(Object(Closure)) #3 @swoole-src/library/core/ConnectionPool.php(58): Swoole\ConnectionPool->make()

It cannot be used like this, This option will be removed. swoole/library#40

It cannot be used like this, This option will be removed. swoole/library#40