check_genealogy_records_data.py 438 B

1234567891011121314
  1. import pymysql
  2. from app import get_db_connection
  3. conn = get_db_connection()
  4. cursor = conn.cursor()
  5. print('genealogy_records表数据(前10条):')
  6. cursor.execute('SELECT id, file_name, genealogy_version FROM genealogy_records LIMIT 10')
  7. records = cursor.fetchall()
  8. for record in records:
  9. print(f"ID: {record['id']}, File Name: {record['file_name']}, Genealogy Version: {record['genealogy_version']}")
  10. cursor.close()
  11. conn.close()