sqlc: remove UpdateAccountAliasForTests query

As no code path uses the sqlc.UpdateAccountAliasForTests query, now that
migrations tests have been updated to use the sqlcmig6 version, we can
remove the query from the sqlc package. As this query is only intended
to be used for testing, it is beneficial to not expose it to the rest of
the codebase to avoid accidental usage in the future.
This commit is contained in:
Viktor Torstensson 2025-10-15 21:52:26 +02:00
parent 3c09dd6072
commit ff0eaa9774
No known key found for this signature in database
GPG key ID: 961CC8259AE675D4
4 changed files with 0 additions and 32 deletions

View file

@ -51,9 +51,6 @@ type SQLQueries interface {
UpdateAccountBalance(ctx context.Context, arg sqlc.UpdateAccountBalanceParams) (int64, error)
UpdateAccountExpiry(ctx context.Context, arg sqlc.UpdateAccountExpiryParams) (int64, error)
UpdateAccountLastUpdate(ctx context.Context, arg sqlc.UpdateAccountLastUpdateParams) (int64, error)
// UpdateAccountAliasForTests is a query intended only for testing
// purposes, to change the account alias.
UpdateAccountAliasForTests(ctx context.Context, arg sqlc.UpdateAccountAliasForTestsParams) (int64, error)
UpdateAccountLabel(ctx context.Context, arg sqlc.UpdateAccountLabelParams) (int64, error)
UpsertAccountPayment(ctx context.Context, arg sqlc.UpsertAccountPaymentParams) error
GetAccountInvoice(ctx context.Context, arg sqlc.GetAccountInvoiceParams) (sqlc.AccountInvoice, error)

View file

@ -313,26 +313,6 @@ func (q *Queries) SetAccountIndex(ctx context.Context, arg SetAccountIndexParams
return err
}
const updateAccountAliasForTests = `-- name: UpdateAccountAliasForTests :one
UPDATE accounts
SET alias = $1
WHERE id = $2
RETURNING id
`
type UpdateAccountAliasForTestsParams struct {
Alias int64
ID int64
}
// NOTE: This query is only intended for testing purposes.
func (q *Queries) UpdateAccountAliasForTests(ctx context.Context, arg UpdateAccountAliasForTestsParams) (int64, error) {
row := q.db.QueryRowContext(ctx, updateAccountAliasForTests, arg.Alias, arg.ID)
var id int64
err := row.Scan(&id)
return id, err
}
const updateAccountBalance = `-- name: UpdateAccountBalance :one
UPDATE accounts
SET current_balance_msat = $1

View file

@ -68,8 +68,6 @@ type Querier interface {
SetSessionGroupID(ctx context.Context, arg SetSessionGroupIDParams) error
SetSessionRemotePublicKey(ctx context.Context, arg SetSessionRemotePublicKeyParams) error
SetSessionRevokedAt(ctx context.Context, arg SetSessionRevokedAtParams) error
// NOTE: This query is only intended for testing purposes.
UpdateAccountAliasForTests(ctx context.Context, arg UpdateAccountAliasForTestsParams) (int64, error)
UpdateAccountBalance(ctx context.Context, arg UpdateAccountBalanceParams) (int64, error)
UpdateAccountExpiry(ctx context.Context, arg UpdateAccountExpiryParams) (int64, error)
UpdateAccountLabel(ctx context.Context, arg UpdateAccountLabelParams) (int64, error)

View file

@ -31,13 +31,6 @@ RETURNING id;
INSERT INTO account_invoices (account_id, hash)
VALUES ($1, $2);
-- name: UpdateAccountAliasForTests :one
-- NOTE: This query is only intended for testing purposes.
UPDATE accounts
SET alias = $1
WHERE id = $2
RETURNING id;
-- name: DeleteAccountPayment :exec
DELETE FROM account_payments
WHERE hash = $1