feat: update ui
This commit is contained in:
@@ -30,9 +30,26 @@ func (r *DataRepository) GetTables() ([]model.TableInfo, error) {
|
||||
var tables []model.TableInfo
|
||||
|
||||
for name, tableConfig := range r.config.Tables {
|
||||
// Get row count for each table
|
||||
rowCount, err := r.db.GetTableRowCount(name)
|
||||
if err != nil {
|
||||
r.logger.Error("failed to get row count for table", "table", name, "error", err)
|
||||
rowCount = 0
|
||||
}
|
||||
|
||||
// Use table alias as description if not provided
|
||||
description := tableConfig.Alias
|
||||
if desc, ok := tableConfig.Options["description"]; ok {
|
||||
if descStr, ok := desc.(string); ok {
|
||||
description = descStr
|
||||
}
|
||||
}
|
||||
|
||||
tables = append(tables, model.TableInfo{
|
||||
Name: name,
|
||||
Alias: tableConfig.Alias,
|
||||
Name: name,
|
||||
Alias: tableConfig.Alias,
|
||||
Description: description,
|
||||
RowCount: rowCount,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user