function Merge::isNativeMerge

Determines whether the query executes as a single native MERGE statement.

The native MERGE statement can only be used when the condition targets the merge table itself and when there is something to insert. In all other cases the generic SELECT + INSERT/UPDATE emulation is used.

Return value

bool TRUE if the query executes as a native MERGE statement, FALSE if it uses the generic emulation.

File

core/modules/pgsql/src/Driver/Database/pgsql/Merge.php, line 79

Class

Merge
PostgreSQL implementation of \Drupal\Core\Database\Query\Merge.

Namespace

Drupal\pgsql\Driver\Database\pgsql

Code

protected function isNativeMerge() : bool {
  return $this->conditionTable === $this->table && ($this->insertFields || $this->defaultFields);
}

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