[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/includes/ -> database.pgsql.inc (summary)

(no description)

File Size: 928 lines (27 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 includes/unicode.inc

Defines 41 functions

  db_status_report()
  db_version()
  db_connect()
  db_query()
  _db_query()
  db_fetch_object()
  db_fetch_array()
  db_result()
  db_error()
  db_last_insert_id()
  db_affected_rows()
  db_query_range()
  db_query_temporary()
  db_encode_blob()
  db_decode_blob()
  db_escape_string()
  db_lock_table()
  db_unlock_tables()
  db_table_exists()
  db_column_exists()
  db_check_setup()
  db_type_map()
  db_create_table_sql()
  _db_create_index_sql()
  _db_create_key_sql()
  _db_create_keys()
  _db_process_field()
  _db_create_field_sql()
  db_rename_table()
  db_drop_table()
  db_add_field()
  db_drop_field()
  db_field_set_default()
  db_field_set_no_default()
  db_add_primary_key()
  db_drop_primary_key()
  db_add_unique_key()
  db_drop_unique_key()
  db_add_index()
  db_drop_index()
  db_change_field()

Functions
Functions that are not part of a class:

db_status_report()   X-Ref
Report database status.


db_version()   X-Ref
Returns the version of the database server currently in use.

return: Database server version

db_connect($url)   X-Ref
Initialize a database connection.


db_query($query)   X-Ref
Runs a basic query in the active database.

User-supplied arguments to the query should be passed in as separate
parameters so that they can be properly escaped to avoid SQL injection
attacks.

param: $query
param: ...
return:

_db_query($query, $debug = 0)   X-Ref
Helper function for db_query().


db_fetch_object($result)   X-Ref
Fetch one result row from the previous query as an object.

param: $result
return:

db_fetch_array($result)   X-Ref
Fetch one result row from the previous query as an array.

param: $result
return:

db_result($result)   X-Ref
Return an individual result field from the previous query.

Only use this function if exactly one field is being selected; otherwise,
use db_fetch_object() or db_fetch_array().

param: $result
return:

db_error()   X-Ref
Determine whether the previous query caused an error.


db_last_insert_id($table, $field)   X-Ref
Returns the last insert id. This function is thread safe.

param: $table
param: $field

db_affected_rows()   X-Ref
Determine the number of rows changed by the preceding query.


db_query_range($query)   X-Ref
Runs a limited-range query in the active database.

Use this as a substitute for db_query() when a subset of the query
is to be returned.
User-supplied arguments to the query should be passed in as separate
parameters so that they can be properly escaped to avoid SQL injection
attacks.

param: $query
param: ...
param: $from
param: $count
return:

db_query_temporary($query)   X-Ref
Runs a SELECT query and stores its results in a temporary table.

Use this as a substitute for db_query() when the results need to stored
in a temporary table. Temporary tables exist for the duration of the page
request.
User-supplied arguments to the query should be passed in as separate parameters
so that they can be properly escaped to avoid SQL injection attacks.

Note that if you need to know how many results were returned, you should do
a SELECT COUNT(*) on the temporary table afterwards. db_affected_rows() does
not give consistent result across different database types in this case.

param: $query
param: ...
param: $table
return:

db_encode_blob($data)   X-Ref
Returns a properly formatted Binary Large OBject value.
In case of PostgreSQL encodes data for insert into bytea field.

param: $data
return:

db_decode_blob($data)   X-Ref
Returns text from a Binary Large OBject value.
In case of PostgreSQL decodes data after select from bytea field.

param: $data
return:

db_escape_string($text)   X-Ref
Prepare user input for use in a database query, preventing SQL injection attacks.
Note: This function requires PostgreSQL 7.2 or later.


db_lock_table($table)   X-Ref
Lock a table.
This function automatically starts a transaction.


db_unlock_tables()   X-Ref
Unlock all locked tables.
This function automatically commits a transaction.


db_table_exists($table)   X-Ref
Check if a table exists.

param: $table
return:

db_column_exists($table, $column)   X-Ref
Check if a column exists in the given table.

param: $table
param: $column
return:

db_check_setup()   X-Ref
Verify if the database is set up correctly.


db_type_map()   X-Ref
This maps a generic data type in combination with its data size
to the engine-specific data type.


db_create_table_sql($name, $table)   X-Ref
Generate SQL to create a new table from a Drupal schema definition.

param: $name
param: $table
return:

_db_create_index_sql($table, $name, $fields)   X-Ref
No description

_db_create_key_sql($fields)   X-Ref
No description

_db_create_keys(&$ret, $table, $new_keys)   X-Ref
No description

_db_process_field($field)   X-Ref
Set database-engine specific properties for a field.

param: $field

_db_create_field_sql($name, $spec)   X-Ref
Create an SQL string for a field to be used in table creation or alteration.

Before passing a field out of a schema definition into this function it has
to be processed by _db_process_field().

param: $name
param: $spec

db_rename_table(&$ret, $table, $new_name)   X-Ref
Rename a table.

param: $ret
param: $table
param: $new_name

db_drop_table(&$ret, $table)   X-Ref
Drop a table.

param: $ret
param: $table

db_add_field(&$ret, $table, $field, $spec, $new_keys = array()   X-Ref
Add a new field to a table.

param: $ret
param: $table
param: $field
param: $spec
param: $new_keys

db_drop_field(&$ret, $table, $field)   X-Ref
Drop a field.

param: $ret
param: $table
param: $field

db_field_set_default(&$ret, $table, $field, $default)   X-Ref
Set the default value for a field.

param: $ret
param: $table
param: $field
param: $default

db_field_set_no_default(&$ret, $table, $field)   X-Ref
Set a field to have no default value.

param: $ret
param: $table
param: $field

db_add_primary_key(&$ret, $table, $fields)   X-Ref
Add a primary key.

param: $ret
param: $table
param: $fields

db_drop_primary_key(&$ret, $table)   X-Ref
Drop the primary key.

param: $ret
param: $table

db_add_unique_key(&$ret, $table, $name, $fields)   X-Ref
Add a unique key.

param: $ret
param: $table
param: $name
param: $fields

db_drop_unique_key(&$ret, $table, $name)   X-Ref
Drop a unique key.

param: $ret
param: $table
param: $name

db_add_index(&$ret, $table, $name, $fields)   X-Ref
Add an index.

param: $ret
param: $table
param: $name
param: $fields

db_drop_index(&$ret, $table, $name)   X-Ref
Drop an index.

param: $ret
param: $table
param: $name

db_change_field(&$ret, $table, $field, $field_new, $spec, $new_keys = array()   X-Ref
Change a field definition.

IMPORTANT NOTE: To maintain database portability, you have to explicitly
recreate all indices and primary keys that are using the changed field.

That means that you have to drop all affected keys and indexes with
db_drop_{primary_key,unique_key,index}() before calling db_change_field().
To recreate the keys and indices, pass the key definitions as the
optional $new_keys argument directly to db_change_field().

For example, suppose you have:
param: $ret
param: $table
param: $field
param: $field_new
param: $spec
param: $new_keys



Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7