database.inc

Version 1.81 (checked in on 2009/10/18 at 06:56:24 by webchick)

Base classes for the database layer.

Functions

NameDescription
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_change_fieldChange a field definition.
db_closeCloses the active database connection.
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_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_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_ignore_slaveHelper function to get duration lag from variable and set the session variable that contains the lag.
db_insertReturns a new InsertQuery object for the active database.
db_is_activeDetermine if there is an active connection.
db_mergeReturns a new MergeQuery object for the active database.
db_next_idRetrieves a unique id.
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_selectReturns a new SelectQuery object for the active database.
db_set_activeSets a new active database.
db_table_existsCheck 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_type_mapThis maps a generic data type in combination with its data size to the engine-specific data type.
db_updateReturns a new UpdateQuery object for the active database.
_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.
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.