17 lines
471 B
SQL
17 lines
471 B
SQL
-- name: CreateBet :one
|
|
INSERT INTO bets (amount, total_odds, status, full_name, phone_number, branch_id, user_id, is_shop_bet, cashout_id)
|
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)
|
|
RETURNING *;
|
|
|
|
-- name: GetAllBets :many
|
|
SELECT * FROM bets;
|
|
|
|
-- name: GetBetByID :one
|
|
SELECT * FROM bets WHERE id = $1;
|
|
|
|
-- name: UpdateCashOut :exec
|
|
UPDATE bets SET cashed_out = $2, updated_at = CURRENT_TIMESTAMP WHERE id = $1;
|
|
|
|
-- name: DeleteBet :exec
|
|
DELETE FROM bets WHERE id = $1;
|