

def sequence_exists(self, sequence):
    res = self.execute_sql("\n            SELECT COUNT(*) FROM pg_class, pg_namespace\n            WHERE relkind='S'\n                AND pg_class.relnamespace = pg_namespace.oid\n                AND relname=%s", (sequence,))
    return bool(res.fetchone()[0])

dataset/ETHPy150Open coleifer/peewee/peewee.py PostgresqlDatabase.sequence_exists/original