Version

1.32 (checked in on 2008/12/03 at 16:32:21 by dries)

Description

Base classes for the database layer.

Functions

Namesort iconDescription
db_add_fieldAdd a new field to a table.
db_add_indexAdd an index.
db_add_primary_keyAdd a primary key.
db_add_unique_keyAdd a unique key.
db_affected_rowsDetermine the number of rows changed by the preceding query.
db_change_field
db_column_existsCheck if a column exists in the given table.
db_create_tableCreate a new table from a Drupal table definition.
db_deleteReturns a new DeleteQuery object for the active database.
db_distinct_fieldWraps the given table.field entry with a DISTINCT(). The wrapper is added to the SELECT list entry of the given query and the resulting query is returned. This function only applies the wrapper if a DISTINCT doesn't already exist in the query.
db_driverRetrieve the name of the currently active database driver, such as "mysql" or "pgsql".
db_drop_fieldDrop a field.
db_drop_indexDrop an index.
db_drop_primary_keyDrop the primary key.
db_drop_tableDrop a table.
db_drop_unique_keyDrop a unique key.
db_escape_tableRestrict a dynamic table, column or constraint name to safe characters.
db_fetch_array
db_fetch_object
db_field_namesReturn an array of field names from an array of key/index column specifiers.
db_field_set_defaultSet the default value for a field.
db_field_set_no_defaultSet a field to have no default value.
db_find_tablesFind all tables that are like the specified base table name.
db_insertReturns a new InsertQuery object for the active database.
db_is_activeDetermine if there is an active connection.
db_last_insert_idReturns the last insert id.
db_mergeReturns a new MergeQuery object for the active database.
db_placeholdersGenerate placeholders for an array of query arguments of a single type.
db_queryExecute an arbitrary query string against the active database.
db_query_rangeExecute an arbitrary query string against the active database, restricted to a specified range.
db_query_temporaryExecute a query string against the active database and save the result set to a temp table.
db_rename_tableRename a table.
db_result
db_rewrite_sqlRewrites node, taxonomy and comment queries. Use it for listing queries. Do not use FROM table1, table2 syntax, use JOIN instead.
db_selectReturns a new SelectQuery object for the active database.
db_set_activeSets a new active database.
db_table_existsCheck if a table exists.
db_type_mapThis maps a generic data type in combination with its data size to the engine-specific data type.
db_type_placeholderGiven a Schema API field type, return the correct %-placeholder.
db_updateReturns a new UpdateQuery object for the active database.
update_sqlPerform an SQL query and return success or failure.
_db_check_install_neededRedirect the user to the installation script if Drupal has not been installed yet (i.e., if no $databases array has been defined in the settings file) and we are not already there. Otherwise, do nothing.
_db_create_keys_sql
_db_error_pagePrints a themed maintenance page with the 'Site offline' text, adding the provided error message in the case of 'display_errors' set to on. Ends the page request; no return.
_db_query_process_argsBackward-compatibility utility.
_db_rewrite_sqlHelper function for db_rewrite_sql.