def set_uri(
    user,
    pswd,
    dbname,
    ip="pgdb-musicfox-musicfox-083b.aivencloud.com",
    port=25398,
    extras="sslmode=require",
):
    """
    Set the database uri given credential data and others.

    This works for our databases at aiven.io.

    """
    if not user:
        raise AttributeError("You need to set your MFDB_USER env variable.")

    if not pswd:
        raise AttributeError(
            "You need to set your MFDB_PASSWORD env variable."
        )

    return f"postgres+psycopg2://{user}:{pswd}@{ip}:{port}/{dbname}?{extras}"