function Update10101::sequenceExists

Same name in other branches
  1. 10 core/modules/pgsql/src/Update10101.php \Drupal\pgsql\Update10101::sequenceExists()

Checks if a sequence exists.

Parameters

string $name: The fully-qualified sequence name.

Return value

bool TRUE if the sequence exists by the name.

See also

\Drupal\pgsql\Driver\Database\pgsql\Connection::makeSequenceName()

1 call to Update10101::sequenceExists()
Update10101::update in core/modules/pgsql/src/Update10101.php
Update *all* existing sequences to include the owner tables.

File

core/modules/pgsql/src/Update10101.php, line 227

Class

Update10101
An update class for sequence ownership.

Namespace

Drupal\pgsql

Code

private function sequenceExists(string $name) : bool {
    return (bool) \Drupal::database()->query("SELECT c.relname FROM pg_class as c WHERE c.relkind = 'S' AND c.relname = :name", [
        ':name' => $name,
    ])
        ->fetchField();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.