PHP Class yii\db\pgsql\Schema

Since: 2.0
Author: Gevik Babakhani ([email protected])
Inheritance: extends yii\db\Schema
Afficher le fichier Open project: yiisoft/yii2

Méthodes publiques

Свойство Type Description
$defaultSchema the default schema used for the current session.
$typeMap mapping from physical column types (keys) to abstract column types (values)

Méthodes publiques

Méthode Description
createQueryBuilder ( ) : QueryBuilder Creates a query builder for the PostgreSQL database.
findUniqueIndexes ( yii\db\TableSchema $table ) : array Returns all unique indexes for the given table.
getViewNames ( string $schema = '', boolean $refresh = false ) : string[] Returns all view names in the database.
insert ( $table, $columns )
loadTableSchema ( string $name ) : yii\db\TableSchema | null Loads the metadata for the specified table.
quoteSimpleTableName ( string $name ) : string Quotes a table name for use in a query.

Méthodes protégées

Méthode Description
findColumns ( yii\db\TableSchema $table ) : boolean Collects the metadata of table columns.
findConstraints ( yii\db\TableSchema $table ) Collects the foreign key column details for the given table.
findSchemaNames ( ) : array Returns all schema names in the database, including the default one but not system schemas.
findTableNames ( string $schema = '' ) : array Returns all table names in the database.
findViewNames ( string $schema = '' ) : array Returns all views names in the database.
getUniqueIndexInformation ( yii\db\TableSchema $table ) : array Gets information about given table unique indexes.
loadColumnSchema ( array $info ) : ColumnSchema Loads the column information into a [[ColumnSchema]] object.
resolveTableNames ( yii\db\TableSchema $table, string $name ) Resolves the table name and schema name (if any).

Method Details

createQueryBuilder() public méthode

Creates a query builder for the PostgreSQL database.
public createQueryBuilder ( ) : QueryBuilder
Résultat QueryBuilder query builder instance

findColumns() protected méthode

Collects the metadata of table columns.
protected findColumns ( yii\db\TableSchema $table ) : boolean
$table yii\db\TableSchema the table metadata
Résultat boolean whether the table exists in the database

findConstraints() protected méthode

Collects the foreign key column details for the given table.
protected findConstraints ( yii\db\TableSchema $table )
$table yii\db\TableSchema the table metadata

findSchemaNames() protected méthode

This method should be overridden by child classes in order to support this feature because the default implementation simply throws an exception.
Since: 2.0.4
protected findSchemaNames ( ) : array
Résultat array all schema names in the database, except system schemas

findTableNames() protected méthode

Returns all table names in the database.
protected findTableNames ( string $schema = '' ) : array
$schema string the schema of the tables. Defaults to empty string, meaning the current or default schema.
Résultat array all table names in the database. The names have NO schema name prefix.

findUniqueIndexes() public méthode

Each array element is of the following structure: php [ 'IndexName1' => ['col1' [, ...]], 'IndexName2' => ['col2' [, ...]], ]
public findUniqueIndexes ( yii\db\TableSchema $table ) : array
$table yii\db\TableSchema the table metadata
Résultat array all unique indexes for the given table.

findViewNames() protected méthode

Returns all views names in the database.
Since: 2.0.9
protected findViewNames ( string $schema = '' ) : array
$schema string the schema of the views. Defaults to empty string, meaning the current or default schema.
Résultat array all views names in the database. The names have NO schema name prefix.

getUniqueIndexInformation() protected méthode

Gets information about given table unique indexes.
protected getUniqueIndexInformation ( yii\db\TableSchema $table ) : array
$table yii\db\TableSchema the table metadata
Résultat array with index and column names

getViewNames() public méthode

Returns all view names in the database.
Since: 2.0.9
public getViewNames ( string $schema = '', boolean $refresh = false ) : string[]
$schema string the schema of the views. Defaults to empty string, meaning the current or default schema name. If not empty, the returned view names will be prefixed with the schema name.
$refresh boolean whether to fetch the latest available view names. If this is false, view names fetched previously (if available) will be returned.
Résultat string[] all view names in the database.

insert() public méthode

public insert ( $table, $columns )

loadColumnSchema() protected méthode

Loads the column information into a [[ColumnSchema]] object.
protected loadColumnSchema ( array $info ) : ColumnSchema
$info array column information
Résultat yii\db\ColumnSchema the column schema object

loadTableSchema() public méthode

Loads the metadata for the specified table.
public loadTableSchema ( string $name ) : yii\db\TableSchema | null
$name string table name
Résultat yii\db\TableSchema | null driver dependent table metadata. Null if the table does not exist.

quoteSimpleTableName() public méthode

A simple table name has no schema prefix.
public quoteSimpleTableName ( string $name ) : string
$name string table name
Résultat string the properly quoted table name

resolveTableNames() protected méthode

Resolves the table name and schema name (if any).
protected resolveTableNames ( yii\db\TableSchema $table, string $name )
$table yii\db\TableSchema the table metadata object
$name string the table name

Property Details

$defaultSchema public_oe property

the default schema used for the current session.
public $defaultSchema

$typeMap public_oe property

mapping from physical column types (keys) to abstract column types (values)
See also: http://www.postgresql.org/docs/current/static/datatype.html#DATATYPE-TABLE
public $typeMap