protected function getExecutedMigrationRepository(IContainer $container) : IExecutedMigrationRepository
    {
        $driverClass = getenv('DB_DRIVER') ?: PostgreSqlDriver::class;

        switch ($driverClass) {
            case MySqlDriver::class:
                $queryBuilder = new MySqlQueryBuilder();
                $container->bindInstance(MySqlQueryBuilder::class, $queryBuilder);
                break;
            case PostgreSqlDriver::class:
                $queryBuilder = new PostgreSqlQueryBuilder();
                $container->bindInstance(PostgreSqlQueryBuilder::class, $queryBuilder);
                break;
            default:
                throw new RuntimeException(
                    "Invalid database driver type specified in environment var \"DB_DRIVER\": $driverClass"
                );
        }

        $container->bindInstance(BaseQueryBuilder::class, $queryBuilder);

        return new SqlExecutedMigrationRepository(
            SqlExecutedMigrationRepository::DEFAULT_TABLE_NAME,
            $container->resolve(IConnection::class),
            $queryBuilder,
            new TypeMapperFactory()
        );
    }