neuroglia-python 0.6.22__tar.gz → 0.6.23__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.
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/PKG-INFO +1 -1
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/pyproject.toml +1 -1
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/__init__.py +1 -1
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/hosting/configuration/data_access_layer.py +98 -44
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/LICENSE +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/README.md +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/application/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/application/background_scheduler.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/coordination/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/coordination/abstractions.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/coordination/leader_election.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/coordination/redis_backend.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/core/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/core/module_loader.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/core/operation_result.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/core/problem_details.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/core/type_extensions.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/core/type_finder.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/core/type_registry.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/abstractions.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/exceptions.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/abstractions.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/event_sourcing/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/event_sourcing/abstractions.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/event_sourcing/event_sourcing_repository.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/event_sourcing/event_store/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/event_sourcing/event_store/event_store.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/event_sourcing/patches.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/event_sourcing/read_model_reconciliator.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/filesystem/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/filesystem/filesystem_repository.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/memory/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/memory/memory_repository.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/mongo/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/mongo/enhanced_mongo_repository.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/mongo/mongo_repository.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/mongo/motor_repository.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/mongo/serialization_helper.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/mongo/typed_mongo_query.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/resources/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/resources/in_memory_storage_backend.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/resources/postgres_resource_store.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/resources/redis_resource_store.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/resources/resource_repository.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/tracing_mixin.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/queries/generic/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/queries/generic/get_by_id_query.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/queries/generic/list_query.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/queryable.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/resources/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/resources/abstractions.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/resources/controller.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/resources/serializers/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/resources/serializers/xml_serializer.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/resources/serializers/yaml_serializer.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/resources/state_machine.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/resources/watcher.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/unit_of_work.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/dependency_injection/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/dependency_injection/service_provider.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/dependency_injection/service_provider_backup.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/eventing/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/eventing/cloud_events/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/eventing/cloud_events/cloud_event.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/eventing/cloud_events/decorators.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/eventing/cloud_events/infrastructure/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/eventing/cloud_events/infrastructure/cloud_event_bus.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/eventing/cloud_events/infrastructure/cloud_event_ingestor.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/eventing/cloud_events/infrastructure/cloud_event_middleware.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/eventing/cloud_events/infrastructure/cloud_event_publisher.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/eventing/tracing.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/expressions/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/expressions/javascript_expression_translator.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/extensions/cqrs_metrics_extensions.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/extensions/mediator_extensions.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/extensions/state_persistence_extensions.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/hosting/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/hosting/abstractions.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/hosting/web.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/integration/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/integration/cache_repository.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/integration/http_service_client.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/integration/models.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/logging/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/logging/logger.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mapping/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mapping/mapper.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mediation/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mediation/behaviors/domain_event_cloudevent_behavior.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mediation/behaviors/domain_event_dispatching_middleware.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mediation/mediator.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mediation/metrics_middleware.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mediation/pipeline_behavior.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mediation/simple.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mediation/tracing_middleware.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mvc/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mvc/controller_base.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/observability/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/observability/framework.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/observability/logging.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/observability/metrics.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/observability/otel_sdk.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/observability/settings.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/observability/tracing.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/py.typed +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/reactive/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/reactive/rx_async.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/serialization/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/serialization/abstractions.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/serialization/aggregate_serializer.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/serialization/json.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/utils/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/utils/camel_model.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/utils/case_conversion.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/validation/__init__.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/validation/business_rules.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/validation/exceptions.py +0 -0
- {neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/validation/validators.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "neuroglia-python"
|
|
3
|
-
version = "0.6.
|
|
3
|
+
version = "0.6.23"
|
|
4
4
|
description = "Port from .NET to Python of the Neuroglia Framework"
|
|
5
5
|
authors = ["Charles d'Avernas <charles.davernas@neuroglia.io>", "Bruno van de Werve <bvandewe@gmail.com>"]
|
|
6
6
|
license = "Apache"
|
|
@@ -146,16 +146,23 @@ class DataAccessLayer:
|
|
|
146
146
|
class ReadModel:
|
|
147
147
|
"""Represents a helper class used to configure an application's Read Model DAL
|
|
148
148
|
|
|
149
|
-
Supports
|
|
150
|
-
1. Simplified: Pass database_name
|
|
151
|
-
2.
|
|
149
|
+
Supports three configuration patterns:
|
|
150
|
+
1. Simplified Sync: Pass database_name with repository_type='mongo' (default)
|
|
151
|
+
2. Simplified Async: Pass database_name with repository_type='motor' for FastAPI
|
|
152
|
+
3. Custom: Pass custom repository_setup function to configure()
|
|
152
153
|
|
|
153
154
|
Examples:
|
|
154
|
-
# Simple configuration
|
|
155
|
+
# Simple synchronous configuration (default)
|
|
155
156
|
DataAccessLayer.ReadModel(database_name="myapp").configure(
|
|
156
157
|
builder, ["integration.models"]
|
|
157
158
|
)
|
|
158
159
|
|
|
160
|
+
# Async configuration with Motor for FastAPI
|
|
161
|
+
DataAccessLayer.ReadModel(
|
|
162
|
+
database_name="myapp",
|
|
163
|
+
repository_type='motor'
|
|
164
|
+
).configure(builder, ["integration.models"])
|
|
165
|
+
|
|
159
166
|
# Custom factory (advanced, backwards compatible)
|
|
160
167
|
def custom_setup(builder_, entity_type, key_type):
|
|
161
168
|
# Custom configuration logic
|
|
@@ -165,14 +172,34 @@ class DataAccessLayer:
|
|
|
165
172
|
)
|
|
166
173
|
"""
|
|
167
174
|
|
|
168
|
-
def __init__(self, database_name: Optional[str] = None):
|
|
175
|
+
def __init__(self, database_name: Optional[str] = None, repository_type: str = "mongo"):
|
|
169
176
|
"""Initialize ReadModel configuration
|
|
170
177
|
|
|
171
178
|
Args:
|
|
172
179
|
database_name: Optional database name for MongoDB repositories.
|
|
173
180
|
If not provided, custom repository_setup must be used.
|
|
181
|
+
repository_type: Type of repository to use ('mongo' or 'motor'). Defaults to 'mongo'.
|
|
182
|
+
- 'mongo': Use MongoRepository with PyMongo (synchronous driver)
|
|
183
|
+
- 'motor': Use MotorRepository with Motor (async driver for FastAPI)
|
|
184
|
+
|
|
185
|
+
Example:
|
|
186
|
+
```python
|
|
187
|
+
# Simplified sync configuration
|
|
188
|
+
DataAccessLayer.ReadModel(database_name="myapp").configure(...)
|
|
189
|
+
|
|
190
|
+
# Async configuration with Motor
|
|
191
|
+
DataAccessLayer.ReadModel(
|
|
192
|
+
database_name="myapp",
|
|
193
|
+
repository_type='motor'
|
|
194
|
+
).configure(...)
|
|
195
|
+
```
|
|
174
196
|
"""
|
|
175
197
|
self._database_name = database_name
|
|
198
|
+
self._repository_type = repository_type
|
|
199
|
+
|
|
200
|
+
# Validate repository_type
|
|
201
|
+
if repository_type not in ("mongo", "motor"):
|
|
202
|
+
raise ValueError(f"Invalid repository_type '{repository_type}'. " "Must be either 'mongo' (synchronous PyMongo) or 'motor' (async Motor)")
|
|
176
203
|
|
|
177
204
|
def configure(
|
|
178
205
|
self,
|
|
@@ -235,58 +262,85 @@ class DataAccessLayer:
|
|
|
235
262
|
if not self._database_name:
|
|
236
263
|
raise ValueError("Cannot configure Read Model with simplified API: " "database_name not provided. Either pass database_name to ReadModel() " "or use custom repository_setup function.")
|
|
237
264
|
|
|
238
|
-
from pymongo import MongoClient
|
|
239
|
-
|
|
240
265
|
from neuroglia.data.infrastructure.abstractions import (
|
|
241
266
|
QueryableRepository,
|
|
242
267
|
Repository,
|
|
243
268
|
)
|
|
244
|
-
from neuroglia.data.infrastructure.mongo.mongo_repository import (
|
|
245
|
-
MongoRepository,
|
|
246
|
-
MongoRepositoryOptions,
|
|
247
|
-
)
|
|
248
269
|
from neuroglia.dependency_injection import ServiceProvider
|
|
249
270
|
|
|
250
|
-
#
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
raise ValueError(f"Missing '{connection_string_name}' connection string in application settings")
|
|
271
|
+
# Configure based on repository type
|
|
272
|
+
if self._repository_type == "mongo":
|
|
273
|
+
# Synchronous MongoRepository configuration
|
|
274
|
+
from pymongo import MongoClient
|
|
255
275
|
|
|
256
|
-
|
|
257
|
-
|
|
276
|
+
from neuroglia.data.infrastructure.mongo.mongo_repository import (
|
|
277
|
+
MongoRepository,
|
|
278
|
+
MongoRepositoryOptions,
|
|
279
|
+
)
|
|
258
280
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
281
|
+
# Get MongoDB connection string
|
|
282
|
+
connection_string_name = "mongo"
|
|
283
|
+
connection_string = builder.settings.connection_strings.get(connection_string_name, None)
|
|
284
|
+
if connection_string is None:
|
|
285
|
+
raise ValueError(f"Missing '{connection_string_name}' connection string in application settings")
|
|
263
286
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
MongoRepositoryOptions[queryable_type, key_type], # type: ignore
|
|
267
|
-
singleton=MongoRepositoryOptions[queryable_type, key_type](self._database_name), # type: ignore
|
|
268
|
-
)
|
|
287
|
+
# Register MongoClient singleton (shared across all repositories)
|
|
288
|
+
builder.services.try_add_singleton(MongoClient, singleton=MongoClient(connection_string))
|
|
269
289
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
)
|
|
290
|
+
# Discover and configure each queryable type
|
|
291
|
+
for module in [ModuleLoader.load(module_name) for module_name in modules]:
|
|
292
|
+
for queryable_type in TypeFinder.get_types(module, lambda cls: inspect.isclass(cls) and hasattr(cls, "__queryable__")):
|
|
293
|
+
key_type = str # todo: reflect from DTO base type
|
|
275
294
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
295
|
+
# Register options for this entity type
|
|
296
|
+
builder.services.try_add_singleton(
|
|
297
|
+
MongoRepositoryOptions[queryable_type, key_type], # type: ignore
|
|
298
|
+
singleton=MongoRepositoryOptions[queryable_type, key_type](self._database_name), # type: ignore
|
|
299
|
+
)
|
|
280
300
|
|
|
281
|
-
|
|
301
|
+
# Register repository
|
|
302
|
+
builder.services.try_add_singleton(
|
|
303
|
+
Repository[queryable_type, key_type], # type: ignore
|
|
304
|
+
MongoRepository[queryable_type, key_type], # type: ignore
|
|
305
|
+
)
|
|
282
306
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
307
|
+
# Register queryable repository alias
|
|
308
|
+
def make_queryable_factory(qt, kt):
|
|
309
|
+
def queryable_factory(provider: ServiceProvider):
|
|
310
|
+
return provider.get_required_service(Repository[qt, kt]) # type: ignore
|
|
311
|
+
|
|
312
|
+
return queryable_factory
|
|
313
|
+
|
|
314
|
+
builder.services.try_add_singleton(
|
|
315
|
+
QueryableRepository[queryable_type, key_type], # type: ignore
|
|
316
|
+
implementation_factory=make_queryable_factory(queryable_type, key_type),
|
|
317
|
+
)
|
|
287
318
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
319
|
+
# Register query handlers
|
|
320
|
+
builder.services.add_transient(RequestHandler, GetByIdQueryHandler[queryable_type, key_type]) # type: ignore
|
|
321
|
+
builder.services.add_transient(RequestHandler, ListQueryHandler[queryable_type, key_type]) # type: ignore
|
|
322
|
+
|
|
323
|
+
elif self._repository_type == "motor":
|
|
324
|
+
# Async MotorRepository configuration using MotorRepository.configure()
|
|
325
|
+
from neuroglia.data.infrastructure.mongo.motor_repository import (
|
|
326
|
+
MotorRepository,
|
|
327
|
+
)
|
|
328
|
+
|
|
329
|
+
# Use MotorRepository.configure() for each discovered type
|
|
330
|
+
# Note: MotorRepository types are NOT queryable yet, so we scan for all classes
|
|
331
|
+
# (not just those with __queryable__ attribute)
|
|
332
|
+
# This configuration supports direct Repository[T, K] injection in handlers
|
|
333
|
+
for module in [ModuleLoader.load(module_name) for module_name in modules]:
|
|
334
|
+
for entity_type in TypeFinder.get_types(module, lambda cls: inspect.isclass(cls)):
|
|
335
|
+
key_type = str # todo: reflect from entity type
|
|
336
|
+
|
|
337
|
+
# Use MotorRepository's static configure method
|
|
338
|
+
# This handles AsyncIOMotorClient, repository registration, etc.
|
|
339
|
+
MotorRepository.configure(
|
|
340
|
+
builder=builder,
|
|
341
|
+
entity_type=entity_type,
|
|
342
|
+
key_type=key_type,
|
|
343
|
+
database_name=self._database_name,
|
|
344
|
+
)
|
|
291
345
|
|
|
292
346
|
return builder
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/coordination/abstractions.py
RENAMED
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/coordination/leader_election.py
RENAMED
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/coordination/redis_backend.py
RENAMED
|
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
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/infrastructure/__init__.py
RENAMED
|
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
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/queries/generic/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/queries/generic/list_query.py
RENAMED
|
File without changes
|
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/resources/__init__.py
RENAMED
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/resources/abstractions.py
RENAMED
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/resources/controller.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/data/resources/state_machine.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/dependency_injection/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/eventing/cloud_events/__init__.py
RENAMED
|
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
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/extensions/mediator_extensions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/integration/cache_repository.py
RENAMED
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/integration/http_service_client.py
RENAMED
|
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
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mediation/metrics_middleware.py
RENAMED
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mediation/pipeline_behavior.py
RENAMED
|
File without changes
|
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/mediation/tracing_middleware.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/observability/framework.py
RENAMED
|
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
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/serialization/abstractions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{neuroglia_python-0.6.22 → neuroglia_python-0.6.23}/src/neuroglia/validation/business_rules.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|