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()
        );
    }
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()
        );
    }
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 ( ) ) ; }
Gets the executed migration repository to use in the migrator

@param IContainer $container The IoC container
@return IExecutedMigrationRepository The executed migration repository
@throws RuntimeException Thrown if there was an error resolving the query builder
Gets the executed migration repository to use in the migrator