Refactor and remove sqlite and replace with MySQL

This commit is contained in:
2025-10-23 18:43:31 +01:00
parent d53e27eea8
commit 21ebc9c34b
139 changed files with 1013 additions and 529 deletions

View File

@@ -0,0 +1,21 @@
package helpers
import "database/sql"
func GetDistinctValues(db *sql.DB, column string) ([]string, error) {
query := "SELECT DISTINCT " + column + " FROM results_thunderball ORDER BY " + column
rows, err := db.Query(query)
if err != nil {
return nil, err
}
defer rows.Close()
var values []string
for rows.Next() {
var val string
if err := rows.Scan(&val); err == nil {
values = append(values, val)
}
}
return values, nil
}