// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.26.0 // source: query.sql package db import ( "context" "github.com/jackc/pgx/v5/pgtype" ) const getUserAuthByUsername = `-- name: GetUserAuthByUsername :one SELECT users.user_id, username, display_username, icon_path, is_admin, created_at, user_auth_id, user_auths.user_id, auth_type, password_hash FROM users JOIN user_auths ON users.user_id = user_auths.user_id WHERE users.username = $1 LIMIT 1 ` type GetUserAuthByUsernameRow struct { UserID int32 Username string DisplayUsername string IconPath pgtype.Text IsAdmin bool CreatedAt pgtype.Timestamp UserAuthID int32 UserID_2 int32 AuthType string PasswordHash pgtype.Text } func (q *Queries) GetUserAuthByUsername(ctx context.Context, username string) (GetUserAuthByUsernameRow, error) { row := q.db.QueryRow(ctx, getUserAuthByUsername, username) var i GetUserAuthByUsernameRow err := row.Scan( &i.UserID, &i.Username, &i.DisplayUsername, &i.IconPath, &i.IsAdmin, &i.CreatedAt, &i.UserAuthID, &i.UserID_2, &i.AuthType, &i.PasswordHash, ) return i, err } const getUserById = `-- name: GetUserById :one SELECT user_id, username, display_username, icon_path, is_admin, created_at FROM users WHERE users.user_id = $1 LIMIT 1 ` func (q *Queries) GetUserById(ctx context.Context, userID int32) (User, error) { row := q.db.QueryRow(ctx, getUserById, userID) var i User err := row.Scan( &i.UserID, &i.Username, &i.DisplayUsername, &i.IconPath, &i.IsAdmin, &i.CreatedAt, ) return i, err }