apexdevkit 1.11.4__tar.gz → 1.12.2__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.11.4 → apexdevkit-1.12.2}/PKG-INFO +1 -1
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/repository/decorator.py +4 -1
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/repository/mongo.py +3 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/repository/sqlite.py +8 -9
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/pyproject.toml +1 -1
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/LICENSE +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/README.md +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/__init__.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/annotation/__init__.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/annotation/deprecate.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/environment.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/error.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/fastapi/__init__.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/fastapi/builder.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/fastapi/dependable.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/fastapi/docs.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/fastapi/resource.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/fastapi/response.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/fastapi/router.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/fastapi/schema.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/fastapi/service.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/fluent.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/formatter.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/http/__init__.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/http/fake.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/http/fluent.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/http/httpx.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/http/json.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/http/url.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/py.typed +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/repository/__init__.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/repository/base.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/repository/connector.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/repository/database.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/repository/in_memory.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/repository/interface.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/testing/__init__.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/testing/database.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/testing/fake.py +0 -0
- {apexdevkit-1.11.4 → apexdevkit-1.12.2}/apexdevkit/testing/rest.py +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
|
-
from typing import Generic, Iterator, TypeVar
|
|
2
|
+
from typing import Any, Generic, Iterator, TypeVar
|
|
3
3
|
|
|
4
4
|
from apexdevkit.repository import Repository
|
|
5
5
|
|
|
@@ -29,6 +29,9 @@ class RepositoryDecorator(Generic[IdT, ItemT]):
|
|
|
29
29
|
def delete(self, item_id: IdT) -> None:
|
|
30
30
|
self.inner.delete(item_id)
|
|
31
31
|
|
|
32
|
+
def bind(self, **kwargs: Any) -> None:
|
|
33
|
+
self.inner.bind(**kwargs)
|
|
34
|
+
|
|
32
35
|
def __iter__(self) -> Iterator[ItemT]:
|
|
33
36
|
return self.inner.__iter__()
|
|
34
37
|
|
|
@@ -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]]:
|
|
@@ -2,16 +2,15 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from sqlite3 import IntegrityError
|
|
5
|
-
from typing import Any, Generic, Iterator
|
|
5
|
+
from typing import Any, Generic, Iterator
|
|
6
6
|
|
|
7
7
|
from apexdevkit.error import DoesNotExistError, ExistsError
|
|
8
|
-
from apexdevkit.repository import Database, DatabaseCommand
|
|
9
|
-
|
|
10
|
-
ItemT = TypeVar("ItemT")
|
|
8
|
+
from apexdevkit.repository import Database, DatabaseCommand, RepositoryBase
|
|
9
|
+
from apexdevkit.repository.interface import IdT, ItemT
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
@dataclass
|
|
14
|
-
class SqliteRepository(
|
|
13
|
+
class SqliteRepository(RepositoryBase[IdT, ItemT]):
|
|
15
14
|
db: Database
|
|
16
15
|
table: SqlTable[ItemT]
|
|
17
16
|
|
|
@@ -40,8 +39,8 @@ class SqliteRepository(Generic[ItemT]):
|
|
|
40
39
|
def create_many(self, items: list[ItemT]) -> list[ItemT]:
|
|
41
40
|
return [self.create(item) for item in items]
|
|
42
41
|
|
|
43
|
-
def read(self, item_id:
|
|
44
|
-
raw = self.db.execute(self.table.select(item_id)).fetch_one()
|
|
42
|
+
def read(self, item_id: IdT) -> ItemT:
|
|
43
|
+
raw = self.db.execute(self.table.select(str(item_id))).fetch_one()
|
|
45
44
|
|
|
46
45
|
if not raw:
|
|
47
46
|
raise DoesNotExistError(item_id)
|
|
@@ -55,8 +54,8 @@ class SqliteRepository(Generic[ItemT]):
|
|
|
55
54
|
for item in items:
|
|
56
55
|
self.update(item)
|
|
57
56
|
|
|
58
|
-
def delete(self, item_id:
|
|
59
|
-
self.db.execute(self.table.delete(item_id)).fetch_none()
|
|
57
|
+
def delete(self, item_id: IdT) -> None:
|
|
58
|
+
self.db.execute(self.table.delete(str(item_id))).fetch_none()
|
|
60
59
|
|
|
61
60
|
def delete_all(self) -> None:
|
|
62
61
|
self.db.execute(self.table.delete_all()).fetch_none()
|
|
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
|