apexdevkit 1.8.5__tar.gz → 1.8.7__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.8.5 → apexdevkit-1.8.7}/PKG-INFO +1 -1
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/repository/database.py +1 -1
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/repository/sqlite.py +3 -13
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/pyproject.toml +1 -1
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/LICENSE +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/README.md +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/__init__.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/annotation/__init__.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/annotation/deprecate.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/error.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/fastapi/__init__.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/fastapi/builder.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/fastapi/dependable.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/fastapi/docs.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/fastapi/resource.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/fastapi/response.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/fastapi/router.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/fastapi/schema.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/fastapi/service.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/formatter.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/http/__init__.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/http/fake.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/http/fluent.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/http/httpx.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/http/json.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/http/url.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/py.typed +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/repository/__init__.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/repository/base.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/repository/connector.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/repository/in_memory.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/repository/interface.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/testing/__init__.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/testing/database.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/testing/fake.py +0 -0
- {apexdevkit-1.8.5 → apexdevkit-1.8.7}/apexdevkit/testing/rest.py +0 -0
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from sqlite3 import IntegrityError
|
|
5
|
-
from typing import Any, Callable, Generic, Iterator,
|
|
5
|
+
from typing import Any, Callable, Generic, Iterator, TypeVar
|
|
6
6
|
|
|
7
7
|
from apexdevkit.error import DoesNotExistError, ExistsError
|
|
8
8
|
from apexdevkit.repository import Database, DatabaseCommand
|
|
@@ -36,17 +36,7 @@ class SqliteRepository(Generic[ItemT]):
|
|
|
36
36
|
return item
|
|
37
37
|
|
|
38
38
|
def create_many(self, items: list[ItemT]) -> list[ItemT]:
|
|
39
|
-
|
|
40
|
-
for item in items:
|
|
41
|
-
try:
|
|
42
|
-
result.append(
|
|
43
|
-
self.table.load(
|
|
44
|
-
self.db.execute(self.table.insert(item)).fetch_one()
|
|
45
|
-
)
|
|
46
|
-
)
|
|
47
|
-
except IntegrityError: # pragma: no cover
|
|
48
|
-
ExistsError(item).with_duplicate(self.duplicate_criteria).fire()
|
|
49
|
-
return result
|
|
39
|
+
return [self.create(item) for item in items]
|
|
50
40
|
|
|
51
41
|
def read(self, item_id: str) -> ItemT:
|
|
52
42
|
raw = self.db.execute(self.table.select(item_id)).fetch_one()
|
|
@@ -70,7 +60,7 @@ class SqliteRepository(Generic[ItemT]):
|
|
|
70
60
|
self.db.execute(self.table.delete_all()).fetch_none()
|
|
71
61
|
|
|
72
62
|
|
|
73
|
-
class SqlTable(
|
|
63
|
+
class SqlTable(Generic[ItemT]): # pragma: no cover
|
|
74
64
|
def count_all(self) -> DatabaseCommand:
|
|
75
65
|
raise NotImplementedError("Not implemented")
|
|
76
66
|
|
|
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
|