Class TPgsqlMetaData

Description

TPgsqlMetaData loads PostgreSQL database table and column information.

  • author: Wei Zhuo <weizho[at]gmail[dot]com>
  • version: $Id: TPgsqlMetaData.php 3031 2011-08-28 06:24:03Z GODZilla0480@gmail.com $
  • since: 3.1

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,  $schemaName,  $columnIndex)
array getSchemaTableName (string $table)
string getSequenceName ( $tableInfo,  $src)
string getTableInfoClass ()
boolean isForeignKeyColumn (string $columnId, TPgsqlTableInfo $tableInfo)
boolean isPrecisionType ( $type)
void processColumn (TPgsqlTableInfo $tableInfo, array $col)
string quoteColumnAlias (string $name)
string quoteColumnName (string $name)
string quoteTableName (string $name)
void setDefaultSchema (string $schema)
Variables

Inherited Variables

Inherited from TDbMetaData

TDbMetaData::$delimiterIdentifier
Methods
assertIdentifier (line 176)
  • return: a valid identifier.
  • throws: TDbException when table name contains a double quote (").
  • access: protected
string assertIdentifier (string $name)
  • string $name: table name, schema name or column name.
createNewTableInfo (line 160)
  • access: protected
TPgsqlTableInfo createNewTableInfo (string $schemaName, string $tableName)
  • string $schemaName: table schema name
  • string $tableName: table name.
createTableInfo (line 102)

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 285)

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 80)
  • return: default schema.
  • access: public
string getDefaultSchema ()
getForeignKeys (line 392)

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 191)
  • 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 361)

Gets the primary key field names

  • return: primary key field names.
  • access: protected
array getPrimaryKeys (string $tableName,  $schemaName,  $columnIndex)
  • string $tableName: pgsql primary key definition
  • $schemaName
  • $columnIndex
getSchemaTableName (line 89)
  • 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 258)
  • return: serial name if found, null otherwise.
  • access: protected
string getSequenceName ( $tableInfo,  $src)
  • $tableInfo
  • $src
getTableInfoClass (line 34)
  • return: TDbTableInfo class name.
  • access: protected
string getTableInfoClass ()

Redefinition of:
TDbMetaData::getTableInfoClass()
isForeignKeyColumn (line 412)
  • 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 273)
  • return: true if column type if "numeric", "interval" or begins with "time".
  • access: protected
boolean isPrecisionType ( $type)
  • $type
processColumn (line 210)
  • access: protected
void processColumn (TPgsqlTableInfo $tableInfo, array $col)
  • TPgsqlTableInfo $tableInfo: table information.
  • array $col: column information.
quoteColumnAlias (line 64)

Quotes a column alias for use in a query.

  • return: the properly quoted column alias
  • access: public
string quoteColumnAlias (string $name)
  • string $name: column alias

Redefinition of:
TDbMetaData::quoteColumnAlias()
Quotes a column alias for use in a query.
quoteColumnName (line 54)

Quotes a column name for use in a query.

  • return: the properly quoted column name
  • access: public
string quoteColumnName (string $name)
  • string $name: column name

Redefinition of:
TDbMetaData::quoteColumnName()
Quotes a column name for use in a query.
quoteTableName (line 44)

Quotes a table name for use in a query.

  • return: the properly quoted table name
  • access: public
string quoteTableName (string $name)
  • string $name: table name

Redefinition of:
TDbMetaData::quoteTableName()
Quotes a table name for use in a query.
setDefaultSchema (line 72)
  • 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()
TDbMetaData::quoteColumnAlias()
TDbMetaData::quoteColumnName()
TDbMetaData::quoteTableName()

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::__call()
TComponent::__get()
TComponent::__set()
TComponent::__sleep()
TComponent::__wakeup()

Documentation generated on Mon, 25 Jun 2012 14:38:53 +0200 by phpDocumentor 1.4.3