MCPcopy
hub / github.com/dataelement/Clawith / get

Method get

backend/app/dao/base.py:39–47  ·  view source on GitHub ↗

Fetch a single record by its primary key ID.

(self, id: Any)

Source from the content-addressed store, hash-verified

37 _session_ctx.reset(token)
38
39 async def get(self, id: Any) -> ModelType | None:
40 """Fetch a single record by its primary key ID."""
41 async with self.session() as db:
42 if hasattr(db, "get"):
43 return await db.get(self.model, id)
44 # Fallback for custom mock DB clients in tests
45 stmt = select(self.model).where(self.model.id == id)
46 result = await db.execute(stmt)
47 return result.scalar_one_or_none()
48
49 async def is_empty(self) -> bool:
50 """Check if the table is empty (no records)."""

Callers 15

AppFunction · 0.45
ChannelConfigFunction · 0.45
ActivityFeedFunction · 0.45
DashboardFunction · 0.45
PlazaFunction · 0.45
CompanySetupFunction · 0.45
LayoutFunction · 0.45
LoginFunction · 0.45
AgentCreateFunction · 0.45
OnboardingFunction · 0.45
VerifyEmailFunction · 0.45
SSOEntryFunction · 0.45

Calls 4

sessionMethod · 0.95
whereMethod · 0.80
executeMethod · 0.45
scalar_one_or_noneMethod · 0.45

Tested by 2

test_connectionFunction · 0.36
test_atlassian_channelFunction · 0.36