migration to chi

This commit is contained in:
2025-03-12 16:30:40 +03:00
parent ae81fbcce9
commit 45bb32e7a6
46 changed files with 1352 additions and 1323 deletions
+18
View File
@@ -0,0 +1,18 @@
package database
import "time"
type Game struct {
ID int32 `json:"id"`
OriginalName string `json:"original_name" db:"original_name"`
LocalizedName string `json:"localized_name" db:"localized_name"`
Description string `json:"description"`
Image string `json:"image"`
ReleaseDate time.Time `json:"release_date" db:"release_date"`
}
func FetchGame(id int32) (Game, error) {
var game Game
err := Database.Get(&game, "select * from games where id = $1 limit 1;", id)
return game, err
}