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

Method find_by_id

src/core/db/repository.py:132–139  ·  view source on GitHub ↗
(
        self,
        uid: Any,
    )

Source from the content-addressed store, hash-verified

130 return obj
131
132 async def find_by_id(
133 self,
134 uid: Any,
135 ) -> T | None:
136 query = select(self._model).where(getattr(self._model, self._id_field) == uid)
137 async with self.get_session() as session:
138 result = await session.execute(query)
139 return result.scalar_one_or_none()
140
141 async def create(self, data: dict[str, Any] | T) -> T:
142 if isinstance(data, dict):

Callers 2

get_by_idMethod · 0.95
deleteMethod · 0.95

Calls 2

get_sessionMethod · 0.95
executeMethod · 0.45

Tested by

no test coverage detected