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

@@ -54,6 +54,11 @@ async def main() -> None:
count = await repository.get_items_count()
print(f"Items after nested rollback: {count}") # 2
# Read single item inside a transaction
async with repository.transaction():
item = await repository.get_item(filter_=ProductFilter(name="Laptop"))
print(f"Single in transaction: {item.name if item else None}")
if __name__ == "__main__":
asyncio.run(main())