python-neva 1.0.0__tar.gz → 1.0.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.
- {python_neva-1.0.0 → python_neva-1.0.2}/PKG-INFO +1 -1
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/database/provider.py +10 -5
- {python_neva-1.0.0 → python_neva-1.0.2}/pyproject.toml +1 -1
- {python_neva-1.0.0 → python_neva-1.0.2}/uv.lock +1 -1
- {python_neva-1.0.0 → python_neva-1.0.2}/.envrc +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/.gitignore +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/.pre-commit-config.yaml +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/.python-version +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/README.md +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/arch/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/arch/app.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/arch/application.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/arch/config.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/arch/facade.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/arch/faststream.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/arch/service_provider.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/config/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/config/base_providers.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/config/loader.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/config/provider.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/config/repository.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/database/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/database/config.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/database/connection.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/database/manager.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/database/transaction.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/events/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/events/dispatcher.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/events/event.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/events/event_registry.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/events/listener.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/events/provider.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/obs/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/obs/logging/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/obs/logging/manager.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/obs/logging/provider.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/obs/middleware/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/obs/middleware/correlation.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/obs/middleware/profiler.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/py.typed +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/encryption/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/encryption/encrypter.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/encryption/protocol.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/hashing/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/hashing/config.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/hashing/hash_manager.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/hashing/hashers/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/hashing/hashers/argon2.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/hashing/hashers/bcrypt.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/hashing/hashers/protocol.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/provider.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/tokens/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/tokens/generate_token.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/tokens/hash_token.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/security/tokens/verify_token.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/accessors.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/app.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/app.pyi +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/config.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/config.pyi +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/crypt.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/crypt.pyi +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/db.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/db.pyi +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/event.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/event.pyi +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/hash.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/hash.pyi +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/log.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/facade/log.pyi +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/results.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/strategy.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/strconv.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/support/time.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/testing/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/testing/fixtures.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/testing/http.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/neva/testing/test_case.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/ruff.toml +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/arch/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/arch/test_scope.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/config/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/config/test_loader.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/config/test_repository.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/conftest.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/database/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/database/conftest.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/database/test_connection_manager.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/database/test_database_manager.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/database/test_edge_cases.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/database/test_multi_connection.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/database/test_transaction.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/database/test_transaction_context.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/database/test_transaction_registry.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/events/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/events/conftest.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/events/test_deferred.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/events/test_dispatch.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/events/test_function_listener.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/events/test_immediate.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/obs/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/obs/test_correlation.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/obs/test_profiler.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/security/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/security/test_encrypter.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/security/test_hash_manager.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/testing/__init__.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/testing/test_fixtures.py +0 -0
- {python_neva-1.0.0 → python_neva-1.0.2}/tests/testing/test_test_case.py +0 -0
|
@@ -4,13 +4,14 @@ from collections.abc import AsyncIterator
|
|
|
4
4
|
from contextlib import asynccontextmanager
|
|
5
5
|
from typing import Self, override
|
|
6
6
|
|
|
7
|
-
from tortoise import Tortoise
|
|
7
|
+
from tortoise import Tortoise, exceptions
|
|
8
8
|
|
|
9
9
|
from neva import Err, Ok, Result
|
|
10
10
|
from neva.arch import ServiceProvider
|
|
11
|
+
from neva.config.repository import ConfigRepository
|
|
11
12
|
from neva.database.connection import TransactionContext
|
|
12
13
|
from neva.database.manager import DatabaseManager
|
|
13
|
-
from neva.
|
|
14
|
+
from neva.obs import LogManager
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
class DatabaseServiceProvider(ServiceProvider):
|
|
@@ -25,11 +26,15 @@ class DatabaseServiceProvider(ServiceProvider):
|
|
|
25
26
|
@asynccontextmanager
|
|
26
27
|
async def lifespan(self) -> AsyncIterator[None]:
|
|
27
28
|
"""Initialize and cleanup database connections."""
|
|
28
|
-
match
|
|
29
|
+
match self.app.make(ConfigRepository).unwrap().get("database"):
|
|
29
30
|
case Ok(config):
|
|
30
|
-
|
|
31
|
+
try:
|
|
32
|
+
await Tortoise.init(config=config, _create_db=True)
|
|
33
|
+
except exceptions.OperationalError:
|
|
34
|
+
await Tortoise.init(config=config)
|
|
31
35
|
yield
|
|
32
36
|
await Tortoise.close_connections()
|
|
33
37
|
case Err(err):
|
|
34
|
-
|
|
38
|
+
logger = self.app.make(LogManager).unwrap()
|
|
39
|
+
logger.error(f"Failed to load database configuration: {err}")
|
|
35
40
|
yield
|
|
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
|
|
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
|