db_truncate

db_truncate($table, array $options = array()) Returns a new TruncateQuery object for the active database. Parameters string $table: The table from which to truncate. array $options: An array of options to control how the query operates. Return value \Drupal\Core\Database\Query\Truncate A new Truncate 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 truncate()

db_transaction

db_transaction($name = NULL, array $options = array()) Returns a new transaction object for the active database. Parameters string $name: Optional name of the transaction. array $options: An array of options to control how the transaction operates: target: The database target name. Return value \Drupal\Core\Database\Transaction A new Transaction 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 you

db_table_exists

db_table_exists($table) Checks if a table exists. Parameters string $table: The name of the table in drupal (no prefixing). Return value bool TRUE if the given table 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 tableExists() on it. For example, $injected_database->schema()->tableExists($table); See also \Drupal\Core\Database\Sc

db_set_active

db_set_active($key = 'default') Sets a new active database. Parameters $key: The key in the $databases array to set as the default database. Return value string|null The key of the formerly active database. Deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Use \Drupal\Core\Database\Database::setActiveConnection(). Related topics Database abstraction layer Allow the use of different database servers using the same code base. File core/includes/database.inc, line 337 Core sys

db_select

db_select($table, $alias = NULL, array $options = array()) Returns a new SelectQuery object for the active database. Parameters string|\Drupal\Core\Database\Query\SelectInterface $table: The base table for this query. May be a string or another SelectInterface object. If a SelectInterface object is passed, it will be used as a subselect. string $alias: (optional) The alias for the base table of this query. array $options: (optional) An array of options to control how the query operates. Return

db_rename_table

db_rename_table($table, $new_name) Renames a table. Parameters $table: The current name of the table to be renamed. $new_name: The new name for the table. 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 renameTable() on it. For example, $injected_database->schema()->renameTable($table, $new_name); See also \Drupal\Core\Database\Schema::renameTable() Relate

db_query_temporary

db_query_temporary($query, array $args = array(), array $options = array()) Executes a SELECT query string and saves the result set to a temporary table. The execution of the query string happens against the active database. Parameters string $query: The prepared SELECT statement query to run. Although it will accept both named and unnamed placeholders, named placeholders are strongly preferred as they are more self-documenting. array $args: An array of values to substitute into the query. If

db_query_range

db_query_range($query, $from, $count, array $args = array(), array $options = array()) Executes a query against the active database, restricted to a range. Parameters string $query: The prepared statement query to run. Although it will accept both named and unnamed placeholders, named placeholders are strongly preferred as they are more self-documenting. $from: The first record from the result set to return. $count: The number of records to return from the result set. array $args: An array of

db_query

db_query($query, array $args = array(), array $options = array()) Executes an arbitrary query string against the active database. Use this function for SELECT queries if it is just a simple query string. If the caller or other modules need to change the query, use db_select() instead. Do not use this function for INSERT, UPDATE, or DELETE queries. Those should be handled via db_insert(), db_update() and db_delete() respectively. Parameters string|\Drupal\Core\Database\StatementInterface $query

db_or

db_or() Returns a new DatabaseCondition, set to "OR" all conditions together. Return value \Drupal\Core\Database\Query\Condition A new Condition object, set to "OR" 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 OR conjunction: new Condition('OR'); See also \Drupal\Core\Database\Query\Condition Related topics Database abstraction layer Allow the use of different database servers u