Files
ISSSTELEON/Persistance/persistance/edges/silver/links.py
T

23 lines
702 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Plata: la verificación de los vínculos resultado–toma de un dominio. Solo lee."""
from collections.abc import Callable
from typing import TypeVar
from sqlmodel import Session
from persistance.repository import Repository
T = TypeVar("T")
class LinksRepository(Repository):
"""Cuenta, con lo que calcula el kit sobre la sesión, cuántos resultados encuentran su toma."""
def __init__(self, session_factory):
super().__init__(session_factory, None)
def check(self, check: Callable[[Session], T]) -> T:
"""Corre `check(sesion)` en una sesión de solo lectura (no hace commit)."""
with self._session_factory() as sesion:
return check(sesion)