mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-15 11:14:31 +08:00
🐛 fix(sqlite): 修复表概览行数与大小统计
- 通过 driver-agent 为 SQLite 表列表补充精确行数与存储占用 - 使用 dbstat 区分数据页和索引页并支持相对大小展示 - 区分未知统计与真实零值并补充前后端回归测试
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user