hisham-cmd commited on
Commit
d838aa4
·
verified ·
1 Parent(s): d735109

Delete check_db.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. check_db.py +0 -24
check_db.py DELETED
@@ -1,24 +0,0 @@
1
- import os
2
- import sys
3
-
4
- # Add the current directory to sys.path
5
- sys.path.insert(0, os.path.join(os.getcwd(), "app"))
6
- sys.path.insert(0, os.getcwd())
7
-
8
- from app.db.base import SessionLocal
9
- from app.models.product import Product, Category
10
-
11
- def check():
12
- db = SessionLocal()
13
- try:
14
- cats = db.query(Category).count()
15
- prods = db.query(Product).count()
16
- print(f"Categories Count: {cats}")
17
- print(f"Products Count: {prods}")
18
- except Exception as e:
19
- print(f"Error: {e}")
20
- finally:
21
- db.close()
22
-
23
- if __name__ == "__main__":
24
- check()