db_merge

  1. drupal
    1. 8
    2. 7
Versions
7 – 8 db_merge($table, array $options = array())

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

▾ 41 functions call db_merge()

actions_save in includes/actions.inc
Saves an action and its user-supplied parameter values to the database.
aggregator_refresh in modules/aggregator/aggregator.module
Checks a news feed for new items.
aggregator_remove in modules/aggregator/aggregator.module
Removes all items from a feed.
aggregator_save_category in modules/aggregator/aggregator.module
Add/edit/delete aggregator categories.
aggregator_save_item in modules/aggregator/aggregator.processor.inc
Add/edit/delete an aggregator item.
block_add_block_form_submit in modules/block/block.admin.inc
Form submission handler for the add block form.
block_admin_configure_submit in modules/block/block.admin.inc
Form submission handler for the block configuration form.
contact_update_7002 in modules/contact/contact.install
Enable the 'access user contact forms' for registered users by default.
dashboard_update in modules/dashboard/dashboard.module
Set the new weight of each region according to the drag-and-drop order.
DatabaseMergeTestCase::testInvalidMerge in modules/simpletest/tests/database_test.test
Test that an invalid merge query throws an exception like it is supposed to.
DatabaseMergeTestCase::testMergeInsert in modules/simpletest/tests/database_test.test
Confirm that we can merge-insert a record successfully.
DatabaseMergeTestCase::testMergeInsertWithoutUpdate in modules/simpletest/tests/database_test.test
Test that we can merge-insert without any update fields.
DatabaseMergeTestCase::testMergeUpdate in modules/simpletest/tests/database_test.test
Confirm that we can merge-update a record successfully.
DatabaseMergeTestCase::testMergeUpdateExcept in modules/simpletest/tests/database_test.test
Confirm that we can merge-update a record successfully, with different insert and update.
DatabaseMergeTestCase::testMergeUpdateExplicit in modules/simpletest/tests/database_test.test
Confirm that we can merge-update a record successfully, with alternate replacement.
DatabaseMergeTestCase::testMergeUpdateExpression in modules/simpletest/tests/database_test.test
Confirm that we can merge-update a record successfully, with expressions.
DatabaseMergeTestCase::testMergeUpdateWithoutUpdate in modules/simpletest/tests/database_test.test
Confirm that we can merge-update without any update fields.
DrupalDatabaseCache::set in includes/cache.inc
Store data in the persistent cache.
file_usage_add in includes/file.inc
Records that a module is using a file.
filter_format_save in modules/filter/filter.module
Save a text format object to the database.
hook_user_role_update in modules/user/user.api.php
Inform other modules that a user role has been updated.
menu_save in modules/menu/menu.module
Save a custom menu.
node_tag_new in modules/node/node.module
Update the 'last viewed' timestamp of the specified node for current user.
poll_update in modules/poll/poll.module
Implements hook_update().
profile_save_profile in modules/profile/profile.module
rdf_mapping_save in modules/rdf/rdf.module
Saves an RDF mapping to the database.
search_index in modules/search/search.module
Update the full-text search index for a particular item.
search_update_totals in modules/search/search.module
Updates the {search_total} database table.
shortcut_set_assign_user in modules/shortcut/shortcut.module
Assigns a user to a particular shortcut set.
statistics_exit in modules/statistics/statistics.module
Implements hook_exit().
system_update_7061 in modules/system/system.install
Migrate upload.module data to the newly created file field.
taxonomy_test_taxonomy_term_update in modules/simpletest/tests/taxonomy_test.module
Implements hook_taxonomy_term_update().
user_role_grant_permissions in modules/user/user.module
Grant permissions to a user role.
user_set_authmaps in modules/user/user.module
Save mappings of which external authentication module(s) authenticated a user. Maps external usernames to user ids in the users table.
variable_set in includes/bootstrap.inc
Sets a persistent variable.
_drupal_session_write in includes/session.inc
Writes an entire session to the database (internal use only).
_node_access_test_node_write in modules/node/tests/node_access_test.module
Helper for node insert/update.
_registry_parse_files in includes/registry.inc
Parse all files that have changed since the registry was last built, and save their function and class listings.
_tracker_add in modules/tracker/tracker.module
Update indexing tables when a node is added, updated or commented on.
_update_7000_user_role_grant_permissions in modules/user/user.install
Utility function: grant a set of permissions to a role during update.
_update_cache_set in modules/update/update.module
Store data in the private update status cache table.

Code

includes/database/database.inc, line 2410

<?php
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);
}
?>