Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ColumnInterface #296

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@
- New #292: Override `QueryBuilder::prepareBinary()` method (@Tigrov)
- Chg #294: Update `QueryBuilder` constructor (@Tigrov)
- Enh #293: Use `ColumnDefinitionBuilder` to generate table column SQL representation (@Tigrov)
- Enh #296: Remove `ColumnInterface` (@Tigrov)

## 1.3.0 March 21, 2024

55 changes: 0 additions & 55 deletions src/Column.php

This file was deleted.

3 changes: 1 addition & 2 deletions src/DDLQueryBuilder.php
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@
use Yiisoft\Db\Exception\Exception;
use Yiisoft\Db\Exception\NotSupportedException;
use Yiisoft\Db\QueryBuilder\AbstractDDLQueryBuilder;
use Yiisoft\Db\Schema\Builder\ColumnInterface;
use Yiisoft\Db\Schema\Column\ColumnSchemaInterface;

/**
@@ -46,7 +45,7 @@ public function addForeignKey(
return $sql;
}

public function alterColumn(string $table, string $column, ColumnInterface|ColumnSchemaInterface|string $type): string
public function alterColumn(string $table, string $column, ColumnSchemaInterface|string $type): string
{
return 'ALTER TABLE '
. $this->quoter->quoteTableName($table)
31 changes: 0 additions & 31 deletions src/QueryBuilder.php
Original file line number Diff line number Diff line change
@@ -5,8 +5,6 @@
namespace Yiisoft\Db\Oracle;

use Yiisoft\Db\Connection\ServerInfoInterface;
use Yiisoft\Db\Constant\ColumnType;
use Yiisoft\Db\Constant\PseudoType;
use Yiisoft\Db\Oracle\Column\ColumnDefinitionBuilder;
use Yiisoft\Db\QueryBuilder\AbstractQueryBuilder;
use Yiisoft\Db\Schema\QuoterInterface;
@@ -19,35 +17,6 @@
*/
final class QueryBuilder extends AbstractQueryBuilder
{
/**
* @psalm-var string[] $typeMap Mapping from abstract column types (keys) to physical column types (values).
*/
protected array $typeMap = [
PseudoType::PK => 'NUMBER(10) GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY',
PseudoType::UPK => 'NUMBER(10) GENERATED BY DEFAULT AS IDENTITY UNSIGNED NOT NULL PRIMARY KEY',
PseudoType::BIGPK => 'NUMBER(20) GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY',
PseudoType::UBIGPK => 'NUMBER(20) GENERATED BY DEFAULT AS IDENTITY UNSIGNED NOT NULL PRIMARY KEY',
ColumnType::CHAR => 'CHAR(1)',
ColumnType::STRING => 'VARCHAR2(255)',
ColumnType::TEXT => 'CLOB',
ColumnType::TINYINT => 'NUMBER(3)',
ColumnType::SMALLINT => 'NUMBER(5)',
ColumnType::INTEGER => 'NUMBER(10)',
ColumnType::BIGINT => 'NUMBER(20)',
ColumnType::FLOAT => 'BINARY_FLOAT',
ColumnType::DOUBLE => 'BINARY_DOUBLE',
ColumnType::DECIMAL => 'NUMBER(10,0)',
ColumnType::DATETIME => 'TIMESTAMP(0)',
ColumnType::TIMESTAMP => 'TIMESTAMP(0)',
ColumnType::TIME => 'INTERVAL DAY(0) TO SECOND(0)',
ColumnType::DATE => 'DATE',
ColumnType::BINARY => 'BLOB',
ColumnType::BOOLEAN => 'NUMBER(1)',
ColumnType::MONEY => 'NUMBER(19,4)',
ColumnType::UUID => 'RAW(16)',
PseudoType::UUID_PK => 'RAW(16) DEFAULT SYS_GUID() PRIMARY KEY',
];

public function __construct(QuoterInterface $quoter, SchemaInterface $schema, ServerInfoInterface $serverInfo)
{
parent::__construct(
8 changes: 0 additions & 8 deletions src/Schema.php
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
use Yiisoft\Db\Exception\NotSupportedException;
use Yiisoft\Db\Helper\DbArrayHelper;
use Yiisoft\Db\Oracle\Column\ColumnFactory;
use Yiisoft\Db\Schema\Builder\ColumnInterface;
use Yiisoft\Db\Schema\Column\ColumnFactoryInterface;
use Yiisoft\Db\Schema\Column\ColumnSchemaInterface;
use Yiisoft\Db\Schema\TableSchemaInterface;
@@ -70,13 +69,6 @@ public function __construct(protected ConnectionInterface $db, SchemaCache $sche
parent::__construct($db, $schemaCache);
}

/** @deprecated Use {@see ColumnBuilder} instead. Will be removed in 2.0. */
public function createColumn(string $type, array|int|string $length = null): ColumnInterface
{
/** @psalm-suppress DeprecatedClass */
return new Column($type, $length);
}

public function getColumnFactory(): ColumnFactoryInterface
{
return new ColumnFactory();
26 changes: 0 additions & 26 deletions tests/ColumnSchemaBuilderTest.php

This file was deleted.

25 changes: 0 additions & 25 deletions tests/Provider/ColumnSchemaBuilderProvider.php

This file was deleted.