PHP 클래스 yii\db\mssql\QueryBuilder

부터: 2.0
저자: Timur Ruziev ([email protected])
상속: extends yii\db\QueryBuilder
파일 보기 프로젝트 열기: yiisoft/yii2

공개 프로퍼티들

프로퍼티 타입 설명
$typeMap mapping from abstract column types (keys) to physical column types (values).

공개 메소드들

메소드 설명
addCommentOnColumn ( $table, $column, $comment )
addCommentOnTable ( $table, $comment )
alterColumn ( string $table, string $column, string $type ) : string Builds a SQL statement for changing the definition of a column.
buildOrderByAndLimit ( $sql, $orderBy, $limit, $offset )
checkIntegrity ( boolean $check = true, string $schema = '', string $table = '' ) : string Builds a SQL statement for enabling or disabling integrity check.
dropCommentFromColumn ( $table, $column )
dropCommentFromTable ( $table )
renameColumn ( string $table, string $oldName, string $newName ) : string Builds a SQL statement for renaming a column.
renameTable ( string $oldName, string $newName ) : string Builds a SQL statement for renaming a DB table.
selectExists ( $rawSql )

보호된 메소드들

메소드 설명
buildCompositeInCondition ( string $operator, array $columns, array $values, array &$params ) : string Builds SQL for IN condition
buildSubqueryInCondition ( $operator, $columns, $values, &$params )
getAllColumnNames ( string $modelClass = null ) : array | null Returns an array of column names given model name
isOldMssql ( ) : boolean
newBuildOrderByAndLimit ( string $sql, array $orderBy, integer $limit, integer $offset ) : string Builds the ORDER BY/LIMIT/OFFSET clauses for SQL SERVER 2012 or newer.
oldBuildOrderByAndLimit ( string $sql, array $orderBy, integer $limit, integer $offset ) : string Builds the ORDER BY/LIMIT/OFFSET clauses for SQL SERVER 2005 to 2008.

메소드 상세

addCommentOnColumn() 공개 메소드

부터: 2.0.8
public addCommentOnColumn ( $table, $column, $comment )

addCommentOnTable() 공개 메소드

부터: 2.0.8
public addCommentOnTable ( $table, $comment )

alterColumn() 공개 메소드

Builds a SQL statement for changing the definition of a column.
public alterColumn ( string $table, string $column, string $type ) : string
$table string the table whose column is to be changed. The table name will be properly quoted by the method.
$column string the name of the column to be changed. The name will be properly quoted by the method.
$type string the new column type. The [[getColumnType]] method will be invoked to convert abstract column type (if any) into the physical one. Anything that is not recognized as abstract type will be kept in the generated SQL. For example, 'string' will be turned into 'varchar(255)', while 'string not null' will become 'varchar(255) not null'.
리턴 string the SQL statement for changing the definition of a column.

buildCompositeInCondition() 보호된 메소드

Builds SQL for IN condition
protected buildCompositeInCondition ( string $operator, array $columns, array $values, array &$params ) : string
$operator string
$columns array
$values array
$params array
리턴 string SQL

buildOrderByAndLimit() 공개 메소드

public buildOrderByAndLimit ( $sql, $orderBy, $limit, $offset )

buildSubqueryInCondition() 보호된 메소드

protected buildSubqueryInCondition ( $operator, $columns, $values, &$params )

checkIntegrity() 공개 메소드

Builds a SQL statement for enabling or disabling integrity check.
public checkIntegrity ( boolean $check = true, string $schema = '', string $table = '' ) : string
$check boolean whether to turn on or off the integrity check.
$schema string the schema of the tables. Defaults to empty string, meaning the current or default schema.
$table string the table name. Defaults to empty string, meaning that no table will be changed.
리턴 string the SQL statement for checking integrity

dropCommentFromColumn() 공개 메소드

부터: 2.0.8
public dropCommentFromColumn ( $table, $column )

dropCommentFromTable() 공개 메소드

부터: 2.0.8
public dropCommentFromTable ( $table )

getAllColumnNames() 보호된 메소드

Returns an array of column names given model name
protected getAllColumnNames ( string $modelClass = null ) : array | null
$modelClass string name of the model class
리턴 array | null array of column names

isOldMssql() 보호된 메소드

protected isOldMssql ( ) : boolean
리턴 boolean whether the version of the MSSQL being used is older than 2012.

newBuildOrderByAndLimit() 보호된 메소드

Builds the ORDER BY/LIMIT/OFFSET clauses for SQL SERVER 2012 or newer.
protected newBuildOrderByAndLimit ( string $sql, array $orderBy, integer $limit, integer $offset ) : string
$sql string the existing SQL (without ORDER BY/LIMIT/OFFSET)
$orderBy array the order by columns. See [[\yii\db\Query::orderBy]] for more details on how to specify this parameter.
$limit integer the limit number. See [[\yii\db\Query::limit]] for more details.
$offset integer the offset number. See [[\yii\db\Query::offset]] for more details.
리턴 string the SQL completed with ORDER BY/LIMIT/OFFSET (if any)

oldBuildOrderByAndLimit() 보호된 메소드

Builds the ORDER BY/LIMIT/OFFSET clauses for SQL SERVER 2005 to 2008.
protected oldBuildOrderByAndLimit ( string $sql, array $orderBy, integer $limit, integer $offset ) : string
$sql string the existing SQL (without ORDER BY/LIMIT/OFFSET)
$orderBy array the order by columns. See [[\yii\db\Query::orderBy]] for more details on how to specify this parameter.
$limit integer the limit number. See [[\yii\db\Query::limit]] for more details.
$offset integer the offset number. See [[\yii\db\Query::offset]] for more details.
리턴 string the SQL completed with ORDER BY/LIMIT/OFFSET (if any)

renameColumn() 공개 메소드

Builds a SQL statement for renaming a column.
public renameColumn ( string $table, string $oldName, string $newName ) : string
$table string the table whose column is to be renamed. The name will be properly quoted by the method.
$oldName string the old name of the column. The name will be properly quoted by the method.
$newName string the new name of the column. The name will be properly quoted by the method.
리턴 string the SQL statement for renaming a DB column.

renameTable() 공개 메소드

Builds a SQL statement for renaming a DB table.
public renameTable ( string $oldName, string $newName ) : string
$oldName string the table to be renamed. The name will be properly quoted by the method.
$newName string the new table name. The name will be properly quoted by the method.
리턴 string the SQL statement for renaming a DB table.

selectExists() 공개 메소드

부터: 2.0.8
public selectExists ( $rawSql )

프로퍼티 상세

$typeMap 공개적으로 프로퍼티

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