mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
aurweb.db.session: Use autoflush=True for Sessions
We'd like SQLAlchemy to automatically maintain flushes for us. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
794868b20f
commit
f8a6049de2
1 changed files with 1 additions and 1 deletions
|
@ -135,7 +135,7 @@ def get_engine():
|
||||||
# https://fastapi.tiangolo.com/tutorial/sql-databases/#note
|
# https://fastapi.tiangolo.com/tutorial/sql-databases/#note
|
||||||
connect_args["check_same_thread"] = False
|
connect_args["check_same_thread"] = False
|
||||||
engine = create_engine(get_sqlalchemy_url(), connect_args=connect_args)
|
engine = create_engine(get_sqlalchemy_url(), connect_args=connect_args)
|
||||||
Session = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
Session = sessionmaker(autocommit=False, autoflush=True, bind=engine)
|
||||||
session = Session()
|
session = Session()
|
||||||
|
|
||||||
return engine
|
return engine
|
||||||
|
|
Loading…
Add table
Reference in a new issue