| 3089 | } |
| 3090 | |
| 3091 | func (s *Store) GetUserByID(ctx context.Context, id string) (*User, error) { |
| 3092 | u := &User{} |
| 3093 | err := s.pool.QueryRow(ctx, |
| 3094 | `SELECT id, email, name, google_subject, created_at FROM users WHERE id = $1`, id, |
| 3095 | ).Scan(&u.ID, &u.Email, &u.Name, &u.GoogleSubject, &u.CreatedAt) |
| 3096 | if err != nil { |
| 3097 | return nil, err |
| 3098 | } |
| 3099 | return u, nil |
| 3100 | } |
| 3101 | |
| 3102 | // UpdateUserName persists a new display name on the user row and |
| 3103 | // returns the updated User. Input validation (length, whitespace) is |