- Home
- About
- Testimonials
- Demos
- Download
- Documentation
- Blogs
- Forum
- Support

Packages: default System System.Caching System.Collections System.Data System.Data.ActiveRecord System.Data.ActiveRecord.Relations System.Data.ActiveRecord.Scaffold System.Data.ActiveReecord.Scaffold.InputBuilder System.Data.Commom.Sqlite System.Data.Common System.Data.Common.Mssql System.Data.Common.Mysql System.Data.Common.Oracle System.Data.Common.Pgsql System.Data.Common.Sqlite System.Data.DataGateway System.Data.SqlMap System.Data.SqlMap.Configuration System.Data.SqlMap.Statements System.Exceptions System.I18N System.IO System.Security System.Util System.Web System.Web.Services System.Web.UI System.Web.UI.ActiveControls System.Web.UI.WebControls System.Web.UI.WebControls.assets System.Xml Classes: TPgsqlMetaData TPgsqlTableColumn TPgsqlTableInfo |
Keyword
# Class TPgsqlMetaData
    TComponent
       |
       --TDbMetaData
          |
          --TPgsqlMetaData
TPgsqlMetaData loads PostgreSQL database table and column information. Since: 3.1 Author: Wei Zhuo <weizho[at]gmail[dot]com>
Method Summary
protected string | assertIdentifier ( string $name)
protected TPgsqlTableInfo | createNewTableInfo ( string $schemaName, string $tableName)
protected TPgsqlTableInfo | createTableInfo ( string $table) Get the column definitions for given table.
protected array | getConstraintKeys ( string $schemaName, string $tableName) Gets the primary and foreign key column details for the given table.
string | getDefaultSchema ()
protected array | getForeignKeys ( string $src) Gets foreign relationship constraint keys and table name
protected boolean | getIsView ( string $schemaName, string $tableName)
protected array | getPrimaryKeys ( string $tableName, mixed $schemaName, mixed $columnIndex) Gets the primary key field names
protected array | getSchemaTableName ( string $table)
protected string | getSequenceName ( mixed $tableInfo, mixed $src)
protected string | getTableInfoClass ()
protected boolean | isForeignKeyColumn ( string $columnId, TPgsqlTableInfo $tableInfo)
protected boolean | isPrecisionType ( mixed $type)
protected void | processColumn ( TPgsqlTableInfo $tableInfo, array $col)
void | setDefaultSchema ( string $schema)
Methods Inherited From TDbMetaData
TDbMetaData::createCommandBuilder(), TDbMetaData::getDbConnection(), TDbMetaData::getInstance(), TDbMetaData::getTableInfo(), TDbMetaData::getTableInfoClass()
Methods 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()
Method Details
## assertIdentifier
protected string assertIdentifier | (string $name )
Input
string | $name | table name, schema name or column name.
Output
string | a valid identifier.
Exception
throws | TDbException when table name contains a double quote (").
## createNewTableInfo
protected TPgsqlTableInfo createNewTableInfo | (string $schemaName , string $tableName )
Input
string | $schemaName | table schema name
string | $tableName | table name.
Output
Exception
## createTableInfo
protected TPgsqlTableInfo createTableInfo | (string $table )
Get the column definitions for given table.
Input
string | $table | table name.
Output
TPgsqlTableInfo | table information.
Exception
## getConstraintKeys
protected array getConstraintKeys | (string $schemaName , string $tableName )
Gets the primary and foreign key column details for the given table.
Input
string | $schemaName | schema name
string | $tableName | table name.
Output
array | tuple ($primary, $foreign)
Exception
## getDefaultSchema
public string getDefaultSchema | ()
Output
string | default schema.
Exception
## getForeignKeys
protected array getForeignKeys | (string $src )
Gets foreign relationship constraint keys and table name
Input
string | $src | pgsql foreign key definition
Output
array | foreign relationship table name and keys, null otherwise
Exception
## getIsView
protected boolean getIsView | (string $schemaName , string $tableName )
Input
string | $schemaName | table schema name
string | $tableName | table name.
Output
boolean | true if the table is a view.
Exception
## getPrimaryKeys
protected array getPrimaryKeys | (string $tableName , mixed $schemaName , mixed $columnIndex )
Gets the primary key field names
Input
string | $tableName | pgsql primary key definition
mixed | $schemaName |
mixed | $columnIndex |
Output
array | primary key field names.
Exception
## getSchemaTableName
protected array getSchemaTableName | (string $table )
Input
string | $table | table name with optional schema name prefix, uses default schema name prefix is not provided.
Output
array | tuple as ($schemaName,$tableName)
Exception
## getSequenceName
protected string getSequenceName | (mixed $tableInfo , mixed $src )
Input
mixed | $tableInfo |
mixed | $src |
Output
string | serial name if found, null otherwise.
Exception
## getTableInfoClass
protected string getTableInfoClass | ()
Output
string | TDbTableInfo class name.
Exception
## isForeignKeyColumn
protected boolean isForeignKeyColumn | (string $columnId , TPgsqlTableInfo $tableInfo )
Input
string | $columnId | column name.
TPgsqlTableInfo | $tableInfo | table information.
Output
boolean | true if column is a foreign key.
Exception
## isPrecisionType
protected boolean isPrecisionType | (mixed $type )
Input
mixed | $type |
Output
boolean | true if column type if "numeric", "interval" or begins with "time".
Exception
## processColumn
protected void processColumn | (TPgsqlTableInfo $tableInfo , array $col )
Input
TPgsqlTableInfo | $tableInfo | table information.
array | $col | column information.
Output
Exception
## setDefaultSchema
public void setDefaultSchema | (string $schema )
Input
string | $schema | default schema.
Output
Exception