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 string addCheck ( string $table, string $name, string $expression )
$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 string addCommentOnColumn ( string $table, string $column, string $comment )
$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 string addCommentOnTable ( string $table, string $comment )
$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 string addDefaultValue ( string $table, string $name, string $column, mixed $value )
$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 string addForeignKey ( string $table, string $name, array|string $columns, string $referenceTable, array|string $referenceColumns, string|null $delete null, string|null $update null )
$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 string addPrimaryKey ( string $table, string $name, array|string $columns )
$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 string addUnique ( string $table, string $name, array|string $columns )
$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 string alterColumn ( string $table, string $column, \Yiisoft\Db\Schema\Column\ColumnInterface|string $type )
$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 string checkIntegrity ( string $schema '', string $table '', boolean $check true )
$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 string createIndex ( string $table, string $name, array|string $columns, string|null $indexType null, string|null $indexMethod null )
$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 string dropCheck ( string $table, string $name )
$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 string dropColumn ( string $table, string $column )
$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 string dropCommentFromColumn ( string $table, string $column )
$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 string dropCommentFromTable ( string $table )
$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 string dropDefaultValue ( string $table, string $name )
$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 string dropForeignKey ( string $table, string $name )
$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 string dropIndex ( string $table, string $name )
$table string
$name string

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

            
dropPrimaryKey() public method

public string dropPrimaryKey ( string $table, string $name )
$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 string dropTable ( string $table, boolean $ifExists false, boolean $cascade false )
$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 string dropUnique ( string $table, string $name )
$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 string renameColumn ( string $table, string $oldName, string $newName )
$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 string renameTable ( string $oldName, string $newName )
$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 string truncateTable ( string $table )
$table string

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