'Return ``True`` if the given sequence (generator) exists.'

def has_sequence(self, connection, sequence_name, schema=None):

    genqry = '\n                                SELECT    1    AS    has_sequence    FROM    rdb$database\n                                WHERE    EXISTS    (SELECT    rdb$generator_name\n                                                                                        FROM    rdb$generators\n                                                                                        WHERE    rdb$generator_name=?)\n                                '
    c = connection.execute(genqry, [self.denormalize_name(sequence_name)])
    return (c.first() is not None)
