database.inc

Version 1.147 (checked in on 2010/12/22 at 07:48:56 by webchick)

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.

Classes

NameDescription
DatabasePrimary front-controller for the database system.
DatabaseConnectionBase Database API class.
DatabaseConnectionNotDefinedExceptionException thrown if an undefined database connection is requested.
DatabaseDriverNotSpecifiedExceptionException thrown if no driver is specified for a database connection.
DatabaseStatementBaseDefault implementation of DatabaseStatementInterface.
DatabaseStatementEmptyEmpty implementation of a database statement.
DatabaseTransactionA wrapper class for creating and managing database transactions.
DatabaseTransactionCommitFailedExceptionException thrown when a commit() function fails.
DatabaseTransactionExplicitCommitNotAllowedExceptionException to deny attempts to explicitly manage transactions.
DatabaseTransactionNameNonUniqueExceptionException thrown when a savepoint or transaction name occurs twice.
DatabaseTransactionNoActiveExceptionException for when popTransaction() is called with no active transaction.
FieldsOverlapExceptionException thrown if an insert query specifies a field twice.
InvalidMergeQueryExceptionException thrown for merge queries that do not make semantic sense.
NoFieldsExceptionException thrown if an insert query doesn't specify insert or default fields.

Interfaces

NameDescription
DatabaseStatementInterfaceA prepared statement.

Functions & methods

NameDescription
db_add_fieldAdds a new field to a table.
db_add_indexAdds an index.
db_add_primary_keyAdds a primary key to a database table.
db_add_unique_keyAdds a unique key.
db_andReturns a new DatabaseCondition, set to "AND" all conditions together.
db_change_fieldChanges a field definition.
db_closeCloses the active database connection.
db_conditionReturns a new DatabaseCondition, set to the specified conjunction.
db_create_tableCreates a new table from a Drupal table definition.
db_deleteReturns a new DeleteQuery object for the active database.
db_driverRetrieves the name of the currently active database driver.
db_drop_fieldDrops a field.
db_drop_indexDrops an index.
db_drop_primary_keyDrops the primary key of a database table.
db_drop_tableDrops a table.
db_drop_unique_keyDrops a unique key.
db_escape_fieldRestricts a dynamic column or constraint name to safe characters.
db_escape_tableRestricts a dynamic table name to safe characters.
db_field_existsChecks if a column exists in the given table.
db_field_namesReturns an array of field names from an array of key/index column specifiers.
db_field_set_defaultSets the default value for a field.
db_field_set_no_defaultSets a field to have no default value.
db_find_tablesFinds all tables that are like the specified base table name.
db_ignore_slaveSets a session variable specifying the lag time for ignoring a slave server.
db_index_existsChecks if an index exists in the given table.
db_insertReturns a new InsertQuery object for the active database.
db_likeEscapes characters that work as wildcard characters in a LIKE pattern.
db_mergeReturns a new MergeQuery object for the active database.
db_next_idRetrieves a unique id.
db_orReturns a new DatabaseCondition, set to "OR" all conditions together.
db_queryExecutes an arbitrary query string against the active database.
db_query_rangeExecutes a query against the active database, restricted to a range.
db_query_temporaryExecutes a query string and saves the result set to a temporary table.
db_rename_tableRenames a table.
db_selectReturns a new SelectQuery object for the active database.
db_set_activeSets a new active database.
db_table_existsChecks if a table exists.
db_transactionReturns a new transaction object for the active database.
db_truncateReturns a new TruncateQuery object for the active database.
db_updateReturns a new UpdateQuery object for the active database.
db_xorReturns a new DatabaseCondition, set to "XOR" all conditions together.
_db_create_keys_sql