PHP Class Prado\Data\Common\Pgsql\TPgsqlMetaData

Since: 3.1
Inheritance: extends Prado\Data\Common\TDbMetaData
Mostrar archivo Open project: pradosoft/prado

Public Methods

Method Description
findTableNames ( string $schema = 'public' ) : array Returns all table names in the database.
getDefaultSchema ( ) : string
quoteColumnAlias ( string $name ) : string Quotes a column alias for use in a query.
quoteColumnName ( string $name ) : string Quotes a column name for use in a query.
quoteTableName ( string $name ) : string Quotes a table name for use in a query.
setDefaultSchema ( $schema )

Protected Methods

Method Description
assertIdentifier ( $name ) : string
createNewTableInfo ( $schemaName, $tableName ) : TPgsqlTableInfo
createTableInfo ( $table ) : TPgsqlTableInfo Get the column definitions for given table.
getConstraintKeys ( $schemaName, $tableName ) : array Gets the primary and foreign key column details for the given table.
getForeignKeys ( $src ) : array Gets foreign relationship constraint keys and table name
getIsView ( $schemaName, $tableName ) : boolean
getPrimaryKeys ( $tableName, $schemaName, $columnIndex ) : array Gets the primary key field names
getSchemaTableName ( $table ) : array
getSequenceName ( $tableInfo, $src ) : string
getTableInfoClass ( ) : string
isForeignKeyColumn ( $columnId, $tableInfo ) : boolean
isPrecisionType ( $type ) : boolean
processColumn ( $tableInfo, $col )

Method Details

assertIdentifier() protected method

protected assertIdentifier ( $name ) : string
return string a valid identifier.

createNewTableInfo() protected method

protected createNewTableInfo ( $schemaName, $tableName ) : TPgsqlTableInfo
return TPgsqlTableInfo

createTableInfo() protected method

Get the column definitions for given table.
protected createTableInfo ( $table ) : TPgsqlTableInfo
return TPgsqlTableInfo table information.

findTableNames() public method

Returns all table names in the database.
public findTableNames ( string $schema = 'public' ) : array
$schema string the schema of the tables. Defaults to empty string, meaning the current or default schema. If not empty, the returned table names will be prefixed with the schema name.
return array all table names in the database.

getConstraintKeys() protected method

Gets the primary and foreign key column details for the given table.
protected getConstraintKeys ( $schemaName, $tableName ) : array
return array tuple ($primary, $foreign)

getDefaultSchema() public method

public getDefaultSchema ( ) : string
return string default schema.

getForeignKeys() protected method

Gets foreign relationship constraint keys and table name
protected getForeignKeys ( $src ) : array
return array foreign relationship table name and keys, null otherwise

getIsView() protected method

protected getIsView ( $schemaName, $tableName ) : boolean
return boolean true if the table is a view.

getPrimaryKeys() protected method

Gets the primary key field names
protected getPrimaryKeys ( $tableName, $schemaName, $columnIndex ) : array
return array primary key field names.

getSchemaTableName() protected method

protected getSchemaTableName ( $table ) : array
return array tuple as ($schemaName,$tableName)

getSequenceName() protected method

protected getSequenceName ( $tableInfo, $src ) : string
return string serial name if found, null otherwise.

getTableInfoClass() protected method

protected getTableInfoClass ( ) : string
return string TDbTableInfo class name.

isForeignKeyColumn() protected method

protected isForeignKeyColumn ( $columnId, $tableInfo ) : boolean
return boolean true if column is a foreign key.

isPrecisionType() protected method

protected isPrecisionType ( $type ) : boolean
return boolean true if column type if "numeric", "interval" or begins with "time".

processColumn() protected method

protected processColumn ( $tableInfo, $col )

quoteColumnAlias() public method

Quotes a column alias for use in a query.
public quoteColumnAlias ( string $name ) : string
$name string column alias
return string the properly quoted column alias

quoteColumnName() public method

Quotes a column name for use in a query.
public quoteColumnName ( string $name ) : string
$name string column name
return string the properly quoted column name

quoteTableName() public method

Quotes a table name for use in a query.
public quoteTableName ( string $name ) : string
$name string table name
return string the properly quoted table name

setDefaultSchema() public method

public setDefaultSchema ( $schema )