apexdevkit 1.9.7__tar.gz → 1.9.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/PKG-INFO +1 -1
- apexdevkit-1.9.8/apexdevkit/repository/decorator.py +36 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/pyproject.toml +1 -1
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/LICENSE +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/README.md +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/__init__.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/annotation/__init__.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/annotation/deprecate.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/error.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/fastapi/__init__.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/fastapi/builder.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/fastapi/dependable.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/fastapi/docs.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/fastapi/resource.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/fastapi/response.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/fastapi/router.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/fastapi/schema.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/fastapi/service.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/fluent.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/formatter.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/http/__init__.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/http/fake.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/http/fluent.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/http/httpx.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/http/json.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/http/url.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/py.typed +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/repository/__init__.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/repository/base.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/repository/connector.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/repository/database.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/repository/in_memory.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/repository/interface.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/repository/mongo.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/repository/sqlite.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/testing/__init__.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/testing/database.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/testing/fake.py +0 -0
- {apexdevkit-1.9.7 → apexdevkit-1.9.8}/apexdevkit/testing/rest.py +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import Generic, Iterator, TypeVar
|
|
3
|
+
|
|
4
|
+
from apexdevkit.repository import Repository
|
|
5
|
+
|
|
6
|
+
ItemT = TypeVar("ItemT")
|
|
7
|
+
IdT = TypeVar("IdT", contravariant=True)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class RepositoryDecorator(Generic[IdT, ItemT]):
|
|
12
|
+
inner: Repository[IdT, ItemT]
|
|
13
|
+
|
|
14
|
+
def create(self, item: ItemT) -> ItemT:
|
|
15
|
+
return self.inner.create(item)
|
|
16
|
+
|
|
17
|
+
def create_many(self, items: list[ItemT]) -> list[ItemT]:
|
|
18
|
+
return self.inner.create_many(items)
|
|
19
|
+
|
|
20
|
+
def read(self, item_id: IdT) -> ItemT:
|
|
21
|
+
return self.inner.read(item_id)
|
|
22
|
+
|
|
23
|
+
def update(self, item: ItemT) -> None:
|
|
24
|
+
self.inner.update(item)
|
|
25
|
+
|
|
26
|
+
def update_many(self, items: list[ItemT]) -> None:
|
|
27
|
+
self.inner.update_many(items)
|
|
28
|
+
|
|
29
|
+
def delete(self, item_id: IdT) -> None:
|
|
30
|
+
self.inner.delete(item_id)
|
|
31
|
+
|
|
32
|
+
def __iter__(self) -> Iterator[ItemT]:
|
|
33
|
+
return self.inner.__iter__()
|
|
34
|
+
|
|
35
|
+
def __len__(self) -> int:
|
|
36
|
+
return self.inner.__len__()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|