PostgresConnector
class PostgresConnector extends Connector implements ConnectorInterface (View source)
Traits
Properties
protected array | $options | The default PDO connection options. |
Methods
Determine if the given exception was caused by a lost connection.
Create a new PDO connection.
Create a new PDO connection instance.
Determine if the connection is persistent.
Handle an exception that occurred during connect execution.
Parse the Postgres "search_path" configuration value into an array.
Set the connection transaction isolation level.
Set the "search_path" on the database connection.
Format the search path for the DSN.
Set the application name on the connection.
Create a DSN string from a configuration.
Add the SSL options to the DSN.
Configure the synchronous_commit setting.
Details
protected bool
causedByLostConnection(Throwable $e)
Determine if the given exception was caused by a lost connection.
PDO
createConnection(string $dsn, array $config, array $options)
Create a new PDO connection.
protected PDO
createPdoConnection(string $dsn, string $username, string $password, array $options)
Create a new PDO connection instance.
protected bool
isPersistentConnection(array $options)
Determine if the connection is persistent.
protected PDO
tryAgainIfCausedByLostConnection(Throwable $e, string $dsn, string $username, string $password, array $options)
Handle an exception that occurred during connect execution.
array
getOptions(array $config)
Get the PDO options based on the configuration.
array
getDefaultOptions()
Get the default PDO connection options.
void
setDefaultOptions(array $options)
Set the default PDO connection options.
protected array
parseSearchPath(string|array|null $searchPath)
Parse the Postgres "search_path" configuration value into an array.
PDO
connect(array $config)
Establish a database connection.
protected void
configureIsolationLevel(PDO $connection, array $config)
Set the connection transaction isolation level.
protected void
configureEncoding(PDO $connection, array $config)
Set the connection character set and collation.
protected void
configureTimezone(PDO $connection, array $config)
Set the timezone on the connection.
protected void
configureSearchPath(PDO $connection, array $config)
Set the "search_path" on the database connection.
protected string
quoteSearchPath(array $searchPath)
Format the search path for the DSN.
protected void
configureApplicationName(PDO $connection, array $config)
Set the application name on the connection.
protected string
getDsn(array $config)
Create a DSN string from a configuration.
protected string
addSslOptions(string $dsn, array $config)
Add the SSL options to the DSN.
protected void
configureSynchronousCommit(PDO $connection, array $config)
Configure the synchronous_commit setting.