-- name: ListAccounts :many SELECT * FROM accounts WHERE owner = $1 ORDER BY id LIMIT $2 OFFSET $3; -- name: UpdateAccount :one UPDATE accounts SET balance = $2 WHERE id = $1 RETURNING *; -- name: DeleteAccount :exec DELETE FROM accounts WHERE id = $1; -- name: AddAccountBalance :one UPDATE accounts SET balance = balance + sqlc.arg(amount) WHERE id = sqlc.arg(id) RETURNING *;
If not using sql.arg(), the parameter names would be Balance and ID.