code: def count_star(self) -> int:
          
          count_query = (self.statement.with_only_columns([func.count()])
                         .order_by(None))
          return self.session.execute(count_query).scalar()
docs: Implements the ``COUNT(*)`` specialization.