Pelzini

This is the code documentation for the Pelzini project

Page options:

Inherited members

class PostgresqlOutputter

Outputs the tree to a PostgreSQL database

Authors

Variables

NameVisibilityDescription
$database 
$db 
$password 
$server 
$username 

Functions

NameVisibilityDescription
__constructpublicConnects to the db
__destructpublicCloses connection to the db
affected_rowsprotectedReturns the number of rows affected in the last query
commit_transactionprotectedThe database engine should commit a transaction. If transactions are not supported, it should do nothing.
connectprotectedConnects to the MySQL database
create_tableprotectedCreates a table
fetch_assocprotectedFetches a row from the database (assoc)
fetch_rowprotectedFetches a row from the database (numerical)
get_alter_column_queryprotectedGets the query that alters a column to match the new SQL definition
get_column_detailsprotectedShould return a multi-dimentional array of the column details
get_sql_typeprotectedConverts an internal type into the database-specific SQL type.
get_table_listprotectedReturns an array of the tables in this database
insert_idprotectedReturns the autogenerated id created in the last query
queryprotectedExecutes a MySQL query
rollback_transactionprotectedThe database engine should rollback a transaction. If transactions are not supported, it should do nothing.
sql_safenprotectedSafens some input
start_transactionprotectedThe database engine should start a transaction. If transactions are not supported, it should do nothing.

public __construct

void $PostgresqlOutputter->__construct ( mixed $username , mixed $password , mixed $server , mixed $database );

Connects to the db

public __destruct

void $PostgresqlOutputter->__destruct ( );

Closes connection to the db

protected affected_rows

unknown $PostgresqlOutputter->affected_rows ( mixed $res );

Returns the number of rows affected in the last query

protected commit_transaction

void $PostgresqlOutputter->commit_transaction ( );

The database engine should commit a transaction. If transactions are not supported, it should do nothing.

protected connect

unknown $PostgresqlOutputter->connect ( );

Connects to the MySQL database

protected create_table

void $PostgresqlOutputter->create_table ( mixed $table_name , mixed $dest_table );

Creates a table

protected fetch_assoc

unknown $PostgresqlOutputter->fetch_assoc ( mixed $res );

Fetches a row from the database (assoc)

protected fetch_row

unknown $PostgresqlOutputter->fetch_row ( mixed $res );

Fetches a row from the database (numerical)

protected get_alter_column_query

unknown $PostgresqlOutputter->get_alter_column_query ( mixed $table , mixed $column_name , mixed $new_type , mixed $not_null );

Gets the query that alters a column to match the new SQL definition

protected get_column_details

unknown $PostgresqlOutputter->get_column_details ( mixed $table_name );

Should return a multi-dimentional array of the column details
Format:
Array [
  [0] => Array [
     'Field' => field name
     'Type' => field type, (e.g. 'serial', 'smallnum' or 'identifier')
     'NotNull' => nullable?, (true or false)
     'Key' => indexed?, ('PRI' for primary key)
     ]
   [1] => ...
   [n] => ...

protected get_sql_type

string $PostgresqlOutputter->get_sql_type ( string $internal_type_name );

Converts an internal type into the database-specific SQL type.
The defined internal types are:
  - serial: a number that automatically increments whenever a record is added
  - smallnum: a small number. needs to be able to hold at least 32,767 possible values (e.g. a 16-bit signed integer)
  - largenum: a large number. needs to be the same size or larger than a serial type
  - string: a character field long enough to hold identifiers of objects (e.g. function names)
  - text: a field that can hold arbitary pieces of text larger than 65536 chars in length.

protected get_table_list

unknown $PostgresqlOutputter->get_table_list ( );

Returns an array of the tables in this database

protected insert_id

unknown $PostgresqlOutputter->insert_id ( );

Returns the autogenerated id created in the last query

protected query

unknown $PostgresqlOutputter->query ( mixed $query );

Executes a MySQL query

protected rollback_transaction

void $PostgresqlOutputter->rollback_transaction ( );

The database engine should rollback a transaction. If transactions are not supported, it should do nothing.

protected sql_safen

unknown $PostgresqlOutputter->sql_safen ( string $input );

Safens some input

protected start_transaction

void $PostgresqlOutputter->start_transaction ( );

The database engine should start a transaction. If transactions are not supported, it should do nothing.