function Update10101::getSequenceName

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

Retrieves a sequence name that is owned by the table and column.

Parameters

string $table: A table name that is not prefixed or quoted.

string $column: The column name.

Return value

string|null The name of the sequence or NULL if it does not exist.

1 call to Update10101::getSequenceName()
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 207

Class

Update10101
An update class for sequence ownership.

Namespace

Drupal\pgsql

Code

public function getSequenceName(string $table, string $column) : ?string {
    return $this->connection
        ->query("SELECT pg_get_serial_sequence(:table, :column)", [
        ':table' => $this->connection
            ->getPrefix() . $table,
        ':column' => $column,
    ])
        ->fetchField();
}

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