Skip to content

Commit b15801e

Browse files
authored
Remove PDO folders in subpackages (#112)
1 parent 5d5f157 commit b15801e

6 files changed

Lines changed: 22 additions & 28 deletions

File tree

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22

33
declare(strict_types=1);
44

5-
namespace Yiisoft\Db\Sqlite\PDO;
5+
namespace Yiisoft\Db\Sqlite;
66

77
use PDOException;
88
use Throwable;
9-
use Yiisoft\Db\Driver\PDO\CommandPDO;
9+
use Yiisoft\Db\Driver\PDO\CommandPDO as AbstractCommandPDO;
1010
use Yiisoft\Db\Exception\ConvertException;
1111
use Yiisoft\Db\Exception\Exception;
1212
use Yiisoft\Db\Exception\InvalidArgumentException;
1313
use Yiisoft\Db\QueryBuilder\QueryBuilderInterface;
1414
use Yiisoft\Db\Schema\SchemaInterface;
15-
use Yiisoft\Db\Sqlite\SqlToken;
16-
use Yiisoft\Db\Sqlite\SqlTokenizer;
1715
use Yiisoft\Strings\StringHelper;
1816

1917
use function array_pop;
@@ -22,7 +20,7 @@
2220
use function preg_match_all;
2321
use function strpos;
2422

25-
final class CommandPDOSqlite extends CommandPDO
23+
final class CommandPDO extends AbstractCommandPDO
2624
{
2725
/**
2826
* @inheritDoc
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,25 @@
22

33
declare(strict_types=1);
44

5-
namespace Yiisoft\Db\Sqlite\PDO;
5+
namespace Yiisoft\Db\Sqlite;
66

77
use PDO;
88
use Yiisoft\Db\Driver\PDO\CommandPDOInterface;
9-
use Yiisoft\Db\Driver\PDO\ConnectionPDO;
9+
use Yiisoft\Db\Driver\PDO\ConnectionPDO as AbstractConnectionPDO;
1010
use Yiisoft\Db\Exception\Exception;
1111
use Yiisoft\Db\Exception\InvalidConfigException;
1212
use Yiisoft\Db\QueryBuilder\QueryBuilderInterface;
1313
use Yiisoft\Db\Schema\Quoter;
1414
use Yiisoft\Db\Schema\QuoterInterface;
1515
use Yiisoft\Db\Schema\SchemaInterface;
16-
use Yiisoft\Db\Sqlite\Schema;
1716
use Yiisoft\Db\Transaction\TransactionInterface;
1817

1918
use function strncmp;
2019

2120
/**
2221
* Database connection class prefilled for SQLite Server.
2322
*/
24-
final class ConnectionPDOSqlite extends ConnectionPDO
23+
final class ConnectionPDO extends AbstractConnectionPDO
2524
{
2625
/**
2726
* Reset the connection after cloning.
@@ -38,7 +37,7 @@ public function __clone()
3837

3938
public function createCommand(?string $sql = null, array $params = []): CommandPDOInterface
4039
{
41-
$command = new CommandPDOSqlite($this, $this->queryCache);
40+
$command = new CommandPDO($this, $this->queryCache);
4241

4342
if ($sql !== null) {
4443
$command->setSql($sql);
@@ -57,7 +56,7 @@ public function createCommand(?string $sql = null, array $params = []): CommandP
5756

5857
public function createTransaction(): TransactionInterface
5958
{
60-
return new TransactionPDOSqlite($this);
59+
return new TransactionPDO($this);
6160
}
6261

6362
/**
@@ -66,7 +65,7 @@ public function createTransaction(): TransactionInterface
6665
public function getQueryBuilder(): QueryBuilderInterface
6766
{
6867
if ($this->queryBuilder === null) {
69-
$this->queryBuilder = new QueryBuilderPDOSqlite(
68+
$this->queryBuilder = new QueryBuilder(
7069
$this->getQuoter(),
7170
$this->getSchema(),
7271
);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Yiisoft\Db\Sqlite\PDO;
5+
namespace Yiisoft\Db\Sqlite;
66

77
use PDO;
88
use Yiisoft\Db\Driver\PDO\PDODriver as AbstractPDODriver;
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22

33
declare(strict_types=1);
44

5-
namespace Yiisoft\Db\Sqlite\PDO;
5+
namespace Yiisoft\Db\Sqlite;
66

7-
use Yiisoft\Db\QueryBuilder\QueryBuilder;
7+
use Yiisoft\Db\QueryBuilder\QueryBuilder as AbstractQueryBuilder;
88
use Yiisoft\Db\Schema\QuoterInterface;
99
use Yiisoft\Db\Schema\Schema;
1010
use Yiisoft\Db\Schema\SchemaInterface;
11-
use Yiisoft\Db\Sqlite\DDLQueryBuilder;
12-
use Yiisoft\Db\Sqlite\DMLQueryBuilder;
13-
use Yiisoft\Db\Sqlite\DQLQueryBuilder;
1411

15-
final class QueryBuilderPDOSqlite extends QueryBuilder
12+
final class QueryBuilder extends AbstractQueryBuilder
1613
{
1714
/**
1815
* @var array mapping from abstract column types (keys) to physical column types (values).
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
declare(strict_types=1);
44

5-
namespace Yiisoft\Db\Sqlite\PDO;
5+
namespace Yiisoft\Db\Sqlite;
66

77
use Throwable;
8-
use Yiisoft\Db\Driver\PDO\TransactionPDO;
8+
use Yiisoft\Db\Driver\PDO\TransactionPDO as AbstractTransactionPDO;
99
use Yiisoft\Db\Exception\Exception;
1010
use Yiisoft\Db\Exception\InvalidConfigException;
1111
use Yiisoft\Db\Exception\NotSupportedException;
1212
use Yiisoft\Db\Transaction\TransactionInterface;
1313

14-
final class TransactionPDOSqlite extends TransactionPDO
14+
final class TransactionPDO extends AbstractTransactionPDO
1515
{
1616
/**
1717
* Sets the isolation level of the current transaction.

tests/TestCase.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
use Exception;
88
use PHPUnit\Framework\TestCase as AbstractTestCase;
9-
use Yiisoft\Db\Sqlite\PDO\PDODriver;
10-
use Yiisoft\Db\Sqlite\PDO\ConnectionPDOSqlite;
9+
use Yiisoft\Db\Sqlite\PDODriver;
10+
use Yiisoft\Db\Sqlite\ConnectionPDO;
1111
use Yiisoft\Db\TestSupport\TestTrait;
1212

1313
class TestCase extends AbstractTestCase
@@ -22,21 +22,21 @@ class TestCase extends AbstractTestCase
2222
protected array $dataProvider;
2323
protected string $likeEscapeCharSql = '';
2424
protected array $likeParameterReplacements = [];
25-
protected ConnectionPDOSqlite $db;
25+
protected ConnectionPDO $db;
2626

2727
/**
2828
* @param bool $reset whether to clean up the test database.
2929
*
30-
* @return ConnectionPDOSqlite
30+
* @return ConnectionPDO
3131
*/
3232
protected function getConnection(
3333
$reset = false,
3434
string $dsn = 'sqlite:' . __DIR__ . '/Runtime/yiitest.sq3',
3535
string $fixture = __DIR__ . '/Fixture/sqlite.sql'
36-
): ConnectionPDOSqlite {
36+
): ConnectionPDO {
3737
$this->dsn = $dsn;
3838
$pdoDriver = new PDODriver($this->dsn, $this->username, $this->password);
39-
$this->db = new ConnectionPDOSqlite($pdoDriver, $this->createQueryCache(), $this->createSchemaCache());
39+
$this->db = new ConnectionPDO($pdoDriver, $this->createQueryCache(), $this->createSchemaCache());
4040
$this->db->setLogger($this->createLogger());
4141
$this->db->setProfiler($this->createProfiler());
4242

0 commit comments

Comments
 (0)