

def get_columns(self, table, schema='public'):
    query = '\n            SELECT column_name, is_nullable, data_type\n            FROM information_schema.columns\n            WHERE table_name = %s AND table_schema = %s\n            ORDER BY ordinal_position'
    cursor = self.execute_sql(query, (table, schema))
    pks = set(self.get_primary_keys(table, schema))
    return [ColumnMetadata(name, dt, (null == 'YES'), (name in pks), table) for (name, null, dt) in cursor.fetchall()]

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