MCPcopy Create free account
hub / github.com/dbunt1tled/python-fast-api / count

Method count

src/core/db/repository.py:260–268  ·  view source on GitHub ↗
(self, filters: list[Filter] | None = None)

Source from the content-addressed store, hash-verified

258 return result.scalar_one_or_none()
259
260 async def count(self, filters: list[Filter] | None = None) -> int:
261 query = select(func.count()).select_from(self._model)
262
263 if filters:
264 query = self._apply_filters(query, filters)
265
266 async with self.get_session() as session:
267 result = await session.execute(query)
268 return result.scalar() or 0
269
270 async def exists(self, filters: list[Filter]) -> bool:
271 query = select(1)

Callers 1

find_allMethod · 0.80

Calls 3

_apply_filtersMethod · 0.95
get_sessionMethod · 0.95
executeMethod · 0.45

Tested by

no test coverage detected