kandi1clickkits commited on
Commit
5c6b733
·
1 Parent(s): 007a3ba

chart code with DB

Browse files
Files changed (1) hide show
  1. main.py +2 -0
main.py CHANGED
@@ -12,6 +12,8 @@ app = FastAPI()
12
 
13
  # Use an absolute path for the SQLite database file
14
  database_path = os.path.join(os.getcwd(), "test.db")
 
 
15
  SQLALCHEMY_DATABASE_URL = f"sqlite:///{database_path}"
16
 
17
  # Set up logging for debugging
 
12
 
13
  # Use an absolute path for the SQLite database file
14
  database_path = os.path.join(os.getcwd(), "test.db")
15
+ if not os.path.exists(database_path):
16
+ open(database_path, 'w').close()
17
  SQLALCHEMY_DATABASE_URL = f"sqlite:///{database_path}"
18
 
19
  # Set up logging for debugging