Added a new sync that uses hash
Added a new sync that uses hash and sqlc for the queries. Added db migration. Started adding a config file.
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func InsertSongInList(song models.SongListData) {
|
||||
_, err := dbpool.Exec(ctx,
|
||||
_, err := Dbpool.Exec(Ctx,
|
||||
`INSERT INTO song_list (match_date, match_id, song_no, game_name, song_name) VALUES ($1, $2, $3, $4, $5)`,
|
||||
song.MatchDate, song.MatchId, song.SongNo, song.GameName, song.SongName)
|
||||
if err != nil {
|
||||
@@ -17,7 +17,7 @@ func InsertSongInList(song models.SongListData) {
|
||||
}
|
||||
|
||||
func GetSongList(matchId int) []models.SongListData {
|
||||
rows, err := dbpool.Query(ctx,
|
||||
rows, err := Dbpool.Query(Ctx,
|
||||
"SELECT match_date, match_id, song_no, game_name, song_name "+
|
||||
"FROM song_list WHERE match_date = $1"+
|
||||
"ORDER BY song_no DESC", matchId)
|
||||
|
||||
Reference in New Issue
Block a user