'commit'
This commit is contained in:
23
debug_db.py
23
debug_db.py
@@ -1,23 +0,0 @@
|
|||||||
import sys
|
|
||||||
import os
|
|
||||||
sys.path.append(os.getcwd())
|
|
||||||
|
|
||||||
from Controller.DouYinController import get_db_connection
|
|
||||||
|
|
||||||
def check_db():
|
|
||||||
try:
|
|
||||||
conn = get_db_connection()
|
|
||||||
cursor = conn.cursor()
|
|
||||||
cursor.execute("SELECT count(*) as cnt FROM t_douyin_record")
|
|
||||||
count = cursor.fetchone()
|
|
||||||
print(f"Total records: {count}")
|
|
||||||
|
|
||||||
cursor.execute("SELECT * FROM t_douyin_record ORDER BY create_time DESC LIMIT 5")
|
|
||||||
records = cursor.fetchall()
|
|
||||||
print(f"Recent records: {records}")
|
|
||||||
conn.close()
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Error: {e}")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
check_db()
|
|
||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user