Change record status: 
Project: 
Introduced in branch: 
8.0.x
Introduced in version: 
8.0-alpha10
Description: 
  1. The Drupal\Core\Database\Merge::key() method has been renamed to Merge::keys().
  2. The Drupal\Core\Database\Merge::key() method accepts a single pair of key and value now.

Drupal 10 update

Beginning with Drupal 10.2, the use of Merge::key() with an array of multiple values will cause a deprecation warning.

Drupal 7

// Single primary key.
db_merge('mytable_single_primary_key')
  ->key(array('id' => $id))
  ->fields(array('title' => $title))
  ->execute();

// Multiple/composite primary key.
db_merge('mytable_multiple_primary_key')
  ->key(array(
    'id' => $id,
    'vid' => $vid,
  ))
  ->fields(array('title' => $title))
  ->execute();

Drupal 8

// Single primary key.
Database::getConnection()->merge('mytable_single_primary_key')
  // First argument is the key name, second is the value.
  ->key('id', $id)
  ->fields(array('title' => $title))
  ->execute();

// Multiple/composite primary key.
Database::getConnection()->merge('mytable_multiple_primary_key')
  // Identical to key() previously, just plural now.
  ->keys(array(
    'id' => $id,
    'vid' => $vid,
  ))
  ->fields(array('title' => $title))
  ->execute();
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done