0 follower

Final Class Yiisoft\Db\Oracle\DDLQueryBuilder

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

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

Method Details

Hide inherited methods

addDefaultValue() public method

public addDefaultValue( string $table, string $name, string $column, mixed $value ): string
$table string
$name string
$column string
$value mixed

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

            
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

                public function addForeignKey(
    string $table,
    string $name,
    array|string $columns,
    string $referenceTable,
    array|string $referenceColumns,
    ?string $delete = null,
    ?string $update = null,
): string {
    $sql = 'ALTER TABLE ' . $this->quoter->quoteTableName($table)
        . ' ADD CONSTRAINT ' . $this->quoter->quoteColumnName($name)
        . ' FOREIGN KEY (' . $this->queryBuilder->buildColumns($columns) . ')'
        . ' REFERENCES ' . $this->quoter->quoteTableName($referenceTable)
        . ' (' . $this->queryBuilder->buildColumns($referenceColumns) . ')';
    if ($delete !== null) {
        $sql .= ' ON DELETE ' . $delete;
    }
    if ($update !== null) {
        throw new Exception('Oracle does not support ON UPDATE clause.');
    }
    return $sql;
}

            
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

                public function alterColumn(string $table, string $column, ColumnInterface|string $type): string
{
    return 'ALTER TABLE '
        . $this->quoter->quoteTableName($table)
        . ' MODIFY '
        . $this->quoter->quoteColumnName($column)
        . ' ' . $this->queryBuilder->buildColumnDefinition($type);
}

            
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
{
    throw new NotSupportedException(__METHOD__ . ' is not supported by Oracle.');
}

            
dropCommentFromColumn() public method

public dropCommentFromColumn( string $table, string $column ): string
$table string
$column string

                public function dropCommentFromColumn(string $table, string $column): string
{
    return 'COMMENT ON COLUMN '
        . $this->quoter->quoteTableName($table)
        . '.'
        . $this->quoter->quoteColumnName($column)
        . " IS ''";
}

            
dropCommentFromTable() public method

public dropCommentFromTable( string $table ): string
$table string

                public function dropCommentFromTable(string $table): string
{
    return 'COMMENT ON TABLE ' . $this->quoter->quoteTableName($table) . " IS ''";
}

            
dropDefaultValue() public method

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

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

            
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);
}

            
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

Oracle doesn't support "IF EXISTS" option on drop table.

                public function dropTable(string $table, bool $ifExists = false, bool $cascade = false): string
{
    if ($ifExists) {
        throw new NotSupportedException('Oracle doesn\'t support "IF EXISTS" option on drop table.');
    }
    return 'DROP TABLE '
        . $this->quoter->quoteTableName($table)
        . ($cascade ? ' CASCADE CONSTRAINTS' : '');
}

            
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);
}