3 namespace MediaWiki\Installer
;
5 use MediaWiki\Status\Status
;
6 use Wikimedia\Rdbms\IDatabase
;
8 class PostgresDatabaseCreator
extends NetworkedDatabaseCreator
{
9 protected function existsInConnection( IDatabase
$conn, $database ) {
10 return (bool)$conn->selectField( 'pg_catalog.pg_database', '1',
11 [ 'datname' => $database ], __METHOD__
);
14 protected function createInConnection( IDatabase
$conn, $database ): Status
{
15 $safedb = $conn->addIdentifierQuotes( $database );
16 $conn->query( "CREATE DATABASE $safedb", __METHOD__
);
17 return Status
::newGood();