db\QueryBuilder batchInsert()

batchInsert() public method Generates a batch INSERT SQL statement. For example, $sql = $queryBuilder->batchInsert('user', ['name', 'age'], [ ['Tom', 30], ['Jane', 20], ['Linda', 25], ]); Note that the values in each row must match the corresponding column names. The method will properly escape the column names, and quote the values to be inserted. public string batchInsert ( $table, $columns, $rows )$table string The table that new rows will be inserted into. $columns a

db\QueryBuilder alterColumn()

alterColumn() public method Builds a SQL statement for changing the definition of a column. public string alterColumn ( $table, $column, $type )$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 physica

db\QueryBuilder addPrimaryKey()

addPrimaryKey() public method Builds a SQL statement for adding a primary key constraint to an existing table. public string addPrimaryKey ( $name, $table, $columns )$name string The name of the primary key constraint. $table string The table that the primary key constraint will be added to. $columns string|array Comma separated string or array of columns that the primary key will consist of. return string The SQL statement for adding a primary key constraint to an existing table

db\QueryBuilder addForeignKey()

addForeignKey() public method Builds a SQL statement for adding a foreign key constraint to an existing table. The method will properly quote the table and column names. public string addForeignKey ( $name, $table, $columns, $refTable, $refColumns, $delete = null, $update = null )$name string The name of the foreign key constraint. $table string The table that the foreign key constraint will be added to. $columns string|array The name of the column to that the constraint will be ad

db\QueryBuilder addCommentOnTable()

addCommentOnTable() public method (available since version 2.0.8) Builds a SQL command for adding comment to table public string addCommentOnTable ( $table, $comment )$table string The table whose column is to be commented. The table name will be properly quoted by the method. $comment string The text of the comment to be added. The comment will be properly quoted by the method. return string The SQL statement for adding comment on table

db\QueryBuilder addCommentOnColumn()

addCommentOnColumn() public method (available since version 2.0.8) Builds a SQL command for adding comment to column public string addCommentOnColumn ( $table, $column, $comment )$table string The table whose column is to be commented. The table name will be properly quoted by the method. $column string The name of the column to be commented. The column name will be properly quoted by the method. $comment string The text of the comment to be added. The comment will be properly quoted

db\QueryBuilder addColumn()

addColumn() public method Builds a SQL statement for adding a new DB column. public string addColumn ( $table, $column, $type )$table string The table that the new column will be added to. The table name will be properly quoted by the method. $column string The name of the new column. The name will be properly quoted by the method. $type string The column type. The getColumnType() method will be invoked to convert abstract column type (if any) into the physical one. Anything that is

db\QueryBuilder $typeMap

$typeMap public property The abstract column types mapped to physical column types. This is mainly used to support creating/modifying tables using DB-independent data type specifications. Child classes should override this property to declare supported type mappings. public array $typeMap = []

db\QueryBuilder $separator

$separator public property The separator between different fragments of a SQL statement. Defaults to an empty space. This is mainly used by build() when generating a SQL statement. public string $separator = ' '

db\QueryBuilder $db

$db public property The database connection. public yii\db\Connection $db = null