Class Database_Static_sqlite

Description

Located in /sources/database/sqlite.php (line 39)


	
			
Method Summary
void db_change_primary_key (ID_TEXT $table_name, array $new_key, array $db)
void db_create_index (ID_TEXT $table_name, ID_TEXT $index_name, string $_fields, array $db)
void db_create_table (ID_TEXT $table_name, array $fields, array $db)
string db_default_user ()
void db_drop_if_exists (ID_TEXT $table, array $db)
boolean db_empty_is_null ()
string db_encode_like (string $pattern)
string db_escape_string (string $string)
?array db_get_connection (boolean $persistent, string $db_name, string $db_host, string $db_user, string $db_password, [boolean $fail_ok = false])
integer db_get_first_id ()
array db_get_query_rows (resource $results, [?integer $start = NULL])
boolean db_has_full_text (array $db)
?mixed db_query (string $query, array $db, [?integer $max = NULL], [?integer $start = NULL], [boolean $fail_ok = false], [boolean $get_insert_id = false])
string db_string_equal_to (ID_TEXT $attribute, string $compare)
string db_string_not_equal_to (ID_TEXT $attribute, string $compare)
Methods
db_change_primary_key (line 83)

Change the primary key of a table.

void db_change_primary_key (ID_TEXT $table_name, array $new_key, array $db)
  • ID_TEXT $table_name: The name of the table to create the index on
  • array $new_key: A list of fields to put in the new key
  • array $db: The DB connection to make on
db_close_connections (line 246)

Close the database connections. We don't really need to close them (will close at exit), just disassociate so we can refresh them.

void db_close_connections ()
db_create_index (line 70)

Create a table index.

void db_create_index (ID_TEXT $table_name, ID_TEXT $index_name, string $_fields, array $db)
  • ID_TEXT $table_name: The name of the table to create the index on
  • ID_TEXT $index_name: The index name (not really important at all)
  • string $_fields: Part of the SQL query: a comma-separated list of fields to use on the index
  • array $db: The DB connection to make on
db_create_table (line 138)

Create a new table.

void db_create_table (ID_TEXT $table_name, array $fields, array $db)
  • ID_TEXT $table_name: The table name
  • array $fields: A map of field names to ocPortal field types (with *#? encodings)
  • array $db: The DB connection to make on
db_default_password (line 57)

Get the default password for making db connections (used by the installer as a default).

  • return: The default password for db connections
string db_default_password ()
db_default_user (line 47)

Get the default user for making db connections (used by the installer as a default).

  • return: The default user for db connections
string db_default_user ()
db_drop_if_exists (line 217)

Delete a table.

void db_drop_if_exists (ID_TEXT $table, array $db)
  • ID_TEXT $table: The table name
  • array $db: The DB connection to delete on
db_empty_is_null (line 206)

This function is internal to the database system, allowing SQL statements to be build up appropriately. Some databases require IS NULL to be used to check for blank strings.

  • return: Whether a blank string IS NULL
boolean db_empty_is_null ()
db_encode_like (line 238)

Encode a LIKE string comparision fragement for the database system. The pattern is a mixture of characters and ? and % wilcard symbols.

  • return: The encoded pattern
string db_encode_like (string $pattern)
  • string $pattern: The pattern
db_escape_string (line 326)

Escape a string so it may be inserted into a query. If SQL statements are being built up and passed using db_query then it is essential that this is used for security reasons. Otherwise, the abstraction layer deals with the situation.

  • return: The escaped string
string db_escape_string (string $string)
  • string $string: The string
db_get_connection (line 270)

Get a database connection. This function shouldn't be used by you, as a connection to the database is established automatically.

  • return: A database connection (NULL: failed)
?array db_get_connection (boolean $persistent, string $db_name, string $db_host, string $db_user, string $db_password, [boolean $fail_ok = false])
  • boolean $persistent: Whether to create a persistant connection
  • string $db_name: The database name
  • string $db_host: The database host (the server)
  • string $db_user: The database connection username
  • string $db_password: The database connection password
  • boolean $fail_ok: Whether to on error echo an error and return with a NULL, rather than giving a critical error
db_get_first_id (line 94)

Get the ID of the first row in an auto-increment table (used whenever we need to reference the first).

  • return: First ID used
integer db_get_first_id ()
db_get_query_rows (line 390)

Get the rows returned from a SELECT query.

  • return: A list of row maps
array db_get_query_rows (resource $results, [?integer $start = NULL])
  • resource $results: The query result pointer
  • ?integer $start: Whether to start reading from (NULL: irrelevant for this forum driver)
db_get_type_remap (line 104)

Get a map of ocPortal field types, to actual mySQL types.

  • return: The map
array db_get_type_remap ()
db_has_full_text (line 315)

Find whether full-text-search is present

  • return: Whether it is
boolean db_has_full_text (array $db)
  • array $db: A DB connection
db_is_flat_file_simple (line 227)

Determine whether the database is a flat file database, and thus not have a meaningful connect username and password.

  • return: Whether the database is a flat file database
boolean db_is_flat_file_simple ()
db_query (line 342)

This function is a very basic query executor. It shouldn't usually be used by you, as there are abstracted versions available.

  • return: The results (NULL: no results), or the insert ID
?mixed db_query (string $query, array $db, [?integer $max = NULL], [?integer $start = NULL], [boolean $fail_ok = false], [boolean $get_insert_id = false])
  • string $query: The complete SQL query
  • array $db: A DB connection
  • ?integer $max: The maximum number of rows to affect (NULL: no limit)
  • ?integer $start: The start row to affect (NULL: no specification)
  • boolean $fail_ok: Whether to output an error on failure
  • boolean $get_insert_id: Whether to get the autoincrement ID created for an insert query
db_string_equal_to (line 184)

Encode an SQL statement fragment for a conditional to see if two strings are equal.

  • return: The SQL
string db_string_equal_to (ID_TEXT $attribute, string $compare)
  • ID_TEXT $attribute: The attribute
  • string $compare: The comparison
db_string_not_equal_to (line 196)

Encode an SQL statement fragment for a conditional to see if two strings are not equal.

  • return: The SQL
string db_string_not_equal_to (ID_TEXT $attribute, string $compare)
  • ID_TEXT $attribute: The attribute
  • string $compare: The comparison

Documentation generated on Sun, 02 Jan 2011 23:25:21 +0000 by phpDocumentor 1.4.3