Spaces:
Sleeping
Sleeping
Create database.py
Browse files
private_gpt/server/utils/database.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from sqlalchemy import create_engine
|
2 |
+
from sqlalchemy.orm import sessionmaker
|
3 |
+
from sqlalchemy.ext.declarative import declarative_base
|
4 |
+
|
5 |
+
import os
|
6 |
+
|
7 |
+
|
8 |
+
# db_file_path = 'chatbot_users.db'
|
9 |
+
|
10 |
+
# if os.path.exists(db_file_path):
|
11 |
+
# print(f"Database file {db_file_path} exists.")
|
12 |
+
# else:
|
13 |
+
# print(f"Database file {db_file_path} does not exist.")
|
14 |
+
|
15 |
+
|
16 |
+
# SQLALCHEMY_DATABASE_URL = 'sqlite:///./chatbot_users.db'
|
17 |
+
|
18 |
+
# engine = create_engine(SQLALCHEMY_DATABASE_URL, connect_args={'check_same_thread': False})
|
19 |
+
|
20 |
+
# SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
21 |
+
|
22 |
+
# Base = declarative_base()
|