apexdevkit 1.32.8__tar.gz → 1.33.1__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.32.8 → apexdevkit-1.33.1}/PKG-INFO +1 -1
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/sql/connector.py +7 -6
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/sql/mssql.py +5 -3
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/sql/sqlite.py +5 -3
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/pyproject.toml +1 -1
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/LICENSE +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/README.md +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/__init__.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/annotation/__init__.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/annotation/deprecate.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/date.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/environment.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/error.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/fastapi/__init__.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/fastapi/builder.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/fastapi/dependable.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/fastapi/docs.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/fastapi/name.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/fastapi/resource.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/fastapi/response.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/fastapi/router.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/fastapi/schema.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/fastapi/service.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/fluent.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/formatter.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/http/__init__.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/http/fake.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/http/fluent.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/http/httpx/__init__.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/http/httpx/client.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/http/httpx/hooks.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/http/json.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/http/url.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/key_fn.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/py.typed +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/query/__init__.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/query/generator.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/query/query.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/__init__.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/core/__init__.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/core/database.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/core/decorator.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/core/interface.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/core/mixin.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/core/multi.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/in_memory/__init__.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/in_memory/mixin.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/in_memory/repository.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/in_memory/store.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/sql/__init__.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/repository/sql/field.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/security/__init__.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/security/core.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/security/hashing.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/server.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/sync/__init__.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/sync/observer.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/sync/source.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/sync/sync.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/sync/target.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/testing/__init__.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/testing/database.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/testing/fake.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/testing/rest.py +0 -0
- {apexdevkit-1.32.8 → apexdevkit-1.33.1}/apexdevkit/value.py +0 -0
|
@@ -8,13 +8,14 @@ from typing import Any
|
|
|
8
8
|
|
|
9
9
|
import pymssql
|
|
10
10
|
|
|
11
|
+
from apexdevkit.environment import environment_variable
|
|
11
12
|
from apexdevkit.repository import Connection
|
|
12
13
|
from apexdevkit.repository.core.database import ConnectionContextManager
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
@dataclass(frozen=True)
|
|
16
17
|
class SqliteFileConnector:
|
|
17
|
-
dsn: str
|
|
18
|
+
dsn: str = environment_variable("DSN")
|
|
18
19
|
|
|
19
20
|
def connect(self) -> AbstractContextManager[Connection]:
|
|
20
21
|
connection = sqlite3.connect(self.dsn)
|
|
@@ -40,12 +41,12 @@ class SqliteInMemoryConnector:
|
|
|
40
41
|
|
|
41
42
|
@dataclass(frozen=True)
|
|
42
43
|
class MsSqlConnector:
|
|
43
|
-
db_host: str
|
|
44
|
-
db_user: str
|
|
45
|
-
db_password: str
|
|
46
|
-
db_name: str
|
|
44
|
+
db_host: str = environment_variable("DB_HOST")
|
|
45
|
+
db_user: str = environment_variable("DB_USER")
|
|
46
|
+
db_password: str = environment_variable("DB_PASSWORD")
|
|
47
|
+
db_name: str = environment_variable("DB_NAME")
|
|
48
|
+
db_port: str = environment_variable("DB_PORT", default="1433")
|
|
47
49
|
db_tds_version = "7.0"
|
|
48
|
-
db_port: str = "1433"
|
|
49
50
|
|
|
50
51
|
def connect(self) -> AbstractContextManager[Connection]:
|
|
51
52
|
return ConnectionContextManager(self._connection())
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from collections.abc import Iterable, Iterator, Mapping
|
|
4
|
-
from dataclasses import dataclass
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
5
|
from typing import Any, Generic
|
|
6
6
|
|
|
7
7
|
from pymssql.exceptions import DatabaseError, OperationalError
|
|
@@ -16,14 +16,16 @@ from apexdevkit.repository.core import (
|
|
|
16
16
|
Repository,
|
|
17
17
|
)
|
|
18
18
|
|
|
19
|
+
from .connector import MsSqlConnector
|
|
19
20
|
from .field import NotNone, SqlFieldManager, _SqlField
|
|
20
21
|
|
|
21
22
|
|
|
22
|
-
@dataclass
|
|
23
|
+
@dataclass(frozen=True, kw_only=True)
|
|
23
24
|
class MsSqlRepository(ContainsMixin[ItemT], Repository[ItemT]):
|
|
24
|
-
db: Database
|
|
25
25
|
table: SqlTable[ItemT]
|
|
26
26
|
|
|
27
|
+
db: Database = field(default_factory=lambda: Database(connector=MsSqlConnector()))
|
|
28
|
+
|
|
27
29
|
def __iter__(self) -> Iterator[ItemT]:
|
|
28
30
|
for raw in self.db.execute(self.table.select_all()).fetch_all():
|
|
29
31
|
yield self.table.load(raw)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from collections.abc import Iterable, Iterator, Mapping
|
|
4
|
-
from dataclasses import dataclass
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
5
|
from sqlite3 import IntegrityError
|
|
6
6
|
from typing import Any, Generic
|
|
7
7
|
|
|
@@ -15,14 +15,16 @@ from apexdevkit.repository.core import (
|
|
|
15
15
|
Repository,
|
|
16
16
|
)
|
|
17
17
|
|
|
18
|
+
from .connector import SqliteFileConnector
|
|
18
19
|
from .field import NotNone, SqlFieldManager, _SqlField
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
@dataclass(frozen=True)
|
|
22
|
+
@dataclass(frozen=True, kw_only=True)
|
|
22
23
|
class SqliteRepository(ContainsMixin[ItemT], Repository[ItemT]):
|
|
23
|
-
db: Database
|
|
24
24
|
table: SqlTable[ItemT]
|
|
25
25
|
|
|
26
|
+
db: Database = field(default_factory=lambda: Database(SqliteFileConnector()))
|
|
27
|
+
|
|
26
28
|
def __iter__(self) -> Iterator[ItemT]:
|
|
27
29
|
for raw in self.db.execute(self.table.select_all()).fetch_all():
|
|
28
30
|
yield self.table.load(raw)
|
|
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
|
|
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
|