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

Method create

src/core/db/repository.py:141–150  ·  view source on GitHub ↗
(self, data: dict[str, Any] | T)

Source from the content-addressed store, hash-verified

139 return result.scalar_one_or_none()
140
141 async def create(self, data: dict[str, Any] | T) -> T:
142 if isinstance(data, dict):
143 entity = self._model(**data)
144 else:
145 entity = data
146 async with self.get_session() as session:
147 session.add(entity)
148 await session.flush()
149 await session.refresh(entity)
150 return entity
151
152 async def update(
153 self,

Callers

nothing calls this directly

Calls 2

get_sessionMethod · 0.95
refreshMethod · 0.45

Tested by

no test coverage detected