kandi1clickkits commited on
Commit
7f53023
·
1 Parent(s): 94674d4

chart code with DB

Browse files
Files changed (1) hide show
  1. main.py +2 -6
main.py CHANGED
@@ -10,12 +10,8 @@ import logging
10
 
11
  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
18
- logging.basicConfig(level=logging.DEBUG)
19
 
20
  engine = create_engine(SQLALCHEMY_DATABASE_URL)
21
  SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
 
10
 
11
  app = FastAPI()
12
 
13
+ # Use SQLite in-memory database
14
+ SQLALCHEMY_DATABASE_URL = "sqlite:///:memory:"
 
 
 
 
15
 
16
  engine = create_engine(SQLALCHEMY_DATABASE_URL)
17
  SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)