db_field_names

db_field_names($fields) Returns an array of field names from an array of key/index column specifiers. This is usually an identity function but if a key/index uses a column prefix specification, this function extracts just the name. Parameters array $fields: An array of key/index column specifiers. Return value array 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 it

db_field_exists

db_field_exists($table, $field) Checks if a column exists in the given table. Parameters $table: The name of the table in drupal (no prefixing). $field: The name of the field. Return value bool TRUE if the given column exists, otherwise FALSE. 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 fieldExists() on it. For example, $injected_database->schema()->fie

db_escape_table

db_escape_table($table) Restricts a dynamic table name to safe characters. Only keeps alphanumeric and underscores. Parameters $table: The table name to escape. Return value string The escaped table name as a string. 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 escapeTable() on it. For example, $injected_database->escapeTable($table); See also \Drupal\Core\Database\Connection::e

db_escape_field

db_escape_field($field) Restricts a dynamic column or constraint name to safe characters. Only keeps alphanumeric and underscores. Parameters string $field: The field name to escape. Return value string The escaped field name as a string. 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 escapeTable() on it. For example, $injected_database->escapeTable($table); See also \Drupal\Core\

db_drop_unique_key

db_drop_unique_key($table, $name) Drops a unique key. Parameters $table: The table to be altered. $name: The name of the key. Return value bool TRUE if the key was successfully dropped, FALSE if there was no key by that name to begin with. 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 dropUniqueKey() on it. For example, $injected_database->schema()->dropU

db_drop_table

db_drop_table($table) Drops a table. Parameters $table: The table to be dropped. 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 dropTable() on it. For example, $injected_database->schema()->dropTable($table); See also \Drupal\Core\Database\Schema::dropTable() Related topics Schema API API to handle database schemas. File core/includes/database.inc, line

db_drop_primary_key

db_drop_primary_key($table) Drops the primary key of a database table. Parameters $table: Name of the table to be altered. Return value bool TRUE if the primary key was successfully dropped, FALSE if there was no primary key on this table to begin with. 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 dropPrimaryKey() on it. For example, $injected_database->sch

db_drop_index

db_drop_index($table, $name) Drops an index. Parameters $table: The table to be altered. $name: The name of the index. Return value bool TRUE if the index was successfully dropped, FALSE if there was no index by that name to begin with. 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 dropIndex() on it. For example, $injected_database->schema()->dropIndex($t

db_drop_field

db_drop_field($table, $field) Drops a field. Parameters $table: The table to be altered. $field: The field to be dropped. Return value bool TRUE if the field was successfully dropped, FALSE if there was no field by that name to begin with. 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 dropField() on it. For example, $injected_database->schema()->dropField

db_driver

db_driver() Retrieves the name of the currently active database driver. Return value string The name of the currently active database driver. 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 driver() on it. For example, $injected_database->driver($string); See also \Drupal\Core\Database\Connection::driver() Related topics Database abstraction layer Allow the use of different database