#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
检查数据库表结构
"""

import sqlite3

# 数据库路径
dbfile = r'\\ll\d\xtrssvjj\dpd.db'

try:
    # 连接数据库
    conn = sqlite3.connect(dbfile)
    cursor = conn.cursor()
    
    print("数据库连接成功！")
    
    # 查看srts表结构
    print("\n=== srts表结构 ===")
    cursor.execute("PRAGMA table_info(srts);")
    columns = cursor.fetchall()
    for col in columns:
        print(f"- {col[1]} ({col[2]})")
    
    # 查看srts表的前3条记录
    print("\n=== srts表前3条记录 ===")
    cursor.execute("SELECT * FROM srts LIMIT 3;")
    rows = cursor.fetchall()
    for row in rows:
        print(row)
    
    conn.close()

except Exception as e:
    print(f"错误: {e}")
