🐛 fix(sqlite): 修复表概览行数与大小统计

- 通过 driver-agent 为 SQLite 表列表补充精确行数与存储占用
- 使用 dbstat 区分数据页和索引页并支持相对大小展示
- 区分未知统计与真实零值并补充前后端回归测试
This commit is contained in:
AutumnNazi
2026-07-16 12:44:18 +08:00
parent 695fad283c
commit 2400823ca4
6 changed files with 233 additions and 19 deletions

View File

@@ -861,6 +861,20 @@ func (d *OptionalDriverAgentDB) GetTables(dbName string) ([]string, error) {
return tables, nil
}
func (d *OptionalDriverAgentDB) GetTableRowCounts(_ string, tables []string) (map[string]int64, error) {
if normalizeRuntimeDriverType(d.driverType) != "sqlite" {
return map[string]int64{}, nil
}
return getSQLiteTableRowCounts(d.Query, tables)
}
func (d *OptionalDriverAgentDB) GetTableStorageStats(_ string, tables []string) (map[string]TableStorageStats, error) {
if normalizeRuntimeDriverType(d.driverType) != "sqlite" {
return map[string]TableStorageStats{}, nil
}
return getSQLiteTableStorageStats(d.Query, tables)
}
func (d *OptionalDriverAgentDB) GetCreateStatement(dbName, tableName string) (string, error) {
client, err := d.requireClient()
if err != nil {