def get_relation_count_query(self, query, parent):
        query.select(QueryExpression('COUNT(*)'))

        other_key = self.wrap('%s.%s' % (query.get_model().get_table(), self._other_key))

        return query.where(self.get_qualified_foreign_key(), '=', QueryExpression(other_key))
ensure 'IF NOT EXISTS' exists in statement when in batch
dataset/ETHPy150Open sdispater/orator/orator/orm/relations/belongs_to.py/BelongsTo.get_relation_count_query--crossover with--dataset/ETHPy150Open datastax/python-driver/tests/integration/cqlengine/test_ifnotexists.py/IfNotExistsModelTest.test_batch_if_not_exists