Versions
Look up a class, method, property or event

CPgsqlSchema

Package system.db.schema.pgsql
Inheritance class CPgsqlSchema » CDbSchema » CComponent
Since 1.0
Version $Id: CPgsqlSchema.php 1553 2009-12-07 16:25:50Z qiang.xue $
CPgsqlSchema is the class for retrieving metadata information from a PostgreSQL database.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
commandBuilder CDbCommandBuilder the SQL command builder for this connection. CDbSchema
dbConnection CDbConnection database connection. CDbSchema
tableNames array Returns all table names in the database. CDbSchema
tables array Returns the metadata for all tables in the database. CDbSchema

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__call() Calls the named method which is not a class method. CComponent
__construct() Constructor. CDbSchema
__get() Returns a property value, an event handler list or a behavior based on its name. CComponent
__isset() Checks if a property value is null. CComponent
__set() Sets value of a component property. CComponent
__unset() Sets a component property to be null. CComponent
asa() Returns the named behavior object. CComponent
attachBehavior() Attaches a behavior to this component. CComponent
attachBehaviors() Attaches a list of behaviors to the component. CComponent
attachEventHandler() Attaches an event handler to an event. CComponent
canGetProperty() Determines whether a property can be read. CComponent
canSetProperty() Determines whether a property can be set. CComponent
compareTableNames() Compares two table names. CDbSchema
detachBehavior() Detaches a behavior from the component. CComponent
detachBehaviors() Detaches all behaviors from the component. CComponent
detachEventHandler() Detaches an existing event handler. CComponent
disableBehavior() Disables an attached behavior. CComponent
disableBehaviors() Disables all behaviors attached to this component. CComponent
enableBehavior() Enables an attached behavior. CComponent
enableBehaviors() Enables all behaviors attached to this component. CComponent
getCommandBuilder() CDbSchema
getDbConnection() CDbSchema
getEventHandlers() Returns the list of attached event handlers for an event. CComponent
getTable() Obtains the metadata for the named table. CDbSchema
getTableNames() Returns all table names in the database. CDbSchema
getTables() Returns the metadata for all tables in the database. CDbSchema
hasEvent() Determines whether an event is defined. CComponent
hasEventHandler() Checks whether the named event has attached handlers. CComponent
hasProperty() Determines whether a property is defined. CComponent
quoteColumnName() Quotes a column name for use in a query. CDbSchema
quoteTableName() Quotes a table name for use in a query. CPgsqlSchema
raiseEvent() Raises an event. CComponent
refresh() Refreshes the schema. CDbSchema

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
createColumn() Creates a table column. CPgsqlSchema
createCommandBuilder() Creates a command builder for the database. CDbSchema
createTable() Creates a table instance representing the metadata for the named table. CPgsqlSchema
findColumns() Collects the table column metadata. CPgsqlSchema
findConstraints() Collects the primary and foreign key column details for the given table. CPgsqlSchema
findForeignKey() Collects foreign key information. CPgsqlSchema
findPrimaryKey() Collects primary key information. CPgsqlSchema
findTableNames() Returns all table names in the database. CPgsqlSchema
resolveTableNames() Generates various kinds of table names. CPgsqlSchema

Method Details

createColumn() method
protected CDbColumnSchema createColumn(array $column)
$column array column metadata
{return} CDbColumnSchema normalized column metadata

Creates a table column.

createTable() method
protected CDbTableSchema createTable($name)
$name
{return} CDbTableSchema driver dependent table metadata.

Creates a table instance representing the metadata for the named table.

findColumns() method
protected boolean findColumns(CPgsqlTableSchema $table)
$table CPgsqlTableSchema the table metadata
{return} boolean whether the table exists in the database

Collects the table column metadata.

findConstraints() method
protected void findConstraints(CPgsqlTableSchema $table)
$table CPgsqlTableSchema the table metadata

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

findForeignKey() method
protected void findForeignKey(CPgsqlTableSchema $table, string $src)
$table CPgsqlTableSchema the table metadata
$src string pgsql foreign key definition

Collects foreign key information.

findPrimaryKey() method
protected void findPrimaryKey(CPgsqlTableSchema $table, string $indices)
$table CPgsqlTableSchema the table metadata
$indices string pgsql primary key index list

Collects primary key information.

findTableNames() method (available since v1.0.2)
protected array findTableNames($schema='')
$schema
{return} array all table names in the database.

Returns all table names in the database.

quoteTableName() method
public string quoteTableName(string $name)
$name string table name
{return} string the properly quoted table name

Quotes a table name for use in a query.

resolveTableNames() method
protected void resolveTableNames(CPgsqlTableSchema $table, string $name)
$table CPgsqlTableSchema the table instance
$name string the unquoted table name

Generates various kinds of table names.

Be the first person to leave a comment

Please to leave your comment.