PHP Class yii\db\mssql\Schema

Since: 2.0
Author: Timur Ruziev ([email protected])
Inheritance: extends yii\db\Schema
Show file Open project: yiisoft/yii2

Public Properties

Property Type Description
$defaultSchema the default schema used for the current session.
$typeMap mapping from physical column types (keys) to abstract column types (values)

Public Methods

Method Description
createQueryBuilder ( ) : QueryBuilder Creates a query builder for the MSSQL database.
createSavepoint ( $name )
findUniqueIndexes ( yii\db\mssql\TableSchema $table ) : array Returns all unique indexes for the given table.
loadTableSchema ( string $name ) : yii\db\mssql\TableSchema | null Loads the metadata for the specified table.
quoteSimpleColumnName ( string $name ) : string Quotes a column name for use in a query.
quoteSimpleTableName ( string $name ) : string Quotes a table name for use in a query.
releaseSavepoint ( $name )
rollBackSavepoint ( $name )

Protected Methods

Method Description
findColumns ( yii\db\mssql\TableSchema $table ) : boolean Collects the metadata of table columns.
findForeignKeys ( yii\db\mssql\TableSchema $table ) Collects the foreign key column details for the given table.
findPrimaryKeys ( yii\db\mssql\TableSchema $table ) Collects the primary key column details for the given table.
findTableConstraints ( yii\db\mssql\TableSchema $table, string $type ) : array Collects the constraint details for the given table and constraint type.
findTableNames ( string $schema = '' ) : array Returns all table names in the database.
loadColumnSchema ( array $info ) : ColumnSchema Loads the column information into a [[ColumnSchema]] object.
resolveTableNames ( yii\db\mssql\TableSchema $table, string $name ) Resolves the table name and schema name (if any).

Method Details

createQueryBuilder() public method

Creates a query builder for the MSSQL database.
public createQueryBuilder ( ) : QueryBuilder
return QueryBuilder query builder interface.

createSavepoint() public method

public createSavepoint ( $name )

findColumns() protected method

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

findForeignKeys() protected method

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

findPrimaryKeys() protected method

Collects the primary key column details for the given table.
protected findPrimaryKeys ( yii\db\mssql\TableSchema $table )
$table yii\db\mssql\TableSchema the table metadata

findTableConstraints() protected method

Collects the constraint details for the given table and constraint type.
Since: 2.0.4
protected findTableConstraints ( yii\db\mssql\TableSchema $table, string $type ) : array
$table yii\db\mssql\TableSchema
$type string either PRIMARY KEY or UNIQUE
return array each entry contains index_name and field_name

findTableNames() protected method

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.
return array all table names in the database. The names have NO schema name prefix.

findUniqueIndexes() public method

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

loadColumnSchema() protected method

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

loadTableSchema() public method

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

quoteSimpleColumnName() public method

A simple column name has no prefix.
public quoteSimpleColumnName ( string $name ) : string
$name string column name.
return string the properly quoted column name.

quoteSimpleTableName() public method

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

releaseSavepoint() public method

public releaseSavepoint ( $name )

resolveTableNames() protected method

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

rollBackSavepoint() public method

public rollBackSavepoint ( $name )

Property Details

$defaultSchema public property

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

$typeMap public property

mapping from physical column types (keys) to abstract column types (values)
public $typeMap