PostgreSQLAdapter
class PostgreSQLAdapter extends AbstractConnection (View source)
Constants
| PORT |
Default PORT |
Properties
| protected ?string | $name | The connexion nane |
|
| protected array | $config | The configuration definition |
from AbstractConnection |
| protected int | $fetch | The PDO fetch mode |
from AbstractConnection |
| protected PDO | $write_pdo | The write (primary) PDO instance |
from AbstractConnection |
| protected PDO | $read_pdo | The read (replica) PDO instance |
from AbstractConnection |
| protected array | $write_config | The configuration used to build the write connection |
from AbstractConnection |
| protected ?array | $read_config | The configuration used to build the read connection, or null when the connection is not split (reads use write). |
from AbstractConnection |
Methods
Validate the connection configuration.
Retrieves the write (primary) connection, building it lazily
Retrieves the read (replica) connection, building it lazily.
Whether the write connection has already been established.
Executes PDOStatement::bindValue on an instance of
Details
__construct(array $config)
AbstractConnection constructor.
Splits the connection configuration into a write (primary) configuration and an optional read (replica) configuration.
protected void
validateConfig(array $config)
Validate the connection configuration.
protected PDO
makePdo(array $config)
Build a PDO instance from the given configuration.
void
connection()
Build (eagerly) the write connection.
Kept for backward compatibility with callers that expect to (re)establish the connection explicitly.
PDO
getConnection()
Retrieves the connection (the write/primary connection)
PDO
getWriteConnection()
Retrieves the write (primary) connection, building it lazily
PDO
getReadConnection()
Retrieves the read (replica) connection, building it lazily.
Falls back to the write connection when the connection is not split.
bool
hasWriteConnection()
Whether the write connection has already been established.
Used to inspect transaction state without forcing a connection open.
void
setConnection(PDO $pdo)
Set the connection (the write/primary connection)
string
getName()
Returns the name of the connection
void
setFetchMode(int $fetch)
Sets the data recovery mode.
array
getConfig()
Retrieves the configuration
string
getTablePrefix()
Retrieves the table prefix
string
getCharset()
Retrieves the type of encoding
string
getCollation()
Retrieves the define Collation
string
getPdoDriver()
Get the drive that PDO run on
PDOStatement
bind(PDOStatement $pdo_statement, array $bindings = [])
Executes PDOStatement::bindValue on an instance of