sql

package
v0.0.0-...-28d8bff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiToken

type ApiToken struct {
	UserID pgtype.UUID
	Token  string
	Grade  int32
}

type AreFriendsParams

type AreFriendsParams struct {
	User1 pgtype.UUID
	User2 pgtype.UUID
}

type CreateFriendParams

type CreateFriendParams struct {
	User1 pgtype.UUID
	User2 pgtype.UUID
}

type CreateGroupedEncounterParams

type CreateGroupedEncounterParams struct {
	GroupID   int32
	Uploaders []pgtype.UUID
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
	CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
}

type DeleteFriendParams

type DeleteFriendParams struct {
	User1 pgtype.UUID
	User2 pgtype.UUID
}

type DeleteFriendRequestParams

type DeleteFriendRequestParams struct {
	User1 string
	User2 string
}

type Encounter

type Encounter struct {
	ID          int32
	UploadedBy  pgtype.UUID
	UploadedAt  pgtype.Timestamp
	Settings    structs.EncounterSettings
	Thumbnail   bool
	Tags        []string
	Header      structs.EncounterHeader
	Data        *structs.EncounterData
	Private     bool
	UniqueHash  string
	UniqueGroup int32
	Visibility  *structs.EncounterVisibility
	Boss        string
	Difficulty  string
	Date        pgtype.Timestamp
	Duration    int32
	Version     int32
	LocalPlayer string
}

type Friend

type Friend struct {
	User1 pgtype.UUID
	User2 pgtype.UUID
	Date  pgtype.Timestamp
}

type FriendRequest

type FriendRequest struct {
	User1 string
	User2 string
	Date  pgtype.Timestamp
}

type GetEncounterRow

type GetEncounterRow struct {
	ID            int32
	UploadedBy    pgtype.UUID
	UploadedAt    pgtype.Timestamp
	Settings      structs.EncounterSettings
	Thumbnail     bool
	Tags          []string
	Header        structs.EncounterHeader
	Data          *structs.EncounterData
	Private       bool
	UniqueHash    string
	UniqueGroup   int32
	Visibility    *structs.EncounterVisibility
	Boss          string
	Difficulty    string
	Date          pgtype.Timestamp
	Duration      int32
	Version       int32
	LocalPlayer   string
	DiscordID     string
	DiscordTag    string
	LogVisibility *structs.EncounterVisibility
	Username      *string
	Avatar        string
}

type GetEncounterShortRow

type GetEncounterShortRow struct {
	ID          int32
	Difficulty  string
	UploadedBy  pgtype.UUID
	UploadedAt  pgtype.Timestamp
	Settings    structs.EncounterSettings
	Tags        []string
	Header      structs.EncounterHeader
	Boss        string
	Date        pgtype.Timestamp
	Duration    int32
	LocalPlayer string
}

type GetEncounterVisibilityRow

type GetEncounterVisibilityRow struct {
	UploadedBy pgtype.UUID
	Visibility *structs.EncounterVisibility
}

type GetHeaderRow

type GetHeaderRow struct {
	Boss       string
	Difficulty string
	UploadedBy pgtype.UUID
	Date       pgtype.Timestamp
	Duration   int32
	Header     structs.EncounterHeader
}

type GetRolesByDiscordIDRow

type GetRolesByDiscordIDRow struct {
	ID    pgtype.UUID
	Roles []string
}

type GetRosterByUsernameRow

type GetRosterByUsernameRow struct {
	Character string
	Class     string
	GearScore float64
}

type GetRosterRow

type GetRosterRow struct {
	Character string
	Class     string
	GearScore float64
}

type GetRosterStatsByIDRow

type GetRosterStatsByIDRow struct {
	Name      string
	Class     string
	GearScore float64
	Count     int64
}

type GetRosterStatsRow

type GetRosterStatsRow struct {
	Name      string
	Class     string
	GearScore float64
	Count     int64
}

type GetUniqueGroupParams

type GetUniqueGroupParams struct {
	UniqueHash string
	Date       pgtype.Timestamp
}

type GroupedEncounter

type GroupedEncounter struct {
	GroupID   int32
	Uploaders []pgtype.UUID
}

type HasFriendRequestParams

type HasFriendRequestParams struct {
	User1 string
	User2 string
}

type InsertCharacterParams

type InsertCharacterParams struct {
	UserID    pgtype.UUID
	Character string
	Class     string
	GearScore float64
}

type InsertEncounterParams

type InsertEncounterParams struct {
	UploadedBy  pgtype.UUID
	Settings    structs.EncounterSettings
	Tags        []string
	Header      structs.EncounterHeader
	Data        *structs.EncounterData
	Version     int32
	Difficulty  string
	Boss        string
	Date        pgtype.Timestamp
	Duration    int32
	LocalPlayer string
	UniqueHash  string
	UniqueGroup int32
}

type InsertPlayerInternalParams

type InsertPlayerInternalParams struct {
	Encounter  int32
	Boss       string
	Difficulty string
	Class      string
	Name       string
	Dead       bool
	GearScore  float64
	Dps        int64
	Place      int32
}

type InsertPlayerParams

type InsertPlayerParams struct {
	Encounter  int32
	Boss       string
	Difficulty string
	Class      string
	Name       string
	Dead       bool
	GearScore  float64
	Dps        int64
	Place      int32
}

type ListFriendsRow

type ListFriendsRow struct {
	DiscordTag string
	Username   *string
	Date       pgtype.Timestamp
}

type ListReceivedFriendRequestsRow

type ListReceivedFriendRequestsRow struct {
	DiscordTag string
	Username   *string
	Date       pgtype.Timestamp
}

type ListSentFriendRequestsRow

type ListSentFriendRequestsRow struct {
	DiscordTag string
	Username   *string
	Date       pgtype.Timestamp
}

type Player

type Player struct {
	Encounter  int32
	Boss       string
	Difficulty string
	Class      string
	Name       string
	Dead       bool
	Dps        int64
	GearScore  float64
	Place      int32
}

type ProcessEncounterParams

type ProcessEncounterParams struct {
	ID         int32
	Header     structs.EncounterHeader
	Data       *structs.EncounterData
	UniqueHash string
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AreFriends

func (q *Queries) AreFriends(ctx context.Context, arg AreFriendsParams) (bool, error)

func (*Queries) CreateFriend

func (q *Queries) CreateFriend(ctx context.Context, arg CreateFriendParams) error

func (*Queries) CreateGroupedEncounter

func (q *Queries) CreateGroupedEncounter(ctx context.Context, arg CreateGroupedEncounterParams) error

func (*Queries) DeleteEncounter

func (q *Queries) DeleteEncounter(ctx context.Context, id int32) error

func (*Queries) DeleteFriend

func (q *Queries) DeleteFriend(ctx context.Context, arg DeleteFriendParams) error

func (*Queries) DeleteFriendRequest

func (q *Queries) DeleteFriendRequest(ctx context.Context, arg DeleteFriendRequestParams) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id pgtype.UUID) error

func (*Queries) DeleteUserLogs1

func (q *Queries) DeleteUserLogs1(ctx context.Context, uploadedBy pgtype.UUID) ([]int32, error)

func (*Queries) DeleteUserLogs2SelectGroups

func (q *Queries) DeleteUserLogs2SelectGroups(ctx context.Context, uploadedBy pgtype.UUID) ([]int32, error)

func (*Queries) DeleteUserLogs3PruneGroupedEncounters

func (q *Queries) DeleteUserLogs3PruneGroupedEncounters(ctx context.Context, dollar_1 []int32) error

func (*Queries) DeleteUserLogs3UpdateGroupedEncounters

func (q *Queries) DeleteUserLogs3UpdateGroupedEncounters(ctx context.Context, dollar_1 pgtype.UUID) ([]int32, error)

func (*Queries) FetchWhitelist

func (q *Queries) FetchWhitelist(ctx context.Context, discord string) (string, error)

func (*Queries) GetAPIToken

func (q *Queries) GetAPIToken(ctx context.Context, token string) (ApiToken, error)

func (*Queries) GetEncounter

func (q *Queries) GetEncounter(ctx context.Context, id int32) (GetEncounterRow, error)

func (*Queries) GetEncounterShort

func (q *Queries) GetEncounterShort(ctx context.Context, id int32) (GetEncounterShortRow, error)

func (*Queries) GetEncounterVisibility

func (q *Queries) GetEncounterVisibility(ctx context.Context, id int32) (GetEncounterVisibilityRow, error)

func (*Queries) GetHeader

func (q *Queries) GetHeader(ctx context.Context, id int32) (GetHeaderRow, error)

func (*Queries) GetNoThumbnailLogs

func (q *Queries) GetNoThumbnailLogs(ctx context.Context) ([]int32, error)

func (*Queries) GetRoles

func (q *Queries) GetRoles(ctx context.Context, id pgtype.UUID) ([]string, error)

func (*Queries) GetRolesByDiscordID

func (q *Queries) GetRolesByDiscordID(ctx context.Context, discordID string) (GetRolesByDiscordIDRow, error)

func (*Queries) GetRoster

func (q *Queries) GetRoster(ctx context.Context, userID pgtype.UUID) ([]GetRosterRow, error)

func (*Queries) GetRosterByUsername

func (q *Queries) GetRosterByUsername(ctx context.Context, lower string) ([]GetRosterByUsernameRow, error)

func (*Queries) GetRosterStats

func (q *Queries) GetRosterStats(ctx context.Context, lower string) ([]GetRosterStatsRow, error)

func (*Queries) GetRosterStatsByID

func (q *Queries) GetRosterStatsByID(ctx context.Context, uploadedBy pgtype.UUID) ([]GetRosterStatsByIDRow, error)

func (*Queries) GetUniqueGroup

func (q *Queries) GetUniqueGroup(ctx context.Context, arg GetUniqueGroupParams) (int32, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, discordTag string) (User, error)

func (*Queries) GetUserByDiscordID

func (q *Queries) GetUserByDiscordID(ctx context.Context, discordID string) (User, error)

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id pgtype.UUID) (User, error)

func (*Queries) GetUserByToken

func (q *Queries) GetUserByToken(ctx context.Context, accessToken *string) (User, error)

func (*Queries) GetUserEncounterVisibility

func (q *Queries) GetUserEncounterVisibility(ctx context.Context, id pgtype.UUID) (*structs.EncounterVisibility, error)

func (*Queries) HasFriendRequest

func (q *Queries) HasFriendRequest(ctx context.Context, arg HasFriendRequestParams) (bool, error)

func (*Queries) InsertCharacter

func (q *Queries) InsertCharacter(ctx context.Context, arg InsertCharacterParams) error

func (*Queries) InsertEncounter

func (q *Queries) InsertEncounter(ctx context.Context, arg InsertEncounterParams) (int32, error)

func (*Queries) InsertPlayer

func (q *Queries) InsertPlayer(ctx context.Context, arg []InsertPlayerParams) (int64, error)

func (*Queries) InsertPlayerInternal

func (q *Queries) InsertPlayerInternal(ctx context.Context, arg InsertPlayerInternalParams) error

func (*Queries) ListEncounters

func (q *Queries) ListEncounters(ctx context.Context) ([]int32, error)

func (*Queries) ListFriends

func (q *Queries) ListFriends(ctx context.Context, user1 pgtype.UUID) ([]ListFriendsRow, error)

func (*Queries) ListReceivedFriendRequests

func (q *Queries) ListReceivedFriendRequests(ctx context.Context, user2 string) ([]ListReceivedFriendRequestsRow, error)

func (*Queries) ListSentFriendRequests

func (q *Queries) ListSentFriendRequests(ctx context.Context, user1 string) ([]ListSentFriendRequestsRow, error)

func (*Queries) ListUserEncounters

func (q *Queries) ListUserEncounters(ctx context.Context, uploadedBy pgtype.UUID) ([]int32, error)

func (*Queries) MarkThumbnail

func (q *Queries) MarkThumbnail(ctx context.Context, id int32) error

func (*Queries) ProcessEncounter

func (q *Queries) ProcessEncounter(ctx context.Context, arg ProcessEncounterParams) (pgtype.UUID, error)

func (*Queries) SendFriendRequest

func (q *Queries) SendFriendRequest(ctx context.Context, arg SendFriendRequestParams) error

func (*Queries) SetAccessToken

func (q *Queries) SetAccessToken(ctx context.Context, arg SetAccessTokenParams) error

func (*Queries) SetUserRoles

func (q *Queries) SetUserRoles(ctx context.Context, arg SetUserRolesParams) error

func (*Queries) SetUsername

func (q *Queries) SetUsername(ctx context.Context, arg SetUsernameParams) error

func (*Queries) UpdateAvatar

func (q *Queries) UpdateAvatar(ctx context.Context, arg UpdateAvatarParams) error

func (*Queries) UpdateEncounterVisibility

func (q *Queries) UpdateEncounterVisibility(ctx context.Context, arg UpdateEncounterVisibilityParams) error

func (*Queries) UpdateRoles

func (q *Queries) UpdateRoles(ctx context.Context, arg UpdateRolesParams) error

func (*Queries) UpdateUniqueGroup

func (q *Queries) UpdateUniqueGroup(ctx context.Context, arg UpdateUniqueGroupParams) error

func (*Queries) UpdateUserEncounterVisibility

func (q *Queries) UpdateUserEncounterVisibility(ctx context.Context, arg UpdateUserEncounterVisibilityParams) error

func (*Queries) UpsertEncounterGroup

func (q *Queries) UpsertEncounterGroup(ctx context.Context, arg UpsertEncounterGroupParams) error

func (*Queries) UpsertUser

func (q *Queries) UpsertUser(ctx context.Context, arg UpsertUserParams) (User, error)

func (*Queries) Whitelist

func (q *Queries) Whitelist(ctx context.Context, arg WhitelistParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Raid

type Raid struct {
	ID         int32
	Boss       string
	Difficulty string
	Date       pgtype.Timestamp
	Duration   int64
	Uploaders  []pgtype.UUID
	Players    []string
}

type Roster

type Roster struct {
	UserID    pgtype.UUID
	Character string
	Class     string
	GearScore float64
}

type SendFriendRequestParams

type SendFriendRequestParams struct {
	User1 string
	User2 string
}

type SetAccessTokenParams

type SetAccessTokenParams struct {
	ID          pgtype.UUID
	AccessToken *string
}

type SetUserRolesParams

type SetUserRolesParams struct {
	DiscordTag string
	Roles      []string
}

type SetUsernameParams

type SetUsernameParams struct {
	ID       pgtype.UUID
	Username *string
}

type UpdateAvatarParams

type UpdateAvatarParams struct {
	ID     pgtype.UUID
	Avatar string
}

type UpdateEncounterVisibilityParams

type UpdateEncounterVisibilityParams struct {
	ID         int32
	Visibility *structs.EncounterVisibility
}

type UpdateRolesParams

type UpdateRolesParams struct {
	ID    pgtype.UUID
	Roles []string
}

type UpdateUniqueGroupParams

type UpdateUniqueGroupParams struct {
	ID          int32
	UniqueGroup int32
}

type UpdateUserEncounterVisibilityParams

type UpdateUserEncounterVisibilityParams struct {
	ID            pgtype.UUID
	LogVisibility *structs.EncounterVisibility
}

type UpsertEncounterGroupParams

type UpsertEncounterGroupParams struct {
	GroupID int32
	Column2 pgtype.UUID
}

type UpsertUserParams

type UpsertUserParams struct {
	DiscordID  string
	DiscordTag string
	Roles      []string
	Avatar     string
	Settings   structs.UserSettings
}

type User

type User struct {
	ID            pgtype.UUID
	Username      *string
	CreatedAt     pgtype.Timestamp
	UpdatedAt     pgtype.Timestamp
	AccessToken   *string
	DiscordID     string
	DiscordTag    string
	Avatar        string
	Friends       []pgtype.UUID
	Settings      structs.UserSettings
	LogVisibility *structs.EncounterVisibility
	Titles        []string
	Roles         []string
}

type Whitelist

type Whitelist struct {
	Discord string
	Role    string
}

type WhitelistParams

type WhitelistParams struct {
	Discord string
	Role    string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL