"""Shared engine cache for managing SQLAlchemy engines.

This module provides a centralized cache for SQLAlchemy engines,
particularly important for in-memory SQLite databases where each
new engine creates a separate database instance.
"""

from sqlalchemy.engine import Engine

# Module-level cache for in-memory SQLite engines
# This ensures that multiple connections to the same :memory: database
# actually access the same in-memory database instance.
# Critical for testing and scenarios where we want schema to persist
# across engine instances and modules.
MEMORY_ENGINES: dict[str, Engine] = {}
