

def distinct_pks(self):
    with self.backend.transaction():
        s = self.get_bare_select(columns=[self.table.c.pk])
        result = self.backend.connection.execute(s)
        return set([r[0] for r in result.fetchall()])

dataset/ETHPy150Open adewes/blitzdb/blitzdb/backends/sql/queryset.py QuerySet.distinct_pks/original