swoole / ext-postgresql

🐘 Coroutine-based client for PostgreSQL
65 stars 21 forks source link

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

Closed Dorkdomain closed 4 years ago

Dorkdomain commented 4 years ago

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()`

sy-records commented 4 years ago

It cannot be used like this, This option will be removed. https://github.com/swoole/library/pull/40

Dorkdomain commented 4 years ago

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