users
| Function Name | Operation Type | Description | Arguments | Returns |
|---|---|---|---|---|
CountUsers |
Read (Count) | Counts the total number of users in the users table. | ctx context.Context |
int64, error |
CountSearchUsers |
Read (Count) | Counts users whose name or email matches a search string and optionally filters by role. | ctx context.Context, arg CountSearchUsersParams { Column1 string, Column2 string } |
int64, error |
CountUsersByTeamAndAvailability |
Read (Count) | Count the number of engineers in a team with a specific availability status. | ctx context.Context, arg CountUsersByTeamAndAvailabilityParams { TeamID pgtype.Int8, Availability AvailabilityStatus } |
int64, error |
CountUsersByTeamAndRole |
Read (Count) | Count the number of users in a team with a specific role. | ctx context.Context, arg CountUsersByTeamAndRoleParams { TeamID pgtype.Int8, Role UserRole } |
int64, error |
CountOpenTasksByTeam |
Read (Count) | Count the number of open, non-archived tasks for a specific team. | ctx context.Context, teamID int64 |
int64, error |
CreateUser |
Create (Insert) | Inserts a new user into the users table. |
ctx context.Context, arg CreateUserParams { Name pgtype.Text, Email string, TeamID pgtype.Int8, PasswordHash string, Role UserRole } |
User, error |
GetUser |
Read (Select) | Retrieves a single user by their unique ID. | ctx context.Context, id int64 |
User, error |
GetUserByEmail |
Read (Select) | Retrieves a single user by their unique email address. | ctx context.Context, email string |
User, error |
GetUserWithTeamAndSkills |
Read (Join) | Gets a specific user's details along with their team name. | ctx context.Context, id int64 |
GetUserWithTeamAndSkillsRow, error |
GetUserSkillsForAdmin |
Read (Join) | Retrieves all skills and proficiency levels for a specific user, ordered by skill name. | ctx context.Context, userID int64 |
[]GetUserSkillsForAdminRow, error |
ListUsers |
Read (Select) | Retrieves a paginated list of all users, ordered by ID. | ctx context.Context, arg ListUsersParams { Limit int32, Offset int32 } |
[]User, error |
ListUsersByTeam |
Read (Select) | Retrieves a paginated list of all users belonging to a specific team. | ctx context.Context, arg ListUsersByTeamParams { TeamID pgtype.Int8, Limit int32, Offset int32 } |
[]User, error |
ListEngineersByTeam |
Read (Select) | Lists all engineers in a specific team, ordered by name. | ctx context.Context, teamID pgtype.Int8 |
[]ListEngineersByTeamRow, error |
SearchUsers |
Read (Join) | Retrieves a paginated list of users with team names, filtered by search string and optional role. | ctx context.Context, arg SearchUsersParams { Column1 string, Column2 string, Limit int32, Offset int32 } |
[]SearchUsersRow, error |
UpdateUser |
Update | Updates the details of a specific user. Uses COALESCE to allow for partial updates. | ctx context.Context, arg UpdateUserParams { Name pgtype.Text, TeamID pgtype.Int8, Availability NullAvailabilityStatus, Role NullUserRole, ID int64 } |
User, error |
UpdateUserRole |
Update | Updates the role of a user and returns their updated information. | ctx context.Context, arg UpdateUserRoleParams { ID int64, Role UserRole } |
User, error |
UpdateUserTeam |
Update | Updates the team assignment of a user and returns their updated information. | ctx context.Context, arg UpdateUserTeamParams { ID int64, TeamID pgtype.Int8 } |
User, error |
RemoveUserFromTeam |
Update | Removes a user from their team by setting team_id to NULL. | ctx context.Context, id int64 |
User, error |
DeleteUser |
Delete | Deletes a user from the database by their ID. | ctx context.Context, id int64 |
error |