You are here

function db_merge in Drupal 7

Same name and namespace in other branches
  1. 8 core/includes/database.inc \db_merge()

Returns a new MergeQuery object for the active database.

Parameters

$table: The table into which to merge.

$options: An array of options to control how the query operates.

Return value

MergeQuery A new MergeQuery object for this connection.

Related topics

1 call to db_merge()
system_update_7061 in modules/system/system.install
Migrate upload.module data to the newly created file field.

File

includes/database/database.inc, line 2551
Core systems for the database layer.

Code

function db_merge($table, array $options = array()) {
  if (empty($options['target']) || $options['target'] == 'slave') {
    $options['target'] = 'default';
  }
  return Database::getConnection($options['target'])
    ->merge($table, $options);
}