feat: add get_item method to BaseRepository with tests, examples and docs

This commit is contained in:
2026-08-14 20:13:00 +03:00
parent 7abb513b30
commit 1608b00708
8 changed files with 111 additions and 2 deletions

View File

@@ -78,6 +78,10 @@ async def main() -> None:
print(f"Orders: {[(order.user_id, order.total) for order in orders]}")
print(f"Orders count: {len(orders)}")
# Get single user by name
single_user = await user_repo.get_item(filter_=UserFilter(name="Alice"))
print(f"Single user: {single_user.name if single_user else None}")
if __name__ == "__main__":
asyncio.run(main())