sqlalchemy_async_repositories.interfaces¶
Repository interface definitions.
Attributes¶
Classes¶
Base repository interface for common database operations. |
Module Contents¶
- sqlalchemy_async_repositories.interfaces.T¶
- class sqlalchemy_async_repositories.interfaces.IRepository¶
Bases:
abc.ABC,Generic[T]Base repository interface for common database operations.
- abstract get_by_id(entity_id: Any) T | None¶
- Async:
Get entity by ID.
- abstract create(entity: T) T¶
- Async:
Create new entity.
- abstract update(entity: T) T¶
- Async:
Update existing entity.
- abstract delete(entity_id: Any) bool¶
- Async:
Delete entity by ID.
- abstract get_all(limit: int | None = None, offset: int = 0) List[T]¶
- Async:
Get all entities with optional pagination.
- abstract exists(entity_id: Any) bool¶
- Async:
Check if entity exists by ID.
- abstract count() int¶
- Async:
Get total count of entities.