From 6a29185689e3bb7259f6121e618aca080eae0064 Mon Sep 17 00:00:00 2001 From: Viktor Torstensson Date: Wed, 13 May 2026 20:34:04 +0200 Subject: [PATCH] sqlcmig6: add `UpdateAccountLabel` to sqlcmig6 Commit 24d7307a in `master` added a a new `UpdateAccountLabel` method to the `Querier` interface. This commit also updates to `sqlcmig6` package to support that query. --- db/sqlcmig6/accounts.sql.go | 19 +++++++++++++++++++ db/sqlcmig6/querier.go | 1 + 2 files changed, 20 insertions(+) diff --git a/db/sqlcmig6/accounts.sql.go b/db/sqlcmig6/accounts.sql.go index f9dd7d36..5bc97745 100644 --- a/db/sqlcmig6/accounts.sql.go +++ b/db/sqlcmig6/accounts.sql.go @@ -427,6 +427,25 @@ func (q *Queries) UpdateAccountExpiry(ctx context.Context, arg UpdateAccountExpi return id, err } +const updateAccountLabel = `-- name: UpdateAccountLabel :one +UPDATE accounts +SET label = $1 +WHERE id = $2 +RETURNING id +` + +type UpdateAccountLabelParams struct { + Label sql.NullString + ID int64 +} + +func (q *Queries) UpdateAccountLabel(ctx context.Context, arg UpdateAccountLabelParams) (int64, error) { + row := q.db.QueryRowContext(ctx, updateAccountLabel, arg.Label, arg.ID) + var id int64 + err := row.Scan(&id) + return id, err +} + const updateAccountLastUpdate = `-- name: UpdateAccountLastUpdate :one UPDATE accounts SET last_updated = $1 diff --git a/db/sqlcmig6/querier.go b/db/sqlcmig6/querier.go index 4ffdfb59..dfd13233 100644 --- a/db/sqlcmig6/querier.go +++ b/db/sqlcmig6/querier.go @@ -70,6 +70,7 @@ type Querier interface { 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) UpdateAccountLastUpdate(ctx context.Context, arg UpdateAccountLastUpdateParams) (int64, error) UpdateFeatureKVStoreRecord(ctx context.Context, arg UpdateFeatureKVStoreRecordParams) error UpdateGlobalKVStoreRecord(ctx context.Context, arg UpdateGlobalKVStoreRecordParams) error