Spaces:
Sleeping
Sleeping
Download src/modules/skill/ports/repository.py from dellweb3/VibeCoding: direct link, hf CLI and curl.
- Browser
- Download file 687 Bytes
-
https://huggingface.co/spaces/dellweb3/VibeCoding/resolve/main/src/modules/skill/ports/repository.py
- Command line
-
hf download hf://spaces/dellweb3/VibeCoding/src/modules/skill/ports/repository.py
-
curl -L -o repository.py https://huggingface.co/spaces/dellweb3/VibeCoding/resolve/main/src/modules/skill/ports/repository.py
687 Bytes
| """Persistence port; SQL dialect and connection management belong to adapters.""" | |
| from typing import Protocol, ContextManager | |
| class Transaction(Protocol): | |
| def get(self, tenant: str, kind: str, key: str) -> dict | None: ... | |
| def listing(self, tenant: str, kind: str) -> list[dict]: ... | |
| def create(self, tenant: str, kind: str, key: str, body: dict) -> dict: ... | |
| def update(self, tenant: str, kind: str, key: str, body: dict, expected_revision: int) -> dict: ... | |
| def audit(self, tenant: str, user: str, action: str, target: str, digest: str): ... | |
| class SkillRepository(Protocol): | |
| def transaction(self, *, write: bool = False) -> ContextManager[Transaction]: ... | |