python-neva 1.0.2__py3-none-any.whl → 1.0.2.dev2__py3-none-any.whl
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.
neva/database/provider.py
CHANGED
|
@@ -26,15 +26,18 @@ class DatabaseServiceProvider(ServiceProvider):
|
|
|
26
26
|
@asynccontextmanager
|
|
27
27
|
async def lifespan(self) -> AsyncIterator[None]:
|
|
28
28
|
"""Initialize and cleanup database connections."""
|
|
29
|
+
logger = self.app.make(LogManager).unwrap()
|
|
29
30
|
match self.app.make(ConfigRepository).unwrap().get("database"):
|
|
30
31
|
case Ok(config):
|
|
31
32
|
try:
|
|
32
|
-
await Tortoise.init(
|
|
33
|
+
_ = await Tortoise.init(
|
|
34
|
+
config=config, _create_db=True, _enable_global_fallback=True
|
|
35
|
+
)
|
|
33
36
|
except exceptions.OperationalError:
|
|
34
|
-
await Tortoise.init(config=config)
|
|
37
|
+
_ = await Tortoise.init(config=config, _enable_global_fallback=True)
|
|
38
|
+
logger.info("Tortoise initialization complete.")
|
|
35
39
|
yield
|
|
36
40
|
await Tortoise.close_connections()
|
|
37
41
|
case Err(err):
|
|
38
|
-
logger = self.app.make(LogManager).unwrap()
|
|
39
42
|
logger.error(f"Failed to load database configuration: {err}")
|
|
40
43
|
yield
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-neva
|
|
3
|
-
Version: 1.0.2
|
|
3
|
+
Version: 1.0.2.dev2
|
|
4
4
|
Summary: Add your description here
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Requires-Dist: cryptography>=46.0.3
|
|
@@ -11,7 +11,7 @@ Requires-Dist: flexmock>=0.13.0
|
|
|
11
11
|
Requires-Dist: pwdlib[argon2,bcrypt]>=0.3.0
|
|
12
12
|
Requires-Dist: pyinstrument>=5.1.1
|
|
13
13
|
Requires-Dist: structlog>=25.5.0
|
|
14
|
-
Requires-Dist: tortoise-orm[accel]>=
|
|
14
|
+
Requires-Dist: tortoise-orm[accel]>=1.1.4
|
|
15
15
|
Requires-Dist: typer>=0.21.1
|
|
16
16
|
Provides-Extra: testing
|
|
17
17
|
Requires-Dist: pytest-asyncio>=0.25.3; extra == 'testing'
|
|
@@ -16,7 +16,7 @@ neva/database/__init__.py,sha256=DhWwKM_CEZqzJyj814ZFOorRJUcuGGwpuSm9oAateTc,424
|
|
|
16
16
|
neva/database/config.py,sha256=cQb_vt33q0eWkXyF83TMagYDkD7_fjk1hJ6W0v1p-QE,1251
|
|
17
17
|
neva/database/connection.py,sha256=82s2IncdG4ylP8c5HK34WkiipPptaAKGZ6auBNFxdXY,3770
|
|
18
18
|
neva/database/manager.py,sha256=lllj6IsSfHpV052UW1ZKQ2eZxJu-SQ7rgSb42AL-snU,1486
|
|
19
|
-
neva/database/provider.py,sha256=
|
|
19
|
+
neva/database/provider.py,sha256=iLmhpLgtIoRy2XpIM_RQEX6mc9gEAxqbPl9bkdh50KM,1580
|
|
20
20
|
neva/database/transaction.py,sha256=VcHK37dNjJOkq2ZMS0GjKX1Z8io3cQ7Gr4_kBNypbK0,3147
|
|
21
21
|
neva/events/__init__.py,sha256=xwIAXNcOASpuCY4DJpshZc1gtxQHimzwy-s7c-4QuiQ,746
|
|
22
22
|
neva/events/dispatcher.py,sha256=3xMhxE5uQBY7648jp75NkRwu09lqYo7ymmfSvnl6kT0,2850
|
|
@@ -72,6 +72,6 @@ neva/testing/__init__.py,sha256=H8Dc9JCFEggAWnsE2yg0u4yEtgBBhQXN1YdL0Ij3Fsw,117
|
|
|
72
72
|
neva/testing/fixtures.py,sha256=OZAZC9Onaw9ywxxwbQdeeTEAmF9qUH-BVFRG3h0ZMDc,1659
|
|
73
73
|
neva/testing/http.py,sha256=9oKNzaz38nCKkL-ZUF5CRWFPqpNmXkqbYcoukC509_Q,494
|
|
74
74
|
neva/testing/test_case.py,sha256=Vl78l-A75qqp6npSC9kSdCjK0nzm9M3ZLedfaPGLI6A,2024
|
|
75
|
-
python_neva-1.0.2.dist-info/METADATA,sha256=
|
|
76
|
-
python_neva-1.0.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
77
|
-
python_neva-1.0.2.dist-info/RECORD,,
|
|
75
|
+
python_neva-1.0.2.dev2.dist-info/METADATA,sha256=MvAWFKJwHFhzpeuYucn_6p5s-1ZbhLENEVPlGdS100o,600
|
|
76
|
+
python_neva-1.0.2.dev2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
77
|
+
python_neva-1.0.2.dev2.dist-info/RECORD,,
|
|
File without changes
|