Initial commit: Audio Dashboard Management System
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
from database import get_db
|
||||
from models import Brand
|
||||
|
||||
if __name__ == "__main__":
|
||||
db_gen = get_db()
|
||||
db = next(db_gen)
|
||||
try:
|
||||
brands = db.query(Brand).all()
|
||||
for brand in brands:
|
||||
print(brand.name)
|
||||
finally:
|
||||
db_gen.close() # 这会触发 finally 块中的 db.close()
|
||||
Reference in New Issue
Block a user