db_delete

db_delete($table, array $options = array()) Returns a new DeleteQuery object for the active database. Parameters string $table: The table from which to delete. array $options: An array of options to control how the query operates. Return value \Drupal\Core\Database\Query\Delete A new Delete object for this connection. Deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call delete() on it. For e

db_create_table

db_create_table($name, $table) Creates a new table from a Drupal table definition. Parameters string $name: The name of the table to create. array $table: A Schema API table definition array. Deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call createTable() on it. For example, $injected_database->schema()->createTable($name, $table); See also \Drupal\Core\Data

db_condition

db_condition($conjunction) Returns a new DatabaseCondition, set to the specified conjunction. Internal API function call. The db_and(), db_or(), and db_xor() functions are preferred. Parameters string $conjunction: The conjunction to use for query conditions (AND, OR or XOR). Return value \Drupal\Core\Database\Query\Condition A new Condition object, set to the specified conjunction. Deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Create a \Drupal\Core\Database\Query\Conditio

db_close

db_close(array $options = array()) Closes the active database connection. Parameters array $options: An array of options to control which connection is closed. Only the target key has any meaning in this case. Deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Use \Drupal\Core\Database\Database::closeConnection($target). See also \Drupal\Core\Database\Database::closeConnection() Related topics Database abstraction layer Allow the use of different database servers using the sam

db_change_field

db_change_field($table, $field, $field_new, $spec, $keys_new = array()) Changes a field definition. IMPORTANT NOTE: To maintain database portability, you have to explicitly recreate all indices and primary keys that are using the changed field. That means that you have to drop all affected keys and indexes with db_drop_{primary_key,unique_key,index}() before calling db_change_field(). To recreate the keys and indices, pass the key definitions as the optional $keys_new argument directly to db_ch

db_and

db_and() Returns a new DatabaseCondition, set to "AND" all conditions together. Return value \Drupal\Core\Database\Query\Condition A new Condition object, set to "AND" all conditions together. Deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying an AND conjunction: new Condition('AND'); See also \Drupal\Core\Database\Query\Condition Related topics Database abstraction layer Allow the use of different database serv

db_add_unique_key

db_add_unique_key($table, $name, $fields) Adds a unique key. Parameters $table: The table to be altered. $name: The name of the key. array $fields: An array of field names. Deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addUniqueKey() on it. For example, $injected_database->schema()->addUniqueKey($table, $name, $fields); See also \Drupal\Core\Database\Sch

db_add_primary_key

db_add_primary_key($table, $fields) Adds a primary key to a database table. Parameters $table: Name of the table to be altered. $fields: Array of fields for the primary key. Deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addPrimaryKey() on it. For example, $injected_database->schema()->addPrimaryKey($table, $fields); See also \Drupal\Core\Database\Schema:

db_add_index

db_add_index($table, $name, $fields, array $spec) Adds an index. Parameters $table: The table to be altered. $name: The name of the index. array $fields: An array of field names. array $spec: The table specification of the table to be altered, as taken from a schema definition. See \Drupal\Core\Database\Schema::addIndex() for how to obtain this specification. Deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get a database connection injected into your service from the

db_add_field

db_add_field($table, $field, $spec, $keys_new = array()) Adds a new field to a table. Parameters $table: Name of the table to be altered. $field: Name of the field to be added. array $spec: The field specification array, as taken from a schema definition. The specification may also contain the key 'initial'; the newly-created field will be set to the value of the key in all rows. This is most useful for creating NOT NULL columns with no default value in existing tables. array $keys_new: (optio