Removed another database oversight.

This commit is contained in:
flash 2024-08-27 03:25:42 +00:00
parent 971e76d93b
commit f860ca0287

View file

@ -1,28 +0,0 @@
<?php
namespace Satori;
use Index\Data\IDbConnection;
use Index\Data\Migration\{IDbMigrationRepo,DbMigrationManager,FsDbMigrationRepo};
class DatabaseContext {
public function __construct(
private IDbConnection $connection
) {}
public function getConnection(): IDbConnection {
return $this->connection;
}
public function getQueryCount(): int {
$result = $this->connection->query('SHOW SESSION STATUS LIKE "Questions"');
return $result->next() ? $result->getInteger(1) : 0;
}
public function createMigrationManager(): DbMigrationManager {
return new DbMigrationManager($this->connection);
}
public function createMigrationRepo(): IDbMigrationRepo {
return new FsDbMigrationRepo(SAT_DIR_MIGRATIONS);
}
}