return the 'count'. Equivalent to :meth:`_query.Query.count`. Note this uses a subquery to ensure an accurate count regardless of the structure of the original statement.
(self)
| 407 | return result |
| 408 | |
| 409 | def count(self): |
| 410 | """return the 'count'. |
| 411 | |
| 412 | Equivalent to :meth:`_query.Query.count`. |
| 413 | |
| 414 | Note this uses a subquery to ensure an accurate count regardless |
| 415 | of the structure of the original statement. |
| 416 | |
| 417 | """ |
| 418 | |
| 419 | col = func.count(literal_column("*")) |
| 420 | bq = self.bq.with_criteria(lambda q: q._legacy_from_self(col)) |
| 421 | return bq.for_session(self.session).params(self._params).scalar() |
| 422 | |
| 423 | def scalar(self): |
| 424 | """Return the first element of the first result or None |
nothing calls this directly
no test coverage detected