1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 05:24:20 +00:00
royalnet/royalpack/database/engine.py

22 lines
433 B
Python
Raw Normal View History

import sqlalchemy.orm
import royalnet.lazy
from ..config import *
lazy_engine = royalnet.lazy.Lazy(lambda c: sqlalchemy.create_engine(c["database.uri"]), c=lazy_config)
"""
The uninitialized sqlalchemy engine.
"""
2021-04-19 03:26:20 +00:00
lazy_session_class = royalnet.lazy.Lazy(lambda e: sqlalchemy.orm.sessionmaker(bind=e), e=lazy_engine)
"""
The uninitialized sqlalchemy session class.
"""
__all__ = (
"lazy_engine",
2021-04-19 03:26:20 +00:00
"lazy_session_class",
)