diff --git a/db/sqlc/accounts.sql.go b/db/sqlc/accounts.sql.go index 33334dbc..471cab9a 100644 --- a/db/sqlc/accounts.sql.go +++ b/db/sqlc/accounts.sql.go @@ -371,6 +371,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/sqlc/querier.go b/db/sqlc/querier.go index 6e8e7ed7..28eacddb 100644 --- a/db/sqlc/querier.go +++ b/db/sqlc/querier.go @@ -72,6 +72,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 diff --git a/db/sqlc/queries/accounts.sql b/db/sqlc/queries/accounts.sql index 3be5ccd5..00ecb431 100644 --- a/db/sqlc/queries/accounts.sql +++ b/db/sqlc/queries/accounts.sql @@ -21,6 +21,12 @@ SET last_updated = $1 WHERE id = $2 RETURNING id; +-- name: UpdateAccountLabel :one +UPDATE accounts +SET label = $1 +WHERE id = $2 +RETURNING id; + -- name: AddAccountInvoice :exec INSERT INTO account_invoices (account_id, hash) VALUES ($1, $2);