Removed another database oversight.
This commit is contained in:
parent
971e76d93b
commit
f860ca0287
1 changed files with 0 additions and 28 deletions
|
@ -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);
|
||||
}
|
||||
}
|
Reference in a new issue