migration to chi
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user