Conding #2

Merged
maruizhi merged 25 commits from conding into master 2026-09-21 09:24:40 +08:00
3 changed files with 15 additions and 1 deletions
Showing only changes of commit f1e1f1ee6f - Show all commits
View File
+8 -1
View File
@@ -6,4 +6,11 @@ engine = create_engine(db_url,pool_size=50)
Base = declarative_base()
Session = sessionmaker(bind=engine,autoflush=False,autocommit=False)
db = Session()
def get_db():
db = Session()
try:
yield db
finally:
db.close()
+7
View File
@@ -6,3 +6,10 @@ engine = create_engine(db_url,pool_size=50)
Base = declarative_base()
Session = sessionmaker(bind=engine,autoflush=False,autocommit=False)
def get_db():
db = Session()
try:
yield db
finally:
db.close()