Class BP_SQL_Schema_Parser

Description

Parses SQL schema statements for comparison to real table structures

Located in /includes/class.bp-sql-schema-parser.php (line 7)


	
			
Method Summary
void delta ( $db_object,  $queries, [ $ignore = false], [ $execute = true])
void describe_table ( $query)
void get_column_definition ( $column_data)
void get_index_definition ( $index_data)
void parse ( $sql)
void _flatten_array ( $array, [ $cut_branch = 0], [ $keep_child_array_keys = true])
Methods
delta (line 314)

Evaluates the difference between a given set of SQL queries and real database structure

void delta ( $db_object,  $queries, [ $ignore = false], [ $execute = true])
  • $db_object
  • $queries
  • $ignore
  • $execute
describe_table (line 90)

Returns a table structure from a raw sql query of the form "CREATE TABLE foo" etc.

The resulting array contains the original query, the columns as would be returned by DESCRIBE `foo` and the indices as would be returned by SHOW INDEX FROM `foo` on a real table

void describe_table ( $query)
  • $query
get_column_definition (line 13)

Builds a column definition as used in CREATE TABLE statements from

an array such as those returned by DESCRIBE `foo` statements

void get_column_definition ( $column_data)
  • $column_data
get_index_definition (line 48)

Builds an index definition as used in CREATE TABLE statements from

an array similar to those returned by SHOW INDEX FROM `foo` statements

void get_index_definition ( $index_data)
  • $index_data
parse (line 221)

Splits grouped SQL statements into queries within a highly structured array

Only supports CREATE TABLE, INSERT and UPDATE

void parse ( $sql)
  • $sql
_flatten_array (line 191)

Helper function to flatten arrays

void _flatten_array ( $array, [ $cut_branch = 0], [ $keep_child_array_keys = true])
  • $array
  • $cut_branch
  • $keep_child_array_keys

Documentation generated on Fri, 18 May 2012 01:33:41 +0100 by phpDocumentor 1.4.3