/database.py Secret
Last active
May 22, 2023 22:03
Repository & Unit of Work - database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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