1. 1.20.x drivers/database_mysql/database.inc
  2. 1.20.x includes/database/database.inc

Core systems for the database layer.

Classes required for basic functioning of the database system should be placed in this file. All utility functions should also be placed in this file only, as they cannot auto-load the way classes can.




Namesort descending Description
db_add_field Adds a new field to a table.
db_add_index Adds an index.
db_add_primary_key Adds a primary key to a database table.
db_add_unique_key Adds a unique key.
db_and Returns a new DatabaseCondition, set to "AND" all conditions together.
db_change_field Changes a field definition.
db_close Closes the active database connection.
db_condition Returns a new DatabaseCondition, set to the specified conjunction.
db_create_table Creates a new table from a Backdrop table definition.
db_delete Returns a new DeleteQuery object for the active database.
db_driver Retrieves the name of the currently active database driver.
db_drop_field Drops a field.
db_drop_index Drops an index.
db_drop_primary_key Drops the primary key of a database table.
db_drop_table Drops a table.
db_drop_unique_key Drops a unique key.
db_escape_field Restricts a dynamic column or constraint name to safe characters.
db_escape_table Restricts a dynamic table name to safe characters.
db_field_exists Checks if a column exists in the given table.
db_field_names Returns an array of field names from an array of key/index column specifiers.
db_field_set_default Sets the default value for a field.
db_field_set_no_default Sets a field to have no default value.
db_find_prefixed_tables Finds all tables that are like the specified base table name. This is a backport of the change made to db_find_tables in Drupal 8 to work with virtual, un-prefixed table names. The original function is retained for Backwards Compatibility.
db_find_tables Finds all tables that are like the specified base table name.
db_ignore_slave Sets a session variable specifying the lag time for ignoring a slave server.
db_index_exists Checks if an index exists in the given table.
db_insert Returns a new InsertQuery object for the active database.
db_like Escapes characters that work as wildcard characters in a LIKE pattern.
db_merge Returns a new MergeQuery object for the active database.
db_next_id Retrieves a unique id.
db_or Returns a new DatabaseCondition, set to "OR" all conditions together.
db_parse_url Parses the database URL.
db_query Executes an arbitrary query string against the active database.
db_query_range Executes a query against the active database, restricted to a range.
db_query_temporary Executes a SELECT query string and saves the result set to a temporary table.
db_rename_table Renames a table.
db_select Returns a new SelectQuery object for the active database.
db_set_active Sets a new active database.
db_table_exists Checks if a table exists.
db_transaction Returns a new transaction object for the active database.
db_truncate Returns a new TruncateQuery object for the active database.
db_update Returns a new UpdateQuery object for the active database.
db_xor Returns a new DatabaseCondition, set to "XOR" all conditions together.


Namesort descending Description
Database Primary front-controller for the database system.
DatabaseConnection Base Database API class.
DatabaseConnectionNotDefinedException Exception thrown if an undefined database connection is requested.
DatabaseDriverNotSpecifiedException Exception thrown if no driver is specified for a database connection.
DatabaseNotFoundException Exception thrown when the specified database cannot be found.
DatabaseStatementBase Default implementation of DatabaseStatementInterface.
DatabaseStatementEmpty Empty implementation of a database statement.
DatabaseTransaction A wrapper class for creating and managing database transactions.
DatabaseTransactionCommitFailedException Exception thrown when a commit() function fails.
DatabaseTransactionExplicitCommitNotAllowedException Exception to deny attempts to explicitly manage transactions.
DatabaseTransactionNameNonUniqueException Exception thrown when a savepoint or transaction name occurs twice.
DatabaseTransactionNoActiveException Exception for when popTransaction() is called with no active transaction.
DatabaseTransactionOutOfOrderException Exception thrown when a rollback() resulted in other active transactions being rolled-back.
FieldsOverlapException Exception thrown if an insert query specifies a field twice.
InvalidMergeQueryException Exception thrown for merge queries that do not make semantic sense.
NoFieldsException Exception thrown if an insert query doesn't specify insert or default fields.


Namesort descending Description
DatabaseStatementInterface Represents a prepared statement.