/**
* Prepares a connection instance after its initialization.
*
* @param NodeConnectionInterface $connection Connection instance.
*/
protected function prepareConnection(NodeConnectionInterface $connection)
{
$parameters = $connection->getParameters();
if (isset($parameters->password)) {
$connection->addConnectCommand(new RawCommand(array('AUTH', $parameters->password)));
}
if (isset($parameters->database)) {
$connection->addConnectCommand(new RawCommand(array('SELECT', $parameters->database)));
}
}