包含前后端完整代码: - 前端:Vue3+Vite+ElementPlus - 后端:FastAPI+SQLAlchemy - 模块:驾驶舱/KPI/战略地图/预警/预算/成本/预测/改善行动 - 当前版本:v1.0.0
14 lines
549 B
Python
14 lines
549 B
Python
import sqlite3
|
|
conn = sqlite3.connect('/root/cma-management/backend/cma.db')
|
|
cursor = conn.cursor()
|
|
tables = cursor.execute("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name").fetchall()
|
|
for t in tables:
|
|
print(f'=== {t[0]} ===')
|
|
cols = cursor.execute(f'PRAGMA table_info({t[0]})').fetchall()
|
|
for c in cols:
|
|
print(f' {c[1]:25s} {c[2]:15s} null={c[3]} default={c[4]} pk={c[5]}')
|
|
rowcount = cursor.execute(f'SELECT COUNT(*) FROM {t[0]}').fetchone()[0]
|
|
print(f' 行数: {rowcount}')
|
|
print()
|
|
conn.close()
|