FILE / Unmei/Backend

database/games.go

Исходный файл и его история в репозитории.
FILE 45bb32e7a6664f9c680c83ff29b4ed1b934d7912
Files
Backend/database/games.go
T
2025-03-12 16:30:40 +03:00

19 lines
533 B
Go

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
}