fix: errors

This commit is contained in:
2025-08-06 14:59:39 +08:00
parent c4ad0c1dc9
commit aa20b6d7e6
10 changed files with 188 additions and 23 deletions

View File

@@ -3,6 +3,7 @@ package repository
import (
"fmt"
"log/slog"
"sort"
"github.com/rogeecn/database_render/internal/config"
"github.com/rogeecn/database_render/internal/database"
@@ -53,6 +54,11 @@ func (r *DataRepository) GetTables() ([]model.TableInfo, error) {
})
}
// Sort tables by name to ensure consistent ordering
sort.Slice(tables, func(i, j int) bool {
return tables[i].Name < tables[j].Name
})
return tables, nil
}