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

Method exists

src/core/db/repository.py:270–278  ·  view source on GitHub ↗
(self, filters: list[Filter])

Source from the content-addressed store, hash-verified

268 return result.scalar() or 0
269
270 async def exists(self, filters: list[Filter]) -> bool:
271 query = select(1)
272 query = query.select_from(self._model)
273 query = self._apply_filters(query, filters)
274 query = query.limit(1)
275
276 async with self.get_session() as session:
277 result = await session.execute(query)
278 return result.first() is not None
279
280 def _apply_filters(self, query: Select | Update | Delete, filters: list[Filter]) -> Select | Update | Delete:
281 conditions = []

Callers 2

send_emailMethod · 0.80
__init__Method · 0.80

Calls 3

_apply_filtersMethod · 0.95
get_sessionMethod · 0.95
executeMethod · 0.45

Tested by

no test coverage detected