2021-04-06 01:58:55 +00:00
|
|
|
import royalnet.lazy
|
2022-03-06 16:48:16 +00:00
|
|
|
import sqlalchemy.orm
|
2021-04-06 01:58:55 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
"""
|
|
|
|
|
2021-04-25 00:31:15 +00:00
|
|
|
SessionType = sqlalchemy.orm.Session
|
2021-04-19 03:26:20 +00:00
|
|
|
|
2021-04-06 01:58:55 +00:00
|
|
|
__all__ = (
|
|
|
|
"lazy_engine",
|
2021-04-19 03:26:20 +00:00
|
|
|
"lazy_session_class",
|
2021-04-25 00:31:15 +00:00
|
|
|
"SessionType",
|
2021-04-06 01:58:55 +00:00
|
|
|
)
|