exparmental run_command in linux.py migrate_sql1.py
This commit is contained in:
+2
-3
@@ -5,11 +5,10 @@ from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
class Database:
|
||||
def __init__(self):
|
||||
def __init__(self, db_path: str = "database.db"):
|
||||
self.columns = "id, title, created_at, view_count, duration, url, thumbnail_url, game_id, game_name, stream_id, creator_name, clip_is, downloaded, uploaded_yt, uploaded_yt_chats, uploaded_yt_shorts"
|
||||
|
||||
# IMPORTANT Must check if database.db exists before connecting to it.
|
||||
file_exists = Path("database.db").is_file()
|
||||
file_exists = self.db_path.is_file()
|
||||
|
||||
self.conn = sqlite3.connect("database.db")
|
||||
self.cursor = self.conn.cursor()
|
||||
|
||||
Reference in New Issue
Block a user