Commit f8a6049d authored by Kevin Morris's avatar Kevin Morris
Browse files

aurweb.db.session: Use autoflush=True for Sessions



We'd like SQLAlchemy to automatically maintain flushes for us.
Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
parent 794868b2
......@@ -135,7 +135,7 @@ def get_engine():
# https://fastapi.tiangolo.com/tutorial/sql-databases/#note
connect_args["check_same_thread"] = False
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()
return engine
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment