• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tito10047 / migration-backup / 22959989813

11 Mar 2026 03:19PM UTC coverage: 66.667%. First build
22959989813

Pull #1

github

web-flow
Merge 24800b128 into d2a2e5117
Pull Request #1: V2

108 of 165 new or added lines in 14 files covered. (65.45%)

120 of 180 relevant lines covered (66.67%)

2.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.78
/src/Driver/SqliteBackupDriver.php
1
<?php
2

3
namespace Tito10047\MigrationBackup\Driver;
4

5
use Symfony\Component\Filesystem\Filesystem;
6
use Tito10047\MigrationBackup\Dto\ConnectionParams;
7
use Tito10047\MigrationBackup\Exception\BackupFailedException;
8

9
class SqliteBackupDriver implements BackupDriverInterface {
10
        public function __construct(
11
                private readonly Filesystem $fs
12
        ) {}
10✔
13

14
        public function supports(string $driverName): bool {
15
                return $driverName === 'pdo_sqlite' || $driverName === 'sqlite3';
4✔
16
        }
17

18
        public function dump(ConnectionParams $params, string $outputPath): void {
19
                if ($params->path === null) {
8✔
20
                        throw new BackupFailedException("SQLite path is not defined");
2✔
21
                }
22

23
                if (!$this->fs->exists($params->path)) {
6✔
24
                        // maybe database is not yet created, so we create an empty file if needed or throw exception
25
                        // but usually we want to backup existing database
26
                        throw new BackupFailedException("SQLite database file not found at " . $params->path);
2✔
27
                }
28

29
                try {
30
                        $this->fs->copy($params->path, $outputPath, true);
4✔
NEW
31
                } catch (\Exception $e) {
×
NEW
32
                        throw new BackupFailedException("Failed to copy SQLite database: " . $e->getMessage(), 0, $e);
×
33
                }
34
        }
35
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc