apexdevkit 1.12.1__tar.gz → 1.12.3__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.12.1 → apexdevkit-1.12.3}/PKG-INFO +1 -1
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/repository/base.py +2 -2
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/repository/decorator.py +4 -6
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/repository/interface.py +3 -1
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/repository/mongo.py +3 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/repository/sqlite.py +12 -9
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/pyproject.toml +1 -1
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/LICENSE +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/README.md +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/__init__.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/annotation/__init__.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/annotation/deprecate.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/environment.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/error.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/fastapi/__init__.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/fastapi/builder.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/fastapi/dependable.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/fastapi/docs.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/fastapi/resource.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/fastapi/response.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/fastapi/router.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/fastapi/schema.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/fastapi/service.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/fluent.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/formatter.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/http/__init__.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/http/fake.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/http/fluent.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/http/httpx.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/http/json.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/http/url.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/py.typed +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/repository/__init__.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/repository/connector.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/repository/database.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/repository/in_memory.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/testing/__init__.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/testing/database.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/testing/fake.py +0 -0
- {apexdevkit-1.12.1 → apexdevkit-1.12.3}/apexdevkit/testing/rest.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from typing import Any, Generic, Iterator
|
|
2
2
|
|
|
3
|
-
from apexdevkit.repository.interface import IdT, ItemT
|
|
3
|
+
from apexdevkit.repository.interface import IdT, ItemT, Repository
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class RepositoryBase(Generic[IdT, ItemT]): # pragma: no cover
|
|
@@ -22,7 +22,7 @@ class RepositoryBase(Generic[IdT, ItemT]): # pragma: no cover
|
|
|
22
22
|
def delete(self, item_id: IdT) -> None:
|
|
23
23
|
raise NotImplementedError
|
|
24
24
|
|
|
25
|
-
def bind(self, **kwargs: Any) ->
|
|
25
|
+
def bind(self, **kwargs: Any) -> Repository[IdT, ItemT]:
|
|
26
26
|
raise NotImplementedError
|
|
27
27
|
|
|
28
28
|
def __iter__(self) -> Iterator[ItemT]:
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import Iterator
|
|
3
3
|
|
|
4
|
-
from apexdevkit.repository import
|
|
5
|
-
|
|
6
|
-
ItemT = TypeVar("ItemT")
|
|
7
|
-
IdT = TypeVar("IdT", contravariant=True)
|
|
4
|
+
from apexdevkit.repository.base import RepositoryBase
|
|
5
|
+
from apexdevkit.repository.interface import IdT, ItemT, Repository
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
@dataclass
|
|
11
|
-
class RepositoryDecorator(
|
|
9
|
+
class RepositoryDecorator(RepositoryBase[IdT, ItemT]):
|
|
12
10
|
inner: Repository[IdT, ItemT]
|
|
13
11
|
|
|
14
12
|
def create(self, item: ItemT) -> ItemT:
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
from typing import Any, Iterator, Protocol, TypeVar
|
|
2
4
|
|
|
3
5
|
ItemT = TypeVar("ItemT")
|
|
@@ -23,7 +25,7 @@ class Repository(Protocol[IdT, ItemT]): # pragma: no cover
|
|
|
23
25
|
def delete(self, item_id: IdT) -> None:
|
|
24
26
|
pass
|
|
25
27
|
|
|
26
|
-
def bind(self, **kwargs: Any) ->
|
|
28
|
+
def bind(self, **kwargs: Any) -> Repository[IdT, ItemT]:
|
|
27
29
|
pass
|
|
28
30
|
|
|
29
31
|
def __iter__(self) -> Iterator[ItemT]:
|
|
@@ -80,6 +80,9 @@ class MongoRepository(Generic[ItemT]):
|
|
|
80
80
|
if result.deleted_count == 0:
|
|
81
81
|
raise DoesNotExistError(item_id)
|
|
82
82
|
|
|
83
|
+
def bind(self, **kwargs: Any) -> None:
|
|
84
|
+
pass
|
|
85
|
+
|
|
83
86
|
|
|
84
87
|
class MongoConnector(Protocol): # pragma: no cover
|
|
85
88
|
def connect(self) -> ContextManager[MongoClient[Any]]:
|
|
@@ -62,32 +62,35 @@ class SqliteRepository(RepositoryBase[IdT, ItemT]):
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
class SqlTable(Generic[ItemT]): # pragma: no cover
|
|
65
|
+
def bind(self, **kwargs: Any) -> SqlTable[ItemT]:
|
|
66
|
+
return self
|
|
67
|
+
|
|
65
68
|
def count_all(self) -> DatabaseCommand:
|
|
66
|
-
raise NotImplementedError
|
|
69
|
+
raise NotImplementedError
|
|
67
70
|
|
|
68
71
|
def insert(self, item: ItemT) -> DatabaseCommand:
|
|
69
|
-
raise NotImplementedError
|
|
72
|
+
raise NotImplementedError
|
|
70
73
|
|
|
71
74
|
def select(self, item_id: str) -> DatabaseCommand:
|
|
72
|
-
raise NotImplementedError
|
|
75
|
+
raise NotImplementedError
|
|
73
76
|
|
|
74
77
|
def select_duplicate(self, item: ItemT) -> DatabaseCommand:
|
|
75
|
-
raise NotImplementedError
|
|
78
|
+
raise NotImplementedError
|
|
76
79
|
|
|
77
80
|
def select_all(self) -> DatabaseCommand:
|
|
78
|
-
raise NotImplementedError
|
|
81
|
+
raise NotImplementedError
|
|
79
82
|
|
|
80
83
|
def update(self, item: ItemT) -> DatabaseCommand:
|
|
81
|
-
raise NotImplementedError
|
|
84
|
+
raise NotImplementedError
|
|
82
85
|
|
|
83
86
|
def delete(self, item_id: str) -> DatabaseCommand:
|
|
84
|
-
raise NotImplementedError
|
|
87
|
+
raise NotImplementedError
|
|
85
88
|
|
|
86
89
|
def delete_all(self) -> DatabaseCommand:
|
|
87
|
-
raise NotImplementedError
|
|
90
|
+
raise NotImplementedError
|
|
88
91
|
|
|
89
92
|
def load(self, data: dict[str, Any]) -> ItemT:
|
|
90
|
-
raise NotImplementedError
|
|
93
|
+
raise NotImplementedError
|
|
91
94
|
|
|
92
95
|
def duplicate(self, item: ItemT) -> ExistsError:
|
|
93
96
|
return ExistsError(item).with_duplicate(lambda i: "Unknown")
|
|
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
|