def set_database_condition(query: str, database: str) ->str:
    """Replaces a placeholder in a query with a condition restricting results to a certain database"""
    if not database:
        modified_query = query.replace(':DB_CONDITION', 'TRUE')
    else:
        modified_query = query.replace(':DB_CONDITION', 'db.name = :database')
    return modified_query
