MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / UpdateUserName

Method UpdateUserName

internal/identity/store.go:3106–3117  ·  view source on GitHub ↗

UpdateUserName persists a new display name on the user row and returns the updated User. Input validation (length, whitespace) is the caller's responsibility — this layer only enforces that the row exists.

(ctx context.Context, userID, name string)

Source from the content-addressed store, hash-verified

3104// the caller's responsibility — this layer only enforces that the row
3105// exists.
3106func (s *Store) UpdateUserName(ctx context.Context, userID, name string) (*User, error) {
3107 u := &User{}
3108 err := s.pool.QueryRow(ctx,
3109 `UPDATE users SET name = $1 WHERE id = $2
3110 RETURNING id, email, name, google_subject, created_at`,
3111 name, userID,
3112 ).Scan(&u.ID, &u.Email, &u.Name, &u.GoogleSubject, &u.CreatedAt)
3113 if err != nil {
3114 return nil, err
3115 }
3116 return u, nil
3117}
3118
3119// --- Session management ---
3120

Callers 1

HandleUpdateMeMethod · 0.80

Implementers 1

Storeinternal/identity/store.go

Calls 2

ScanMethod · 0.80
QueryRowMethod · 0.80

Tested by

no test coverage detected