cockroachdb / cockroachdb/cockroach
sql: implement `func (p *planner) UserID()`
Open
C-enhancement
T-sql-foundations
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
To avoid having to look up the user ID with the username all the time (i.e. `SELECT user_id FROM system.users WHERE username = $1`), we should have a function similar to `func (p *planner) User()` that returns the user ID of the current user.
Jira issue: CRDB-25115
Epic CRDB-25679
Contributor guide
Research direction
Locate func (p *planner) User() in the SQL planner and read how it obtains the current user. Trace the related planner and user-resolution tests, if present, before defining the matching UserID entry point. Done means callers can obtain the current user's ID without repeatedly looking it up by username.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, sql
- Domain
- database
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100