Skip to content

Commit

Permalink
Remove ColumnInterface (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov authored Jan 8, 2025
1 parent f926994 commit 79b33b3
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 144 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- New #328: Override `QueryBuilder::prepareBinary()` method (@Tigrov)
- Chg #330: Update `QueryBuilder` constructor (@Tigrov)
- Enh #329: Use `ColumnDefinitionBuilder` to generate table column SQL representation (@Tigrov)
- Enh #332: Remove `ColumnInterface` (@Tigrov)

## 1.2.0 March 21, 2024

Expand Down
52 changes: 0 additions & 52 deletions src/Column.php

This file was deleted.

32 changes: 0 additions & 32 deletions src/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
namespace Yiisoft\Db\Sqlite;

use Yiisoft\Db\Connection\ServerInfoInterface;
use Yiisoft\Db\Constant\ColumnType;
use Yiisoft\Db\Constant\PseudoType;
use Yiisoft\Db\QueryBuilder\AbstractQueryBuilder;
use Yiisoft\Db\Schema\QuoterInterface;
use Yiisoft\Db\Schema\SchemaInterface;
Expand All @@ -19,36 +17,6 @@
*/
final class QueryBuilder extends AbstractQueryBuilder
{
/**
* @var string[] Mapping from abstract column types (keys) to physical column types (values).
*/
protected array $typeMap = [
PseudoType::PK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
PseudoType::UPK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
PseudoType::BIGPK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
PseudoType::UBIGPK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
ColumnType::CHAR => 'char(1)',
ColumnType::STRING => 'varchar(255)',
ColumnType::TEXT => 'text',
ColumnType::TINYINT => 'tinyint',
ColumnType::SMALLINT => 'smallint',
ColumnType::INTEGER => 'integer',
ColumnType::BIGINT => 'bigint',
ColumnType::FLOAT => 'float',
ColumnType::DOUBLE => 'double',
ColumnType::DECIMAL => 'decimal(10,0)',
ColumnType::DATETIME => 'datetime',
ColumnType::TIMESTAMP => 'timestamp',
ColumnType::TIME => 'time',
ColumnType::DATE => 'date',
ColumnType::BINARY => 'blob',
ColumnType::BOOLEAN => 'boolean',
ColumnType::MONEY => 'decimal(19,4)',
ColumnType::UUID => 'blob(16)',
PseudoType::UUID_PK => 'blob(16) PRIMARY KEY',
ColumnType::JSON => 'json',
];

public function __construct(QuoterInterface $quoter, SchemaInterface $schema, ServerInfoInterface $serverInfo)
{
parent::__construct(
Expand Down
9 changes: 0 additions & 9 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
use Yiisoft\Db\Exception\InvalidConfigException;
use Yiisoft\Db\Exception\NotSupportedException;
use Yiisoft\Db\Helper\DbArrayHelper;
use Yiisoft\Db\Schema\Builder\ColumnInterface;
use Yiisoft\Db\Schema\Column\ColumnFactoryInterface;
use Yiisoft\Db\Schema\Column\ColumnSchemaInterface;
use Yiisoft\Db\Schema\TableSchemaInterface;
use Yiisoft\Db\Sqlite\Column\ColumnBuilder;
use Yiisoft\Db\Sqlite\Column\ColumnFactory;

use function array_change_key_case;
Expand Down Expand Up @@ -75,13 +73,6 @@
*/
final class Schema extends AbstractPdoSchema
{
/** @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();
Expand Down
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.

0 comments on commit 79b33b3

Please sign in to comment.