refactor: Clean up code by removing unnecessary blank lines and improving comments for better readability and maintainability

This commit is contained in:
wizardchen
2025-11-28 16:10:37 +08:00
parent a318a08ab7
commit 135e33eca4
38 changed files with 318 additions and 545 deletions
-35
View File
@@ -2,7 +2,6 @@ package tools
import (
"context"
"database/sql"
"encoding/json"
"fmt"
"regexp"
@@ -421,37 +420,3 @@ func (t *DatabaseQueryTool) formatQueryResults(columns []string, results []map[s
return output
}
// Helper function to convert database value to proper type
func convertDatabaseValue(val interface{}) interface{} {
if val == nil {
return nil
}
switch v := val.(type) {
case []byte:
return string(v)
case sql.NullString:
if v.Valid {
return v.String
}
return nil
case sql.NullInt64:
if v.Valid {
return v.Int64
}
return nil
case sql.NullFloat64:
if v.Valid {
return v.Float64
}
return nil
case sql.NullBool:
if v.Valid {
return v.Bool
}
return nil
default:
return v
}
}