mirror of
https://github.com/simple-login/app.git
synced 2025-02-25 00:03:03 +08:00
add type annotation for Session
This commit is contained in:
parent
17e9798bfd
commit
d1b9fb8bb5
1 changed files with 5 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
import sqlalchemy
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import scoped_session
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
@ -8,3 +9,7 @@ engine = create_engine(DB_URI)
|
|||
connection = engine.connect()
|
||||
|
||||
Session = scoped_session(sessionmaker(bind=connection))
|
||||
|
||||
# Session is actually a proxy, more info on
|
||||
# https://docs.sqlalchemy.org/en/14/orm/contextual.html?highlight=scoped_session#implicit-method-access
|
||||
Session: sqlalchemy.orm.Session
|
||||
|
|
Loading…
Reference in a new issue