fix errors on insertion to game, fix db creation of game
This commit is contained in:
@@ -15,14 +15,14 @@ type Index struct {
|
||||
Type string
|
||||
}
|
||||
|
||||
func (i *Index) Query(data *InsertId[uint]) {
|
||||
func (i *Index) Query(data *InsertId[string]) {
|
||||
data.query = `
|
||||
INSERT INTO index_ (pack_id, id, folder, img, name, type)
|
||||
VALUES ($1, $2, $3, $4, $5, $6)
|
||||
RETURNING id`
|
||||
}
|
||||
|
||||
func (i *Index) Insert(tx *sqlx.Tx, data *InsertId[uint]) error {
|
||||
func (i *Index) Insert(tx *sqlx.Tx, data *InsertId[string]) error {
|
||||
if data.query == "" {
|
||||
return ErrNoQuery
|
||||
}
|
||||
@@ -37,7 +37,7 @@ func (i *Index) Insert(tx *sqlx.Tx, data *InsertId[uint]) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (i *Index) InsertCtx(ctx context.Context, tx *sqlx.Tx, data *InsertId[uint]) error {
|
||||
func (i *Index) InsertCtx(ctx context.Context, tx *sqlx.Tx, data *InsertId[string]) error {
|
||||
if data.query == "" {
|
||||
return ErrNoQuery
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user