## Class TPgsqlMetaData

Description

TPgsqlMetaData loads PostgreSQL database table and column information.

- since: 3.1
- version: $Id: TPgsqlMetaData.php 2203 2007-09-04 17:43:45Z xue $
- author: Wei Zhuo <weizho[at]gmail[dot]com>

Located in /Data/Common/Pgsql/TPgsqlMetaData.php (line 27)

    TComponent
       |
       --TDbMetaData
          |
          --TPgsqlMetaData

Method Summary
string assertIdentifier (string $name)
TPgsqlTableInfo createNewTableInfo (string $schemaName, string $tableName)
TPgsqlTableInfo createTableInfo (string $table)
array getConstraintKeys (string $schemaName, string $tableName)
string getDefaultSchema ()
array getForeignKeys (string $src)
boolean getIsView (string $schemaName, string $tableName)
array getPrimaryKeys (string $tableName, mixed $schemaName, mixed $columnIndex)
array getSchemaTableName (string $table)
string getSequenceName (mixed $tableInfo, mixed $src)
string getTableInfoClass ()
boolean isForeignKeyColumn (string $columnId, TPgsqlTableInfo $tableInfo)
boolean isPrecisionType (mixed $type)
void processColumn (TPgsqlTableInfo $tableInfo, array $col)
void setDefaultSchema (string $schema)
Methods
assertIdentifier (line 145)

- return: a valid identifier.
- access: protected
- throws: TDbException when table name contains a double quote (").

string assertIdentifier (string $name)

- string $name: table name, schema name or column name.

createNewTableInfo (line 129)

- access: protected

TPgsqlTableInfo createNewTableInfo (string $schemaName, string $tableName)

- string $schemaName: table schema name
- string $tableName: table name.

createTableInfo (line 72)

Get the column definitions for given table.

- return: table information.
- access: protected

TPgsqlTableInfo createTableInfo (string $table)

- string $table: table name.

Redefinition of:

TDbMetaData::createTableInfo()
  This method should be implemented by decendent classes.

getConstraintKeys (line 253)

Gets the primary and foreign key column details for the given table.

- return: tuple ($primary, $foreign)
- access: protected

array getConstraintKeys (string $schemaName, string $tableName)

- string $schemaName: schema name
- string $tableName: table name.

getDefaultSchema (line 50)

- return: default schema.
- access: public

string getDefaultSchema ()
getForeignKeys (line 358)

Gets foreign relationship constraint keys and table name

- return: foreign relationship table name and keys, null otherwise
- access: protected

array getForeignKeys (string $src)

- string $src: pgsql foreign key definition

getIsView (line 160)

- return: true if the table is a view.
- access: protected

boolean getIsView (string $schemaName, string $tableName)

- string $schemaName: table schema name
- string $tableName: table name.

getPrimaryKeys (line 328)

Gets the primary key field names

- return: primary key field names.
- access: protected

array getPrimaryKeys (string $tableName, mixed $schemaName, mixed $columnIndex)

- string $tableName: pgsql primary key definition

getSchemaTableName (line 59)

- return: tuple as ($schemaName,$tableName)
- access: protected

array getSchemaTableName (string $table)

- string $table: table name with optional schema name prefix, uses default schema name prefix is not provided.

getSequenceName (line 226)

- return: serial name if found, null otherwise.
- access: protected

string getSequenceName (mixed $tableInfo, mixed $src)
getTableInfoClass (line 34)

- return: TDbTableInfo class name.
- access: protected

string getTableInfoClass ()

Redefinition of:

TDbMetaData::getTableInfoClass()

isForeignKeyColumn (line 378)

- return: true if column is a foreign key.
- access: protected

boolean isForeignKeyColumn (string $columnId, TPgsqlTableInfo $tableInfo)

- string $columnId: column name.
- TPgsqlTableInfo $tableInfo: table information.

isPrecisionType (line 241)

- return: true if column type if "numeric", "interval" or begins with "time".
- access: protected

boolean isPrecisionType (mixed $type)
processColumn (line 178)

- access: protected

void processColumn (TPgsqlTableInfo $tableInfo, array $col)

- TPgsqlTableInfo $tableInfo: table information.
- array $col: column information.

setDefaultSchema (line 42)

- access: public

void setDefaultSchema (string $schema)

- string $schema: default schema.

#### Inherited Methods

Inherited From TDbMetaData

> TDbMetaData::__construct()
> TDbMetaData::createCommandBuilder()
> TDbMetaData::createTableInfo()
> TDbMetaData::getDbConnection()
> TDbMetaData::getInstance()
> TDbMetaData::getTableInfo()
> TDbMetaData::getTableInfoClass()

Inherited From TComponent

> TComponent::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Documentation generated on Sun, 30 Sep 2007 19:17:00 -0400 by phpDocumentor 1.3.0RC4