Skip to content

Commit 47ff4aa

Browse files
committed
multi: add UpdateAccountAliasForTests query
1 parent 72a233e commit 47ff4aa

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

accounts/store_sql.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ type SQLQueries interface {
4949
UpdateAccountBalance(ctx context.Context, arg sqlc.UpdateAccountBalanceParams) (int64, error)
5050
UpdateAccountExpiry(ctx context.Context, arg sqlc.UpdateAccountExpiryParams) (int64, error)
5151
UpdateAccountLastUpdate(ctx context.Context, arg sqlc.UpdateAccountLastUpdateParams) (int64, error)
52+
// UpdateAccountAliasForTests is a query intended only for testing
53+
// purposes, to change the account alias.
54+
UpdateAccountAliasForTests(ctx context.Context, arg sqlc.UpdateAccountAliasForTestsParams) (int64, error)
5255
UpsertAccountPayment(ctx context.Context, arg sqlc.UpsertAccountPaymentParams) error
5356
GetAccountInvoice(ctx context.Context, arg sqlc.GetAccountInvoiceParams) (sqlc.AccountInvoice, error)
5457
}

db/sqlc/accounts.sql.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

db/sqlc/querier.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

db/sqlc/queries/accounts.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ RETURNING id;
2525
INSERT INTO account_invoices (account_id, hash)
2626
VALUES ($1, $2);
2727

28+
-- name: UpdateAccountAliasForTests :one
29+
-- NOTE: This query is only intended for testing purposes.
30+
UPDATE accounts
31+
SET alias = $1
32+
WHERE id = $2
33+
RETURNING id;
34+
2835
-- name: DeleteAccountPayment :exec
2936
DELETE FROM account_payments
3037
WHERE hash = $1

0 commit comments

Comments
 (0)