Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Schema.php

function Schema::extensionExists

Determines whether the PostgreSQL extension is created.

@internal

Parameters

string $name: The name of the extension.

Return value

bool Return TRUE when the extension is created, FALSE otherwise.

File

core/modules/pgsql/src/Driver/Database/pgsql/Schema.php, line 1091

Class

Schema
PostgreSQL implementation of \Drupal\Core\Database\Schema.

Namespace

Drupal\pgsql\Driver\Database\pgsql

Code

public function extensionExists($name) : bool {
    return (bool) $this->connection
        ->query('SELECT installed_version FROM pg_available_extensions WHERE name = :name', [
        ':name' => $name,
    ])
        ->fetchField();
}
RSS feed
Powered by Drupal