Spaces:
Running
on
Zero
Running
on
Zero
Update db.py
Browse files
db.py
CHANGED
@@ -2,9 +2,9 @@ import sqlite3
|
|
2 |
import os
|
3 |
import time
|
4 |
|
5 |
-
# Use the current directory
|
6 |
-
DB_NAME = "model_tests.db"
|
7 |
-
DB_PATH = os.path.join(
|
8 |
|
9 |
def init_db():
|
10 |
"""Initialize the SQLite database with required tables if they don't exist"""
|
@@ -34,7 +34,7 @@ def init_db():
|
|
34 |
''')
|
35 |
|
36 |
conn.commit()
|
37 |
-
print("Test database initialized successfully")
|
38 |
return True
|
39 |
except Exception as e:
|
40 |
print(f"Error initializing database: {e}")
|
|
|
2 |
import os
|
3 |
import time
|
4 |
|
5 |
+
# Use a non-hidden filename in the current directory
|
6 |
+
DB_NAME = "model_tests.db" # No leading dot
|
7 |
+
DB_PATH = os.path.join(os.getcwd(), DB_NAME) # Use absolute path with getcwd()
|
8 |
|
9 |
def init_db():
|
10 |
"""Initialize the SQLite database with required tables if they don't exist"""
|
|
|
34 |
''')
|
35 |
|
36 |
conn.commit()
|
37 |
+
print(f"Test database initialized successfully at {DB_PATH}")
|
38 |
return True
|
39 |
except Exception as e:
|
40 |
print(f"Error initializing database: {e}")
|