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

import sqlite3

# 数据库路径
db_path = r'\\ll\D\xtrssvjj\db\dpd.db'

# 连接数据库
conn = sqlite3.connect(db_path)
cursor = conn.cursor()

# 查看所有表
try:
    cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
    tables = cursor.fetchall()
    print("数据库中的表:")
    for table in tables:
        print(f"- {table[0]}")
    
    # 查看 srts 表结构
    print("\nsrts 表结构:")
    cursor.execute("PRAGMA table_info(srts);")
    columns = cursor.fetchall()
    for col in columns:
        print(f"- {col[1]}: {col[2]}")
    
finally:
    conn.close()
