学生表列追加
This commit is contained in:
@@ -6,4 +6,11 @@ engine = create_engine(db_url,pool_size=50)
|
|||||||
Base = declarative_base()
|
Base = declarative_base()
|
||||||
|
|
||||||
Session = sessionmaker(bind=engine,autoflush=False,autocommit=False)
|
Session = sessionmaker(bind=engine,autoflush=False,autocommit=False)
|
||||||
db = Session()
|
|
||||||
|
def get_db():
|
||||||
|
db = Session()
|
||||||
|
try:
|
||||||
|
yield db
|
||||||
|
finally:
|
||||||
|
db.close()
|
||||||
|
|
||||||
|
|||||||
@@ -6,3 +6,10 @@ engine = create_engine(db_url,pool_size=50)
|
|||||||
Base = declarative_base()
|
Base = declarative_base()
|
||||||
|
|
||||||
Session = sessionmaker(bind=engine,autoflush=False,autocommit=False)
|
Session = sessionmaker(bind=engine,autoflush=False,autocommit=False)
|
||||||
|
|
||||||
|
def get_db():
|
||||||
|
db = Session()
|
||||||
|
try:
|
||||||
|
yield db
|
||||||
|
finally:
|
||||||
|
db.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user