diff --git a/CHANGELOG.md b/CHANGELOG.md index 86f60ce1..a3343f60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Enh #263: Support json type (@Tigrov) - Bug #268: Fix foreign keys: support multiple foreign keys referencing to one table and possible null columns for reference (@Tigrov) - Bug #271: Refactor `DMLQueryBuilder`, related with yiisoft/db#746 (@Tigrov) +- Enh #278: Move methods from `Command` to `AbstractPdoCommand` class (@Tigrov) ## 1.0.1 July 24, 2023 diff --git a/src/Command.php b/src/Command.php index f73ca139..aa8176dc 100644 --- a/src/Command.php +++ b/src/Command.php @@ -4,13 +4,10 @@ namespace Yiisoft\Db\Sqlite; -use PDOException; use Throwable; use Yiisoft\Db\Driver\Pdo\AbstractPdoCommand; -use Yiisoft\Db\Exception\ConvertException; use Yiisoft\Db\Exception\Exception; use Yiisoft\Db\Exception\InvalidArgumentException; -use Yiisoft\Db\QueryBuilder\QueryBuilderInterface; use function array_pop; use function count; @@ -60,11 +57,6 @@ public function showDatabases(): array return $this->setSql($sql)->queryColumn(); } - protected function getQueryBuilder(): QueryBuilderInterface - { - return $this->db->getQueryBuilder(); - } - /** * Executes the SQL statement. * @@ -105,43 +97,6 @@ public function execute(): int return $result; } - /** - * @psalm-suppress UnusedClosureParam - * - * @throws Throwable - */ - protected function internalExecute(string|null $rawSql): void - { - $attempt = 0; - - while (true) { - try { - if ( - ++$attempt === 1 - && $this->isolationLevel !== null - && $this->db->getTransaction() === null - ) { - $this->db->transaction( - function () use ($rawSql): void { - $this->internalExecute($rawSql); - }, - $this->isolationLevel, - ); - } else { - $this->pdoStatement?->execute(); - } - break; - } catch (PDOException $e) { - $rawSql = $rawSql ?: $this->getRawSql(); - $e = (new ConvertException($e, $rawSql))->run(); - - if ($this->retryHandler === null || !($this->retryHandler)($e, $attempt)) { - throw $e; - } - } - } - } - /** * Performs the actual DB query of an SQL statement. *