Infrastructure Projection Store
Description
A data store optimized for querying read models (Projections).
Definition Schema
The definition for a infrastructure_projection_store
component expects the following structure:
{
"example": {
"base_interface_module": "castlecraft_engineer.abstractions.projection_store",
"base_interface_name": "ProjectionStore",
"base_test_class_module": "castlecraft_engineer.testing.projection_store",
"base_test_class_name": "BaseProjectionStoreTest",
"description": "An in-memory projection store for user activity.",
"event_id_type_str": "uuid.UUID",
"projection_state_module_str": "castlecraft_engineer.abstractions.projection",
"store_name": "InMemoryUserActivityProjectionStore",
"store_type": "in_memory"
},
"properties": {
"store_name": {
"description": "Name of the projection store class (e.g., 'InMemoryUserActivityProjectionStore')",
"title": "Store Name",
"type": "string"
},
"event_id_type_str": {
"description": "Type hint for the event ID (e.g., 'uuid.UUID', 'str')",
"title": "Event Id Type Str",
"type": "string"
},
"projection_state_module_str": {
"default": "castlecraft_engineer.abstractions.projection",
"description": "Module where ProjectionState and ProjectionId are defined.",
"title": "Projection State Module Str",
"type": "string"
},
"base_interface_name": {
"default": "ProjectionStore",
"description": "Name of the base ProjectionStore interface.",
"title": "Base Interface Name",
"type": "string"
},
"base_interface_module": {
"default": "castlecraft_engineer.abstractions.projection_store",
"description": "Module for the base ProjectionStore interface.",
"title": "Base Interface Module",
"type": "string"
},
"base_test_class_name": {
"default": "BaseProjectionStoreTest",
"description": "Name of the base test class for projection stores.",
"title": "Base Test Class Name",
"type": "string"
},
"base_test_class_module": {
"default": "castlecraft_engineer.testing.projection_store",
"description": "Module for the base test class.",
"title": "Base Test Class Module",
"type": "string"
},
"store_type": {
"default": "in_memory",
"description": "Type of store to generate (e.g., 'in_memory'). Controls internal implementation.",
"title": "Store Type",
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional description for the projection store.",
"title": "Description"
}
},
"required": [
"store_name",
"event_id_type_str"
],
"title": "ProjectionStoreEngineInputDTO",
"type": "object"
}
Naming and Location Conventions
Class: PascalCase, typically ends with 'ProjectionStore'. File: ${infrastructure_projection_store_name}.py
(based on ${infrastructure_projection_store_name}
). Location: app/infrastructure/projection_stores
.
Example Definition
{
"store_name": "InMemoryUserActivityProjectionStore",
"event_id_type_str": "uuid.UUID",
"projection_state_module_str": "castlecraft_engineer.abstractions.projection",
"base_interface_name": "ProjectionStore",
"base_interface_module": "castlecraft_engineer.abstractions.projection_store",
"base_test_class_name": "BaseProjectionStoreTest",
"base_test_class_module": "castlecraft_engineer.testing.projection_store",
"store_type": "in_memory",
"description": "An in-memory projection store for user activity."
}