Property | Type | Description | |
---|---|---|---|
$typeMap | mapping from abstract column types (keys) to physical column types (values). |
Property | Type | Description | |
---|---|---|---|
$conditionBuilders | map of query condition to builder methods. These methods are used by [[buildCondition]] to build SQL conditions from array syntax. |
Method | Description | |
---|---|---|
alterColumn ( string $table, string $column, string $type ) : string | Builds a SQL statement for changing the definition of a column. | |
batchInsert ( $table, $columns, $rows ) | ||
checkIntegrity ( boolean $check = true, string $schema = '', string $table = '' ) : string | Builds a SQL statement for enabling or disabling integrity check. | |
createIndex ( string $name, string $table, string | array $columns, boolean | string $unique = false ) : string | Builds a SQL statement for creating a new index. | |
dropIndex ( string $name, string $table ) : string | Builds a SQL statement for dropping an index. | |
insert ( $table, $columns, &$params ) | ||
renameTable ( string $oldName, string $newName ) : string | Builds a SQL statement for renaming a DB table. | |
resetSequence ( string $tableName, mixed $value = null ) : string | Creates a SQL statement for resetting the sequence value of a table's primary key. | |
update ( $table, $columns, $condition, &$params ) |
Method | Description | |
---|---|---|
normalizeTableRowData ( string $table, array $columns ) : array | Normalizes data to be saved into the table, performing extra preparations and type converting, if necessary. |
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'. You can also use PostgreSQL-specific syntax such as `SET NOT NULL`. |
return | string | the SQL statement for changing the definition of a column. |
public createIndex ( string $name, string $table, string | array $columns, boolean | string $unique = false ) : string | ||
$name | string | the name of the index. The name will be properly quoted by the method. |
$table | string | the table that the new index will be created for. The table name will be properly quoted by the method. |
$columns | string | array | the column(s) that should be included in the index. If there are multiple columns, separate them with commas or use an array to represent them. Each column name will be properly quoted by the method, unless a parenthesis is found in the name. |
$unique | boolean | string | whether to make this a UNIQUE index constraint. You can pass `true` or [[INDEX_UNIQUE]] to create a unique index, `false` to make a non-unique index using the default index type, or one of the following constants to specify the index method to use: [[INDEX_B_TREE]], [[INDEX_HASH]], [[INDEX_GIST]], [[INDEX_GIN]]. |
return | string | the SQL statement for creating a new index. |
public dropIndex ( string $name, string $table ) : string | ||
$name | string | the name of the index to be dropped. The name will be properly quoted by the method. |
$table | string | the table whose index is to be dropped. The name will be properly quoted by the method. |
return | string | the SQL statement for dropping an index. |
public resetSequence ( string $tableName, mixed $value = null ) : string | ||
$tableName | string | the name of the table whose primary key sequence will be reset |
$value | mixed | the value for the primary key of the next new row inserted. If this is not set, the next new row's primary key will have a value 1. |
return | string | the SQL statement for resetting sequence |
protected $conditionBuilders |