PHP 클래스 yii\db\sqlite\QueryBuilder

부터: 2.0
저자: Qiang Xue ([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 )
addForeignKey ( string $name, string $table, string | array $columns, string $refTable, string | array $refColumns, string $delete = null, string $update = null ) : string Builds a SQL statement for adding a foreign key constraint to an existing table.
addPrimaryKey ( string $name, string $table, string | array $columns ) : string Builds a SQL statement for adding a primary key constraint to an existing table.
alterColumn ( string $table, string $column, string $type ) : string Builds a SQL statement for changing the definition of a column.
batchInsert ( string $table, array $columns, array $rows ) : string Generates a batch INSERT SQL statement.
build ( $query, $params = [] )
buildLimit ( $limit, $offset )
buildUnion ( $unions, &$params )
checkIntegrity ( boolean $check = true, string $schema = '', string $table = '' ) : string Enables or disables integrity check.
dropColumn ( string $table, string $column ) : string Builds a SQL statement for dropping a DB column.
dropCommentFromColumn ( $table, $column )
dropCommentFromTable ( $table )
dropForeignKey ( string $name, string $table ) : string Builds a SQL statement for dropping a foreign key constraint.
dropIndex ( string $name, string $table ) : string Builds a SQL statement for dropping an index.
dropPrimaryKey ( string $name, string $table ) : string Builds a SQL statement for removing a primary key constraint to an existing table.
renameColumn ( string $table, string $oldName, string $newName ) : string Builds a SQL statement for renaming a column.
renameTable ( string $table, 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.
truncateTable ( string $table ) : string Builds a SQL statement for truncating a DB table.

보호된 메소드들

메소드 설명
buildCompositeInCondition ( string $operator, array $columns, array $values, array &$params ) : string Builds SQL for IN condition
buildSubqueryInCondition ( $operator, $columns, $values, &$params )

메소드 상세

addCommentOnColumn() 공개 메소드

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

addCommentOnTable() 공개 메소드

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

addForeignKey() 공개 메소드

The method will properly quote the table and column names.
public addForeignKey ( string $name, string $table, string | array $columns, string $refTable, string | array $refColumns, string $delete = null, string $update = null ) : string
$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 added on. If there are multiple columns, separate them with commas or use an array to represent them.
$refTable string the table that the foreign key references to.
$refColumns string | array the name of the column that the foreign key references to. If there are multiple columns, separate them with commas or use an array to represent them.
$delete string the ON DELETE option. Most DBMS support these options: RESTRICT, CASCADE, NO ACTION, SET DEFAULT, SET NULL
$update string the ON UPDATE option. Most DBMS support these options: RESTRICT, CASCADE, NO ACTION, SET DEFAULT, SET NULL
리턴 string the SQL statement for adding a foreign key constraint to an existing table.

addPrimaryKey() 공개 메소드

Builds a SQL statement for adding a primary key constraint to an existing table.
public addPrimaryKey ( string $name, string $table, string | array $columns ) : string
$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.
리턴 string the SQL statement for adding a primary key constraint to an existing table.

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.

batchInsert() 공개 메소드

For example, php $connection->createCommand()->batchInsert('user', ['name', 'age'], [ ['Tom', 30], ['Jane', 20], ['Linda', 25], ])->execute(); Note that the values in each row must match the corresponding column names.
public batchInsert ( string $table, array $columns, array $rows ) : string
$table string the table that new rows will be inserted into.
$columns array the column names
$rows array the rows to be batch inserted into the table
리턴 string the batch INSERT SQL statement

build() 공개 메소드

public build ( $query, $params = [] )

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

buildLimit() 공개 메소드

public buildLimit ( $limit, $offset )

buildSubqueryInCondition() 보호된 메소드

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

buildUnion() 공개 메소드

public buildUnion ( $unions, &$params )

checkIntegrity() 공개 메소드

Enables or disables 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. Meaningless for SQLite.
$table string the table name. Meaningless for SQLite.
리턴 string the SQL statement for checking integrity

dropColumn() 공개 메소드

Builds a SQL statement for dropping a DB column.
public dropColumn ( string $table, string $column ) : string
$table string the table whose column is to be dropped. The name will be properly quoted by the method.
$column string the name of the column to be dropped. The name will be properly quoted by the method.
리턴 string the SQL statement for dropping a DB column.

dropCommentFromColumn() 공개 메소드

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

dropCommentFromTable() 공개 메소드

부터: 2.0.8
public dropCommentFromTable ( $table )

dropForeignKey() 공개 메소드

Builds a SQL statement for dropping a foreign key constraint.
public dropForeignKey ( string $name, string $table ) : string
$name string the name of the foreign key constraint to be dropped. The name will be properly quoted by the method.
$table string the table whose foreign is to be dropped. The name will be properly quoted by the method.
리턴 string the SQL statement for dropping a foreign key constraint.

dropIndex() 공개 메소드

Builds a SQL statement for dropping an 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.
리턴 string the SQL statement for dropping an index.

dropPrimaryKey() 공개 메소드

Builds a SQL statement for removing a primary key constraint to an existing table.
public dropPrimaryKey ( string $name, string $table ) : string
$name string the name of the primary key constraint to be removed.
$table string the table that the primary key constraint will be removed from.
리턴 string the SQL statement for removing a primary key constraint from an existing table.

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 $table, string $newName ) : string
$table 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.

resetSequence() 공개 메소드

The sequence will be reset such that the primary key of the next new row inserted will have the specified value or 1.
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.
리턴 string the SQL statement for resetting sequence

truncateTable() 공개 메소드

Builds a SQL statement for truncating a DB table.
public truncateTable ( string $table ) : string
$table string the table to be truncated. The name will be properly quoted by the method.
리턴 string the SQL statement for truncating a DB table.

프로퍼티 상세

$typeMap 공개적으로 프로퍼티

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