def _get_repository_url(conf, suite_name, test_dir):
    """Return the repository_url for the input parameters.

    Returns
    -------
    repository_url: str
        SQLAlchemy URL for the repository in use.

    """

    db_type = conf.getoption("--database-backend")
    if db_type == "sqlite":
        repository_url = "sqlite:///{test_dir}/{suite}.db".format(
            test_dir=test_dir, suite=suite_name)
    elif db_type == "postgresql":
        repository_url = (
            "postgresql://{user}:{password}@{host}:{port}/{database}".format(
                user=conf.getoption("--database-user-postgresql"),
                password=conf.getoption("--database-password-postgresql"),
                host=conf.getoption("--database-host-postgresql"),
                port=conf.getoption("--database-port-postgresql"),
                database=conf.getoption("--database-name-postgresql"))
        )
    else:
        raise NotImplementedError
    return repository_url