Adding top-level Scopes table
This commit is contained in:
1 parent
bc8b67d585
commit
3febc15a8f
11 files changed
+470
-1
No files matched your search
@@ -17,6 +17,20 @@ async def get_by_augmented_part(
|
||||
return result.scalar_one_or_none()
|
||||
|
||||
|
||||
async def list_by_augmented_parts(
|
||||
db: AsyncSession, augmented_part_ids: list[int]
|
||||
) -> list[ScopeInfo]:
|
||||
"""ScopeInfo rows for the given augmented parts, fetched in one query."""
|
||||
if not augmented_part_ids:
|
||||
return []
|
||||
result = await db.execute(
|
||||
select(ScopeInfo).where(
|
||||
ScopeInfo.augmented_part_id.in_(augmented_part_ids)
|
||||
)
|
||||
)
|
||||
return list(result.scalars().all())
|
||||
|
||||
|
||||
async def create(
|
||||
db: AsyncSession,
|
||||
*,
|
||||
|
||||
Reference in new issue
Block a user