Change record status: 
Project: 
Introduced in branch: 
8.0.x
Description: 

The mentioned functions where removed from Drupal 8. Developers should use \Drupal::database()->merge(), the Entity API or one of the provided services, like key value.

7.x

$ref_count_record = (object) array(
  'count' => $count,
  'type' => $type,
  'id' => $id,
);
drupal_write_record('example_deleted_entity_statistics', $ref_count_record);

8.x

// Using a merge query in a custom table.
\Drupal::database()->merge('example_deleted_entity_statistics')
  ->key(array('type' => $type, 'id' => $id))
  ->fields(array('count' => $count))
  ->execute();
// Store the data in a key value collection.
\Drupal::keyValue('example_deleted_entity_statistics')->set($type . '.' . $id, $count);
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