0 follower

Final Class Yiisoft\Db\Sqlite\DDLQueryBuilder

InheritanceYiisoft\Db\Sqlite\DDLQueryBuilder » Yiisoft\Db\QueryBuilder\AbstractDDLQueryBuilder

Implements a (Data Definition Language) SQL statements for SQLite Server.

Method Details

Hide inherited methods

addCheck() public method

public addCheck( string $table, string $name, string $expression ): string
$table string
$name string
$expression string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function addCheck(string $table, string $name, string $expression): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
addCommentOnColumn() public method

public addCommentOnColumn( string $table, string $column, string $comment ): string
$table string
$column string
$comment string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function addCommentOnColumn(string $table, string $column, string $comment): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
addCommentOnTable() public method

public addCommentOnTable( string $table, string $comment ): string
$table string
$comment string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function addCommentOnTable(string $table, string $comment): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
addDefaultValue() public method

public addDefaultValue( string $table, string $name, string $column, mixed $value ): string
$table string
$name string
$column string
$value mixed
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function addDefaultValue(string $table, string $name, string $column, mixed $value): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
addForeignKey() public method

public addForeignKey( string $table, string $name, array|string $columns, string $referenceTable, array|string $referenceColumns, string|null $delete null, string|null $update null ): string
$table string
$name string
$columns array|string
$referenceTable string
$referenceColumns array|string
$delete string|null
$update string|null
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function addForeignKey(
    string $table,
    string $name,
    array|string $columns,
    string $referenceTable,
    array|string $referenceColumns,
    ?string $delete = null,
    ?string $update = null,
): string {
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
addPrimaryKey() public method

public addPrimaryKey( string $table, string $name, array|string $columns ): string
$table string
$name string
$columns array|string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function addPrimaryKey(string $table, string $name, array|string $columns): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
addUnique() public method

public addUnique( string $table, string $name, array|string $columns ): string
$table string
$name string
$columns array|string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function addUnique(string $table, string $name, array|string $columns): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
alterColumn() public method

public alterColumn( string $table, string $column, \Yiisoft\Db\Schema\Column\ColumnInterface|string $type ): string
$table string
$column string
$type \Yiisoft\Db\Schema\Column\ColumnInterface|string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function alterColumn(string $table, string $column, ColumnInterface|string $type): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
checkIntegrity() public method

public checkIntegrity( string $schema '', string $table '', boolean $check true ): string
$schema string
$table string
$check boolean

                public function checkIntegrity(string $schema = '', string $table = '', bool $check = true): string
{
    return 'PRAGMA foreign_keys=' . (int) $check;
}

            
createIndex() public method

public createIndex( string $table, string $name, array|string $columns, string|null $indexType null, string|null $indexMethod null ): string
$table string
$name string
$columns array|string
$indexType string|null
$indexMethod string|null

                public function createIndex(
    string $table,
    string $name,
    array|string $columns,
    ?string $indexType = null,
    ?string $indexMethod = null,
): string {
    $tableParts = explode('.', $table);
    $schema = null;
    if (count($tableParts) === 2) {
        [$schema, $table] = $tableParts;
    }
    return 'CREATE ' . (!empty($indexType) ? $indexType . ' ' : '') . 'INDEX '
        . $this->quoter->quoteTableName((!empty($schema) ? $schema . '.' : '') . $name)
        . ' ON '
        . $this->quoter->quoteTableName($table)
        . ' (' . $this->queryBuilder->buildColumns($columns) . ')';
}

            
dropCheck() public method

public dropCheck( string $table, string $name ): string
$table string
$name string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function dropCheck(string $table, string $name): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
dropColumn() public method

public dropColumn( string $table, string $column ): string
$table string
$column string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function dropColumn(string $table, string $column): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
dropCommentFromColumn() public method

public dropCommentFromColumn( string $table, string $column ): string
$table string
$column string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function dropCommentFromColumn(string $table, string $column): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
dropCommentFromTable() public method

public dropCommentFromTable( string $table ): string
$table string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function dropCommentFromTable(string $table): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
dropDefaultValue() public method

public dropDefaultValue( string $table, string $name ): string
$table string
$name string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function dropDefaultValue(string $table, string $name): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
dropForeignKey() public method

public dropForeignKey( string $table, string $name ): string
$table string
$name string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function dropForeignKey(string $table, string $name): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
dropIndex() public method

public dropIndex( string $table, string $name ): string
$table string
$name string

                public function dropIndex(string $table, string $name): string
{
    return 'DROP INDEX ' . $this->quoter->quoteTableName($name);
}

            
dropPrimaryKey() public method

public dropPrimaryKey( string $table, string $name ): string
$table string
$name string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function dropPrimaryKey(string $table, string $name): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
dropTable() public method

public dropTable( string $table, boolean $ifExists false, boolean $cascade false ): string
$table string
$ifExists boolean
$cascade boolean
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support cascade drop table.

                public function dropTable(string $table, bool $ifExists = false, bool $cascade = false): string
{
    if ($cascade) {
        throw new NotSupportedException('SQLite doesn\'t support cascade drop table.');
    }
    return parent::dropTable($table, $ifExists, false);
}

            
dropUnique() public method

public dropUnique( string $table, string $name ): string
$table string
$name string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function dropUnique(string $table, string $name): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
renameColumn() public method

public renameColumn( string $table, string $oldName, string $newName ): string
$table string
$oldName string
$newName string
throws \Yiisoft\Db\Exception\NotSupportedException

SQLite doesn't support this method.

                public function renameColumn(string $table, string $oldName, string $newName): string
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by SQLite.');
}

            
renameTable() public method

public renameTable( string $oldName, string $newName ): string
$oldName string
$newName string

                public function renameTable(string $oldName, string $newName): string
{
    return 'ALTER TABLE '
        . $this->quoter->quoteTableName($oldName)
        . ' RENAME TO '
        . $this->quoter->quoteTableName($newName);
}

            
truncateTable() public method

public truncateTable( string $table ): string
$table string

                public function truncateTable(string $table): string
{
    return 'DELETE FROM ' . $this->quoter->quoteTableName($table);
}