Commit 36fa4101 authored by Steve Müller's avatar Steve Müller

add charset option for pdo_pgsql driver

add charset option for pdo_pgsql driver
parent c5043750
......@@ -156,6 +156,8 @@ pdo\_pgsql
- ``host`` (string): Hostname of the database to connect to.
- ``port`` (integer): Port of the database to connect to.
- ``dbname`` (string): Name of the database/schema to connect to.
- ``charset`` (string): The charset used when connecting to the
database.
- ``sslmode`` (string): Determines whether or with what priority
a SSL TCP/IP connection will be negotiated with the server.
See the list of available modes:
......
......@@ -71,6 +71,10 @@ class Driver implements \Doctrine\DBAL\Driver, ExceptionConverterDriver
$dsn .= 'dbname=' . $params['dbname'] . ' ';
}
if (isset($params['charset'])) {
$dsn .= "options='--client_encoding=" . $params['charset'] . "'";
}
if (isset($params['sslmode'])) {
$dsn .= 'sslmode=' . $params['sslmode'] . ' ';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment