Skip to content

Instantly share code, notes, and snippets.

@manukanne
Last active May 22, 2023 22:03
Repository & Unit of Work - database
def create_sqlmodel_engine(settings: Settings, **kwargs):
return create_engine(settings.database_connection_str, **kwargs)
def sqlmodel_session_maker(engine) -> Callable[[], Session]:
return lambda: Session(bind=engine, autocommit=False, autoflush=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment