Property | Type | Description | |
---|---|---|---|
$typeMap | mapping from abstract column types (keys) to physical column types (values). |
Method | Description | |
---|---|---|
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 ) |
Method | Description | |
---|---|---|
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. |
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'. |
return | string | the SQL statement for changing the definition of a column. |
public buildOrderByAndLimit ( $sql, $orderBy, $limit, $offset ) |
protected buildSubqueryInCondition ( $operator, $columns, $values, &$params ) |
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. |
return | string | the SQL statement for checking integrity |
protected isOldMssql ( ) : boolean | ||
return | boolean | whether the version of the MSSQL being used is older than 2012. |
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. |
return | string | the SQL completed with ORDER BY/LIMIT/OFFSET (if any) |
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. |
return | string | the SQL completed with ORDER BY/LIMIT/OFFSET (if any) |
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. |
return | string | the SQL statement for renaming a DB column. |