51 lines
905 B
Go
51 lines
905 B
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.25.0
|
|
// source: game_player.sql
|
|
|
|
package model
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type BatchInsertGamePlayersParams struct {
|
|
GameID string
|
|
PlayerSlug string
|
|
Status string
|
|
TeamSlug string
|
|
}
|
|
|
|
const createOrUpdateGamePlayer = `-- name: CreateOrUpdateGamePlayer :exec
|
|
INSERT INTO game_players(
|
|
game_id,
|
|
player_slug,
|
|
status,
|
|
team_slug)
|
|
VALUES(
|
|
$1,
|
|
$2,
|
|
$3,
|
|
$4)
|
|
ON CONFLICT (game_id, player_slug) DO UPDATE
|
|
SET status = $3,
|
|
team_slug = $4
|
|
`
|
|
|
|
type CreateOrUpdateGamePlayerParams struct {
|
|
GameID string
|
|
PlayerSlug string
|
|
Status string
|
|
TeamSlug string
|
|
}
|
|
|
|
func (q *Queries) CreateOrUpdateGamePlayer(ctx context.Context, arg CreateOrUpdateGamePlayerParams) error {
|
|
_, err := q.db.Exec(ctx, createOrUpdateGamePlayer,
|
|
arg.GameID,
|
|
arg.PlayerSlug,
|
|
arg.Status,
|
|
arg.TeamSlug,
|
|
)
|
|
return err
|
|
}
|