sqlcgen

package
v0.9.77 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	ID        int64
	TenantID  int64
	ProjectID *int64
	KeyHash   []byte
	Label     *string
	Scopes    []string
	KeyType   string
	CreatedAt pgtype.Timestamptz
	RevokedAt pgtype.Timestamptz
}

type AdvanceLeaderboardPeriodParams

type AdvanceLeaderboardPeriodParams struct {
	PeriodStartedAt pgtype.Timestamptz
	NextResetAt     pgtype.Timestamptz
	ID              int64
}

type AllocationStatus

type AllocationStatus string
const (
	AllocationStatusPending    AllocationStatus = "pending"
	AllocationStatusAllocating AllocationStatus = "allocating"
	AllocationStatusReady      AllocationStatus = "ready"
	AllocationStatusAllocated  AllocationStatus = "allocated"
	AllocationStatusDraining   AllocationStatus = "draining"
	AllocationStatusShutdown   AllocationStatus = "shutdown"
	AllocationStatusFailed     AllocationStatus = "failed"
)

func (*AllocationStatus) Scan

func (e *AllocationStatus) Scan(src interface{}) error

type ApproveTenantChangeRequestParams

type ApproveTenantChangeRequestParams struct {
	ID         int64
	ReviewedBy *int64
}

type ApproveTenantSignupRequestParams

type ApproveTenantSignupRequestParams struct {
	FinalTenantName  *string
	CodeHash         []byte
	CodeExpiresAt    pgtype.Timestamptz
	ReviewedByUserID *int64
	ID               int64
}

type ArchiveLeaderboardPeriodParams

type ArchiveLeaderboardPeriodParams struct {
	LeaderboardID int64
	Period        int32
	StartedAt     pgtype.Timestamptz
	EndedAt       pgtype.Timestamptz
}

type AreAccountsFriendsAcceptedParams

type AreAccountsFriendsAcceptedParams struct {
	A pgtype.UUID
	B pgtype.UUID
}

type AuditLog

type AuditLog struct {
	ID           int64
	TenantID     int64
	ActorUserID  *int64
	Action       string
	Target       *string
	Payload      []byte
	OccurredAt   pgtype.Timestamptz
	ActorService *string
}

type BindPlayerLinkedEmailParams

type BindPlayerLinkedEmailParams struct {
	Email           *string
	PlayerAccountID pgtype.UUID
	ID              int64
}

type BumpAccountPlayerEpochsInTenantParams

type BumpAccountPlayerEpochsInTenantParams struct {
	TenantID        int64
	PlayerAccountID pgtype.UUID
}

type BumpControlPanelLoginFailureParams

type BumpControlPanelLoginFailureParams struct {
	FailureLimit int32
	LockoutUntil pgtype.Timestamptz
	ID           int64
}

type BumpControlPanelLoginFailureRow

type BumpControlPanelLoginFailureRow struct {
	LoginFailures int32
	LockedUntil   pgtype.Timestamptz
}

type CancelMatchmakingTicketParams

type CancelMatchmakingTicketParams struct {
	ID       int64
	PlayerID int64
}

type CancelPlayerDeleteByAccountParams

type CancelPlayerDeleteByAccountParams struct {
	ID              int64
	PlayerAccountID pgtype.UUID
}

type CancelPlayerDeleteInProjectParams

type CancelPlayerDeleteInProjectParams struct {
	ID        int64
	ProjectID int64
	TenantID  int64
}

type CasbinRule

type CasbinRule struct {
	ID    int64
	Ptype string
	V0    *string
	V1    *string
	V2    *string
	V3    *string
	V4    *string
	V5    *string
}

type ClaimMatchmakerBucketParams

type ClaimMatchmakerBucketParams struct {
	ClaimID   pgtype.UUID
	Ttl       pgtype.Interval
	Limit     int32
	TenantID  int64
	ProjectID int64
	Mode      string
	FleetID   *int64
	Region    string
	GameMode  string
}

type ClaimMatchmakerBucketRow

type ClaimMatchmakerBucketRow struct {
	ID                int64
	EntryID           int64
	PartyID           *int64
	TenantID          int64
	ProjectID         int64
	FleetID           *int64
	PlayerID          int64
	Region            string
	GameMode          string
	Attributes        []byte
	Status            string
	MatchAddress      string
	MatchProtocol     string
	Mode              string
	MinCount          int32
	MaxCount          int32
	CountMultiple     int32
	AllowCrossRegion  bool
	Query             string
	StringProperties  []byte
	NumericProperties []byte
	CreatedAt         pgtype.Timestamptz
	MatchedAt         pgtype.Timestamptz
}

type ClaimVerifiedPlayerAccountParams

type ClaimVerifiedPlayerAccountParams struct {
	Email        string
	PasswordHash []byte
}

type CommitMatchmakerTicketsParams

type CommitMatchmakerTicketsParams struct {
	MatchID       string
	MatchAddress  string
	MatchProtocol string
	ClaimID       pgtype.UUID
	TicketIds     []int64
}

type CompletePlayerPasswordResetParams

type CompletePlayerPasswordResetParams struct {
	PasswordHash []byte
	ID           int64
	CodeHash     []byte
}

type ConfirmControlPanelTOTPParams

type ConfirmControlPanelTOTPParams struct {
	LastUsedStep       int64
	ControlPanelUserID int64
}

type ConfirmPlayerAccountTOTPParams

type ConfirmPlayerAccountTOTPParams struct {
	LastUsedStep    int64
	PlayerAccountID pgtype.UUID
}

type ConnectionLimitOverride

type ConnectionLimitOverride struct {
	TenantID  int64
	Sustained int64
	Ceiling   int64
	UpdatedBy *int64
	UpdatedAt pgtype.Timestamptz
}

type ConsumeControlPanelTOTPBackupCodeParams

type ConsumeControlPanelTOTPBackupCodeParams struct {
	ControlPanelUserID int64
	CodeHash           []byte
}

type ConsumePlayerAccountTOTPBackupCodeParams

type ConsumePlayerAccountTOTPBackupCodeParams struct {
	PlayerAccountID pgtype.UUID
	CodeHash        []byte
}

type ControlPanelCreateTenantBareParams

type ControlPanelCreateTenantBareParams struct {
	ActorUserID int64
	TenantName  string
}

type ControlPanelCreateTenantParams

type ControlPanelCreateTenantParams struct {
	ActorUserID int64
	TenantName  string
	ProjectName string
	KeyHash     []byte
	KeyLabel    string
}

type ControlPanelCreateTenantRow

type ControlPanelCreateTenantRow struct {
	TenantID     int64
	ProjectID    int64
	ApiKeyID     int64
	MembershipID int64
}

type ControlPanelInvitation

type ControlPanelInvitation struct {
	ID              int64
	Email           string
	TenantID        *int64
	Role            string
	CodeHash        []byte
	ExpiresAt       pgtype.Timestamptz
	AcceptedAt      pgtype.Timestamptz
	RevokedAt       pgtype.Timestamptz
	InvitedByUserID int64
	CreatedAt       pgtype.Timestamptz
}

type ControlPanelMembership

type ControlPanelMembership struct {
	ID                 int64
	ControlPanelUserID int64
	TenantID           int64
	Role               string
	CreatedAt          pgtype.Timestamptz
}

type ControlPanelPasswordReset

type ControlPanelPasswordReset struct {
	ID                 int64
	ControlPanelUserID int64
	TokenHash          []byte
	ExpiresAt          pgtype.Timestamptz
	UsedAt             pgtype.Timestamptz
	CreatedAt          pgtype.Timestamptz
}

type ControlPanelSession

type ControlPanelSession struct {
	ID                 int64
	ControlPanelUserID int64
	RefreshHash        []byte
	CsrfSecret         []byte
	ExpiresAt          pgtype.Timestamptz
	LastSeenAt         pgtype.Timestamptz
	RevokedAt          pgtype.Timestamptz
	Ip                 *string
	UserAgent          *string
	CreatedAt          pgtype.Timestamptz
}

type ControlPanelTrustedDevice

type ControlPanelTrustedDevice struct {
	ID                 int64
	ControlPanelUserID int64
	TokenHash          []byte
	ExpiresAt          pgtype.Timestamptz
	Ip                 *string
	UserAgent          *string
	CreatedAt          pgtype.Timestamptz
}

type ControlPanelUser

type ControlPanelUser struct {
	ID                                int64
	Email                             string
	PasswordHash                      []byte
	IsPlatformAdmin                   bool
	LoginFailures                     int32
	LockedUntil                       pgtype.Timestamptz
	LastLoginAt                       pgtype.Timestamptz
	CreatedAt                         pgtype.Timestamptz
	EmailVerifiedAt                   pgtype.Timestamptz
	EmailVerificationCodeHash         []byte
	EmailVerificationSalt             []byte
	EmailVerificationExpiresAt        pgtype.Timestamptz
	EmailVerificationAttempts         int32
	EmailVerificationLastSentAt       pgtype.Timestamptz
	DisabledAt                        pgtype.Timestamptz
	EmailVerificationLifetimeAttempts int32
	EmailVerificationLockedUntil      pgtype.Timestamptz
}

type ControlPanelUserConnection

type ControlPanelUserConnection struct {
	ID                 int64
	ControlPanelUserID int64
	Provider           string
	Subject            string
	CreatedAt          pgtype.Timestamptz
	LastUsedAt         pgtype.Timestamptz
}

type ControlPanelUserTotp

type ControlPanelUserTotp struct {
	ControlPanelUserID int64
	SecretEnc          []byte
	ConfirmedAt        pgtype.Timestamptz
	LastUsedStep       int64
	Attempts           int32
	LockedUntil        pgtype.Timestamptz
	CreatedAt          pgtype.Timestamptz
}

type ControlPanelUserTotpBackupCode

type ControlPanelUserTotpBackupCode struct {
	ID                 int64
	ControlPanelUserID int64
	CodeHash           []byte
	UsedAt             pgtype.Timestamptz
	CreatedAt          pgtype.Timestamptz
}

type CountActiveGameSessionPeersParams

type CountActiveGameSessionPeersParams struct {
	SessionID     string
	ExcludeUserID int64
}

type CountActiveSignalMembersParams

type CountActiveSignalMembersParams struct {
	SessionID string
	ProjectID int64
	PlayerIds []int64
}

type CountAllocationsForProjectParams

type CountAllocationsForProjectParams struct {
	ProjectID       int64
	IncludeTerminal bool
}

type CountMatchmakerMatchesByModeRow

type CountMatchmakerMatchesByModeRow struct {
	Mode       string
	MatchCount int64
}

type CountPendingGameInviteForSessionPlayerParams

type CountPendingGameInviteForSessionPlayerParams struct {
	SessionID  string
	ToPlayerID int64
}

type CountPlayersForProjectParams

type CountPlayersForProjectParams struct {
	TenantID    int64
	ProjectID   int64
	EmailFilter *string
}

type CountQueuedTicketsLikeParams

type CountQueuedTicketsLikeParams struct {
	ProjectID int64
	Mode      string
	FleetID   *int64
	Region    string
	GameMode  string
}

type CountRecentGameSessionSignalsParams

type CountRecentGameSessionSignalsParams struct {
	SessionID    string
	FromPlayerID int64
}

type CreateAPIKeyParams

type CreateAPIKeyParams struct {
	TenantID  int64
	ProjectID *int64
	KeyHash   []byte
	Label     *string
	KeyType   string
	Scopes    []string
}

type CreateAPIKeyRow

type CreateAPIKeyRow struct {
	ID        int64
	CreatedAt pgtype.Timestamptz
}

type CreateAnonymousPlayerParams

type CreateAnonymousPlayerParams struct {
	ProjectID  int64
	ExternalID string
}

type CreateAnonymousPlayerRow

type CreateAnonymousPlayerRow struct {
	ID         int64
	ExternalID string
	CreatedAt  pgtype.Timestamptz
}

type CreateControlPanelAPIKeyParams

type CreateControlPanelAPIKeyParams struct {
	ProjectID *int64
	KeyHash   []byte
	Label     string
	KeyType   string
	Scopes    []string
}

type CreateControlPanelAPIKeyRow

type CreateControlPanelAPIKeyRow struct {
	ID        int64
	CreatedAt pgtype.Timestamptz
}

type CreateControlPanelInvitationParams

type CreateControlPanelInvitationParams struct {
	Email           string
	TenantID        *int64
	Role            string
	CodeHash        []byte
	ExpiresAt       pgtype.Timestamptz
	InvitedByUserID int64
}

type CreateControlPanelInvitationRow

type CreateControlPanelInvitationRow struct {
	ID        int64
	CreatedAt pgtype.Timestamptz
	ExpiresAt pgtype.Timestamptz
}

type CreateControlPanelMembershipParams

type CreateControlPanelMembershipParams struct {
	ControlPanelUserID int64
	TenantID           int64
	Role               string
}

type CreateControlPanelPasswordResetParams

type CreateControlPanelPasswordResetParams struct {
	ControlPanelUserID int64
	TokenHash          []byte
	ExpiresAt          pgtype.Timestamptz
}

type CreateControlPanelSessionParams

type CreateControlPanelSessionParams struct {
	ControlPanelUserID int64
	RefreshHash        []byte
	CsrfSecret         []byte
	ExpiresAt          pgtype.Timestamptz
	Ip                 *string
	UserAgent          *string
}

type CreateControlPanelSessionRow

type CreateControlPanelSessionRow struct {
	ID        int64
	ExpiresAt pgtype.Timestamptz
	CreatedAt pgtype.Timestamptz
}

type CreateControlPanelTrustedDeviceParams

type CreateControlPanelTrustedDeviceParams struct {
	ControlPanelUserID int64
	TokenHash          []byte
	ExpiresAt          pgtype.Timestamptz
	Ip                 *string
	UserAgent          *string
}

type CreateControlPanelUserParams

type CreateControlPanelUserParams struct {
	Email           string
	PasswordHash    []byte
	IsPlatformAdmin bool
}

type CreateControlPanelUserRow

type CreateControlPanelUserRow struct {
	ID              int64
	Email           string
	IsPlatformAdmin bool
	CreatedAt       pgtype.Timestamptz
}

type CreateEmailPlayerParams

type CreateEmailPlayerParams struct {
	ProjectID                  int64
	ExternalID                 string
	Email                      *string
	PasswordHash               []byte
	EmailVerificationCodeHash  []byte
	EmailVerificationSalt      []byte
	EmailVerificationExpiresAt pgtype.Timestamptz
}

type CreateFirstControlPanelAdminParams

type CreateFirstControlPanelAdminParams struct {
	Email        string
	PasswordHash []byte
}

type CreateFirstControlPanelAdminRow

type CreateFirstControlPanelAdminRow struct {
	ID              int64
	Email           string
	IsPlatformAdmin bool
	CreatedAt       pgtype.Timestamptz
}

type CreateFleetParams

type CreateFleetParams struct {
	ProjectID int64
	Name      string
	Backend   string
	Config    []byte
}

type CreateGameInviteParams

type CreateGameInviteParams struct {
	ProjectID    int64
	FromPlayerID int64
	ToPlayerID   int64
	SessionID    string
	JoinCode     string
	ExpiresAt    pgtype.Timestamptz
}

type CreateGameSessionParams

type CreateGameSessionParams struct {
	ID           string
	JoinCode     string
	ProjectID    int64
	TitleID      string
	HostPlayerID int64
	Props        []byte
	MaxPlayers   int32
	Private      bool
	ExpiresAt    pgtype.Timestamptz
}

type CreateGameSessionRow

type CreateGameSessionRow struct {
	ID        string
	JoinCode  string
	State     string
	CreatedAt pgtype.Timestamptz
}

type CreateLeaderboardParams

type CreateLeaderboardParams struct {
	ProjectID         int64
	Name              string
	SortOrder         string
	ScoreOperator     string
	Metadata          []byte
	ClientSubmissions bool
	ScoreMin          *int64
	ScoreMax          *int64
	ResetSchedule     string
	AttemptCap        *int32
	PeriodStartedAt   pgtype.Timestamptz
	NextResetAt       pgtype.Timestamptz
}

type CreateLinkedPlayerParams

type CreateLinkedPlayerParams struct {
	ProjectID       int64
	ExternalID      string
	Email           *string
	PlayerAccountID pgtype.UUID
}

type CreateMCPTokenParams

type CreateMCPTokenParams struct {
	ProjectID       int64
	CreatedByUserID int64
	Label           string
	TokenHash       []byte
	TokenHint       string
	Scopes          []string
	ExpiresAt       pgtype.Timestamptz
}

type CreatePendingAllocationParams

type CreatePendingAllocationParams struct {
	ProjectID int64
	FleetID   *int64
	Backend   string
	Region    string
	Metadata  []byte
}

type CreatePendingAllocationRow

type CreatePendingAllocationRow struct {
	ID          int64
	RequestedAt pgtype.Timestamptz
}

type CreatePlayerAccountParams

type CreatePlayerAccountParams struct {
	Email        string
	PasswordHash []byte
	DisplayName  *string
	CodeHash     []byte
	CodeSalt     []byte
	ExpiresAt    pgtype.Timestamptz
}

type CreatePlayerAccountPasswordResetParams

type CreatePlayerAccountPasswordResetParams struct {
	PlayerAccountID pgtype.UUID
	TokenHash       []byte
	ExpiresAt       pgtype.Timestamptz
}

type CreatePlayerAccountRow

type CreatePlayerAccountRow struct {
	ID        pgtype.UUID
	Email     string
	CreatedAt pgtype.Timestamptz
}

type CreatePlayerAccountSessionParams

type CreatePlayerAccountSessionParams struct {
	PlayerAccountID pgtype.UUID
	RefreshHash     []byte
	SessionEpoch    int32
	ExpiresAt       pgtype.Timestamptz
}

type CreatePlayerAccountTrustedDeviceParams

type CreatePlayerAccountTrustedDeviceParams struct {
	PlayerAccountID pgtype.UUID
	TokenHash       []byte
	ExpiresAt       pgtype.Timestamptz
}

type CreatePlayerInvitationParams

type CreatePlayerInvitationParams struct {
	ProjectID       int64
	Email           string
	CodeHash        []byte
	ExpiresAt       pgtype.Timestamptz
	InvitedByUserID int64
	ProjectPlayerID *int64
}

type CreatePlayerInvitationRow

type CreatePlayerInvitationRow struct {
	ID        int64
	CreatedAt pgtype.Timestamptz
	ExpiresAt pgtype.Timestamptz
}

type CreatePlayerParams

type CreatePlayerParams struct {
	ExternalID   string
	Email        *string
	PasswordHash []byte
	CodeHash     []byte
	CodeSalt     []byte
	ExpiresAt    pgtype.Timestamptz
	ProjectID    int64
}

type CreatePlayerRow

type CreatePlayerRow struct {
	ID       int64
	TenantID int64
}

type CreatePlayerSessionParams

type CreatePlayerSessionParams struct {
	PlayerID    int64
	RefreshHash []byte
	ExpiresAt   pgtype.Timestamptz
}

type CreateProjectForTenantRow

type CreateProjectForTenantRow struct {
	ID        int64
	Name      string
	CreatedAt pgtype.Timestamptz
}

type CreateRealtimeTicketParams

type CreateRealtimeTicketParams struct {
	TicketHash   []byte
	ApiKeyHash   []byte
	PlayerID     int64
	ProjectID    int64
	SessionEpoch int64
	ExpiresAt    pgtype.Timestamptz
}

type CreateRelayNodeParams

type CreateRelayNodeParams struct {
	Region       string
	TurnUrls     []string
	LifecycleUrl string
}

type CreateSessionParams

type CreateSessionParams struct {
	ProjectID   int64
	PlayerID    int64
	RefreshHash []byte
	ExpiresAt   pgtype.Timestamptz
}

type CreateSessionRow

type CreateSessionRow struct {
	ID        int64
	CreatedAt pgtype.Timestamptz
}

type CreateTenantChangeRequestParams

type CreateTenantChangeRequestParams struct {
	TenantID          int64
	RequestedByUserID *int64
	Kind              string
	RequestedTier     *int16
	Feature           *string
	RequestedLimit    *int64
	Note              string
}

type CreateTenantPlayerBanParams

type CreateTenantPlayerBanParams struct {
	TenantID        int64
	PlayerAccountID pgtype.UUID
	Reason          *string
	CreatedBy       *int64
}

type CreateTenantSignupRequestParams

type CreateTenantSignupRequestParams struct {
	Email               string
	RequestedTenantName string
	ProjectDescription  string
	StudioName          *string
}

type CreateTenantSignupRequestRow

type CreateTenantSignupRequestRow struct {
	ID                  int64
	Email               string
	RequestedTenantName string
	Status              string
	CreatedAt           pgtype.Timestamptz
}

type CreateVerifiedControlPanelUserParams

type CreateVerifiedControlPanelUserParams struct {
	Email           string
	PasswordHash    []byte
	IsPlatformAdmin bool
}

type CreateVerifiedControlPanelUserRow

type CreateVerifiedControlPanelUserRow struct {
	ID              int64
	Email           string
	IsPlatformAdmin bool
	CreatedAt       pgtype.Timestamptz
}

type CreateVerifiedPlayerAccountParams

type CreateVerifiedPlayerAccountParams struct {
	Email        string
	PasswordHash []byte
	DisplayName  *string
}

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 DeleteControlPanelMembershipParams

type DeleteControlPanelMembershipParams struct {
	ID       int64
	TenantID int64
}

type DeleteControlPanelMembershipUnlessSelfParams

type DeleteControlPanelMembershipUnlessSelfParams struct {
	ID          int64
	TenantID    int64
	ActorUserID int64
}

type DeleteControlPanelUserConnectionParams

type DeleteControlPanelUserConnectionParams struct {
	ControlPanelUserID int64
	Provider           string
}

type DeleteFriendEdgeByAccountParams

type DeleteFriendEdgeByAccountParams struct {
	Me    pgtype.UUID
	Other pgtype.UUID
}

type DeleteFriendEdgeDirectedParams

type DeleteFriendEdgeDirectedParams struct {
	FromAccountID pgtype.UUID
	ToAccountID   pgtype.UUID
	Status        string
}

type DeleteGameInviteParams

type DeleteGameInviteParams struct {
	ID       int64
	CallerID int64
}

type DeleteGameSessionPeerParams

type DeleteGameSessionPeerParams struct {
	SessionID string
	PlayerID  int64
}

type DeletePlayerAccountConnectionParams

type DeletePlayerAccountConnectionParams struct {
	PlayerAccountID pgtype.UUID
	Provider        string
}

type DeleteQuotaOverrideParams

type DeleteQuotaOverrideParams struct {
	TenantID int64
	Axis     string
}

type DeleteRateLimitOverrideParams

type DeleteRateLimitOverrideParams struct {
	TenantID  int64
	Kind      string
	ProjectID *int64
}

type DeleteTenantPlayerBanParams

type DeleteTenantPlayerBanParams struct {
	TenantID        int64
	PlayerAccountID pgtype.UUID
}

type DenyTenantChangeRequestParams

type DenyTenantChangeRequestParams struct {
	ID           int64
	ReviewedBy   *int64
	ReviewReason *string
}

type DenyTenantSignupRequestParams

type DenyTenantSignupRequestParams struct {
	ReviewReason     *string
	ReviewedByUserID *int64
	ID               int64
}

type DisableTenantFeatureGrantParams

type DisableTenantFeatureGrantParams struct {
	Reason  *string
	Feature string
}

type EmailSuppression

type EmailSuppression struct {
	Email     string
	CreatedAt pgtype.Timestamptz
}

type ExpirePlayerQueuedTicketParams

type ExpirePlayerQueuedTicketParams struct {
	ProjectID int64
	PlayerID  int64
}

type ExtendGameSessionExpiryOnHeartbeatParams

type ExtendGameSessionExpiryOnHeartbeatParams struct {
	ExpiresAt pgtype.Timestamptz
	ID        string
	Threshold pgtype.Timestamptz
}

type ExtendGameSessionExpiryParams

type ExtendGameSessionExpiryParams struct {
	ExpiresAt pgtype.Timestamptz
	ProjectID int64
	ID        string
}

type FeatureGrant

type FeatureGrant struct {
	ID                           int64
	TenantID                     int64
	ProjectID                    *int64
	Feature                      string
	Enabled                      bool
	ApprovedByControlPanelUserID *int64
	Reason                       *string
	CreatedAt                    pgtype.Timestamptz
	UpdatedAt                    pgtype.Timestamptz
}

type FindAccountIDsByDisplayNameRow

type FindAccountIDsByDisplayNameRow struct {
	ID    pgtype.UUID
	Email string
}

type Fleet

type Fleet struct {
	ID        int64
	TenantID  int64
	ProjectID int64
	Name      string
	Backend   string
	Config    []byte
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
	DeletedAt pgtype.Timestamptz
}

type FleetAllocationEvent

type FleetAllocationEvent struct {
	ID           int64
	TenantID     int64
	AllocationID int64
	Status       AllocationStatus
	Address      string
	ErrMessage   string
	CreatedAt    pgtype.Timestamptz
}

type FriendEdge

type FriendEdge struct {
	ID            int64
	FromAccountID pgtype.UUID
	ToAccountID   pgtype.UUID
	Status        string
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
}

type GameInvite

type GameInvite struct {
	ID           int64
	TenantID     int64
	ProjectID    int64
	FromPlayerID int64
	ToPlayerID   int64
	SessionID    string
	JoinCode     string
	CreatedAt    pgtype.Timestamptz
	ExpiresAt    pgtype.Timestamptz
}

type GameServerAllocation

type GameServerAllocation struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Backend     string
	BackendRef  string
	Region      string
	Address     string
	Status      AllocationStatus
	Metadata    []byte
	RequestedAt pgtype.Timestamptz
	ReadyAt     pgtype.Timestamptz
	ReleasedAt  pgtype.Timestamptz
	FleetID     *int64
}

type GameSession

type GameSession struct {
	ID           string
	JoinCode     string
	TenantID     int64
	ProjectID    int64
	TitleID      string
	HostPlayerID int64
	State        string
	Props        []byte
	MaxPlayers   int32
	Private      bool
	CreatedAt    pgtype.Timestamptz
	ExpiresAt    pgtype.Timestamptz
}

type GameSessionPeer

type GameSessionPeer struct {
	TenantID  int64
	SessionID string
	PlayerID  int64
	Ip        *string
	Port      *int32
	Qos       []byte
	LastSeen  pgtype.Timestamptz
}

type GameSessionSignal

type GameSessionSignal struct {
	ID            int64
	TenantID      int64
	SessionID     string
	FromPlayerID  int64
	ToPlayerID    int64
	NegotiationID string
	Kind          string
	Payload       string
	CreatedAt     pgtype.Timestamptz
	ExpiresAt     pgtype.Timestamptz
}

type GetAPIKeyByHashRow

type GetAPIKeyByHashRow struct {
	ID                  int64
	TenantID            int64
	ProjectID           *int64
	KeyType             string
	Scopes              []string
	RevokedAt           pgtype.Timestamptz
	Tier                int16
	TenantDisabled      bool
	ConnectionSustained int64
	ConnectionCeiling   int64
}

type GetAPIKeyScopesRow

type GetAPIKeyScopesRow struct {
	Scopes    []string
	ProjectID *int64
}

type GetAPIRateLimitOverrideRow

type GetAPIRateLimitOverrideRow struct {
	Rate  float64
	Burst float64
}

type GetAllocationRow

type GetAllocationRow struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	FleetID     *int64
	Backend     string
	BackendRef  string
	Region      string
	Address     string
	Status      string
	Metadata    []byte
	RequestedAt pgtype.Timestamptz
	ReadyAt     pgtype.Timestamptz
	ReleasedAt  pgtype.Timestamptz
}

type GetConnectionLimitOverrideRow

type GetConnectionLimitOverrideRow struct {
	Sustained int64
	Ceiling   int64
}

type GetControlPanelInvitationByCodeHashRow

type GetControlPanelInvitationByCodeHashRow struct {
	ID              int64
	Email           string
	TenantID        *int64
	Role            string
	ExpiresAt       pgtype.Timestamptz
	AcceptedAt      pgtype.Timestamptz
	RevokedAt       pgtype.Timestamptz
	InvitedByUserID int64
	CreatedAt       pgtype.Timestamptz
	TenantName      *string
}

type GetControlPanelInvitationByIDRow

type GetControlPanelInvitationByIDRow struct {
	ID              int64
	Email           string
	TenantID        *int64
	Role            string
	ExpiresAt       pgtype.Timestamptz
	AcceptedAt      pgtype.Timestamptz
	RevokedAt       pgtype.Timestamptz
	InvitedByUserID int64
	CreatedAt       pgtype.Timestamptz
}

type GetControlPanelMembershipParams

type GetControlPanelMembershipParams struct {
	ControlPanelUserID int64
	TenantID           int64
}

type GetControlPanelMembershipRow

type GetControlPanelMembershipRow struct {
	ID   int64
	Role string
}

type GetControlPanelSessionByRefreshHashRow

type GetControlPanelSessionByRefreshHashRow struct {
	ID                 int64
	ControlPanelUserID int64
	CsrfSecret         []byte
	ExpiresAt          pgtype.Timestamptz
	RevokedAt          pgtype.Timestamptz
	CreatedAt          pgtype.Timestamptz
	Email              string
	IsPlatformAdmin    bool
	HasPassword        bool
}

type GetControlPanelTOTPRow

type GetControlPanelTOTPRow struct {
	ControlPanelUserID int64
	SecretEnc          []byte
	ConfirmedAt        pgtype.Timestamptz
	LastUsedStep       int64
	Attempts           int32
	LockedUntil        pgtype.Timestamptz
}

type GetControlPanelTrustedDeviceParams

type GetControlPanelTrustedDeviceParams struct {
	TokenHash          []byte
	ControlPanelUserID int64
}

type GetControlPanelUserAnyStatusByEmailRow

type GetControlPanelUserAnyStatusByEmailRow struct {
	ID              int64
	Email           string
	PasswordHash    []byte
	IsPlatformAdmin bool
	DisabledAt      pgtype.Timestamptz
}

type GetControlPanelUserByConnectionParams

type GetControlPanelUserByConnectionParams struct {
	Provider string
	Subject  string
}

type GetControlPanelUserByConnectionRow

type GetControlPanelUserByConnectionRow struct {
	ID              int64
	Email           string
	IsPlatformAdmin bool
	EmailVerifiedAt pgtype.Timestamptz
	DisabledAt      pgtype.Timestamptz
}

type GetControlPanelUserByEmailRow

type GetControlPanelUserByEmailRow struct {
	ID              int64
	Email           string
	PasswordHash    []byte
	IsPlatformAdmin bool
	LoginFailures   int32
	LockedUntil     pgtype.Timestamptz
	LastLoginAt     pgtype.Timestamptz
	EmailVerifiedAt pgtype.Timestamptz
	CreatedAt       pgtype.Timestamptz
}

type GetControlPanelUserByIDRow

type GetControlPanelUserByIDRow struct {
	ID              int64
	Email           string
	IsPlatformAdmin bool
	CreatedAt       pgtype.Timestamptz
}

type GetControlPanelUserVerificationStateRow

type GetControlPanelUserVerificationStateRow struct {
	ID                                int64
	Email                             string
	EmailVerifiedAt                   pgtype.Timestamptz
	EmailVerificationCodeHash         []byte
	EmailVerificationSalt             []byte
	EmailVerificationExpiresAt        pgtype.Timestamptz
	EmailVerificationAttempts         int32
	EmailVerificationLifetimeAttempts int32
	EmailVerificationLockedUntil      pgtype.Timestamptz
	EmailVerificationLastSentAt       pgtype.Timestamptz
}

type GetFleetByNameParams

type GetFleetByNameParams struct {
	ProjectID int64
	Name      string
}

type GetFriendEdgeByAccountParams

type GetFriendEdgeByAccountParams struct {
	FromAccountID pgtype.UUID
	ToAccountID   pgtype.UUID
}

type GetFriendEdgeByAccountRow

type GetFriendEdgeByAccountRow struct {
	ID     int64
	Status string
}

type GetGameSessionByJoinCodeParams

type GetGameSessionByJoinCodeParams struct {
	ProjectID int64
	JoinCode  string
}

type GetGameSessionByJoinCodeRow

type GetGameSessionByJoinCodeRow struct {
	ID           string
	JoinCode     string
	State        string
	Private      bool
	HostPlayerID int64
}

type GetGameSessionForUpdateParams

type GetGameSessionForUpdateParams struct {
	ProjectID int64
	ID        string
}

type GetGameSessionForUpdateRow

type GetGameSessionForUpdateRow struct {
	ID           string
	JoinCode     string
	ProjectID    int64
	TitleID      string
	HostPlayerID int64
	State        string
	Props        []byte
	MaxPlayers   int32
	Private      bool
	CreatedAt    pgtype.Timestamptz
	ExpiresAt    pgtype.Timestamptz
}

type GetGameSessionParams

type GetGameSessionParams struct {
	ProjectID int64
	ID        string
}

type GetGameSessionRow

type GetGameSessionRow struct {
	ID           string
	JoinCode     string
	ProjectID    int64
	TitleID      string
	HostPlayerID int64
	State        string
	Props        []byte
	MaxPlayers   int32
	Private      bool
	CreatedAt    pgtype.Timestamptz
	ExpiresAt    pgtype.Timestamptz
}

type GetInviteRateLimitOverrideParams

type GetInviteRateLimitOverrideParams struct {
	TenantID  int64
	Kind      string
	ProjectID *int64
}

type GetInviteRateLimitOverrideRow

type GetInviteRateLimitOverrideRow struct {
	Rate  float64
	Burst float64
}

type GetLeaderboardForControlPanelParams

type GetLeaderboardForControlPanelParams struct {
	ProjectID int64
	ID        int64
}

type GetLeaderboardForControlPanelRow

type GetLeaderboardForControlPanelRow struct {
	ID                int64
	ProjectID         int64
	Name              string
	SortOrder         string
	ScoreOperator     string
	Metadata          []byte
	ClientSubmissions bool
	ScoreMin          *int64
	ScoreMax          *int64
	ResetSchedule     string
	AttemptCap        *int32
	CurrentPeriod     int32
	PeriodStartedAt   pgtype.Timestamptz
	NextResetAt       pgtype.Timestamptz
	CreatedAt         pgtype.Timestamptz
}

type GetLeaderboardForSubmitParams

type GetLeaderboardForSubmitParams struct {
	ID        int64
	ProjectID int64
}

type GetLeaderboardForSubmitRow

type GetLeaderboardForSubmitRow struct {
	ID                int64
	SortOrder         string
	ScoreOperator     string
	ClientSubmissions bool
	ScoreMin          *int64
	ScoreMax          *int64
	AttemptCap        *int32
	ResetSchedule     string
	CurrentPeriod     int32
	PeriodStartedAt   pgtype.Timestamptz
	NextResetAt       pgtype.Timestamptz
}

type GetLeaderboardForUpdateParams

type GetLeaderboardForUpdateParams struct {
	ProjectID int64
	ID        int64
}

type GetLeaderboardForUpdateRow

type GetLeaderboardForUpdateRow struct {
	ID                int64
	Name              string
	SortOrder         string
	ScoreOperator     string
	Metadata          []byte
	ClientSubmissions bool
	ScoreMin          *int64
	ScoreMax          *int64
	ResetSchedule     string
	AttemptCap        *int32
	PeriodStartedAt   pgtype.Timestamptz
	NextResetAt       pgtype.Timestamptz
}

type GetLeaderboardParams

type GetLeaderboardParams struct {
	ID        int64
	ProjectID int64
}

type GetLeaderboardRow

type GetLeaderboardRow struct {
	ID                int64
	SortOrder         string
	ScoreOperator     string
	ClientSubmissions bool
	ScoreMin          *int64
	ScoreMax          *int64
	AttemptCap        *int32
	ResetSchedule     string
	CurrentPeriod     int32
	PeriodStartedAt   pgtype.Timestamptz
	NextResetAt       pgtype.Timestamptz
}

type GetMCPTokenByHashRow

type GetMCPTokenByHashRow struct {
	ID              int64
	TenantID        int64
	ProjectID       int64
	CreatedByUserID int64
	Label           string
	Scopes          []string
	ExpiresAt       pgtype.Timestamptz
	RevokedAt       pgtype.Timestamptz
	LastUsedAt      pgtype.Timestamptz
	TenantDisabled  bool
	CreatorDisabled bool
}

type GetMCPTokenCreatorParams

type GetMCPTokenCreatorParams struct {
	ProjectID int64
	ID        int64
}

type GetMatchmakingTicketForTraceParams

type GetMatchmakingTicketForTraceParams struct {
	ProjectID int64
	ID        int64
}

type GetMatchmakingTicketForTraceRow

type GetMatchmakingTicketForTraceRow struct {
	ID                int64
	PartyID           *int64
	PlayerID          int64
	FleetID           *int64
	Region            string
	GameMode          string
	AttributesBytes   int32
	Status            string
	Mode              string
	MinCount          int32
	MaxCount          int32
	CountMultiple     int32
	AllowCrossRegion  bool
	Query             string
	StringProperties  []byte
	NumericProperties []byte
	CreatedAt         pgtype.Timestamptz
	MatchedAt         pgtype.Timestamptz
	ExpiresAt         pgtype.Timestamptz
	FailureReason     *string
	Claimed           bool
}

type GetMatchmakingTicketParams

type GetMatchmakingTicketParams struct {
	ID       int64
	PlayerID int64
}

type GetMatchmakingTicketRow

type GetMatchmakingTicketRow struct {
	ID                int64
	EntryID           int64
	PartyID           *int64
	TenantID          int64
	ProjectID         int64
	FleetID           *int64
	PlayerID          int64
	Region            string
	GameMode          string
	Attributes        []byte
	Status            string
	MatchAddress      string
	MatchProtocol     string
	Mode              string
	MatchID           string
	MinCount          int32
	MaxCount          int32
	CountMultiple     int32
	AllowCrossRegion  bool
	Query             string
	StringProperties  []byte
	NumericProperties []byte
	CreatedAt         pgtype.Timestamptz
	MatchedAt         pgtype.Timestamptz
	ExpiresAt         pgtype.Timestamptz
	FailureReason     *string
}

type GetPlayerAccountByConnectionParams

type GetPlayerAccountByConnectionParams struct {
	Provider string
	Subject  string
}

type GetPlayerAccountByConnectionRow

type GetPlayerAccountByConnectionRow struct {
	ID           pgtype.UUID
	Email        string
	DisplayName  *string
	DisabledAt   pgtype.Timestamptz
	SessionEpoch int32
}

type GetPlayerAccountByEmailRow

type GetPlayerAccountByEmailRow struct {
	ID              pgtype.UUID
	Email           string
	PasswordHash    []byte
	DisplayName     *string
	EmailVerifiedAt pgtype.Timestamptz
	DisabledAt      pgtype.Timestamptz
	SessionEpoch    int32
}

type GetPlayerAccountByIDRow

type GetPlayerAccountByIDRow struct {
	ID              pgtype.UUID
	Email           string
	DisplayName     *string
	EmailVerifiedAt pgtype.Timestamptz
	DisabledAt      pgtype.Timestamptz
	SessionEpoch    int32
	CreatedAt       pgtype.Timestamptz
}

type GetPlayerAccountForProjectReadParams

type GetPlayerAccountForProjectReadParams struct {
	ID        int64
	ProjectID int64
}

type GetPlayerAccountRemoteAddrsRow

type GetPlayerAccountRemoteAddrsRow struct {
	RemoteAddrIpLan    *string
	RemoteAddrIpPublic *string
	RemoteAddrDns      *string
	RemoteAddrIroh     *string
}

type GetPlayerAccountSessionRow

type GetPlayerAccountSessionRow struct {
	ID              int64
	PlayerAccountID pgtype.UUID
	SnapshotEpoch   int32
	ExpiresAt       pgtype.Timestamptz
	RevokedAt       pgtype.Timestamptz
	Email           string
	DisplayName     *string
	DisabledAt      pgtype.Timestamptz
	AccountEpoch    int32
	HasPassword     bool
}

type GetPlayerAccountTOTPRow

type GetPlayerAccountTOTPRow struct {
	PlayerAccountID pgtype.UUID
	SecretEnc       []byte
	ConfirmedAt     pgtype.Timestamptz
	LastUsedStep    int64
	Attempts        int32
	LockedUntil     pgtype.Timestamptz
}

type GetPlayerAccountTrustedDeviceParams

type GetPlayerAccountTrustedDeviceParams struct {
	TokenHash       []byte
	PlayerAccountID pgtype.UUID
}

type GetPlayerAccountVerificationStateRow

type GetPlayerAccountVerificationStateRow struct {
	ID                                pgtype.UUID
	Email                             string
	EmailVerifiedAt                   pgtype.Timestamptz
	EmailVerificationCodeHash         []byte
	EmailVerificationSalt             []byte
	EmailVerificationExpiresAt        pgtype.Timestamptz
	EmailVerificationAttempts         int32
	EmailVerificationLifetimeAttempts int32
	EmailVerificationLockedUntil      pgtype.Timestamptz
	EmailVerificationLastSentAt       pgtype.Timestamptz
}

type GetPlayerAuthCredentialsRow

type GetPlayerAuthCredentialsRow struct {
	ID           int64
	PasswordHash []byte
	Email        *string
	DisabledAt   pgtype.Timestamptz
}

type GetPlayerByEmailParams

type GetPlayerByEmailParams struct {
	ProjectID int64
	Email     *string
}

type GetPlayerByEmailProjectParams

type GetPlayerByEmailProjectParams struct {
	ProjectID int64
	Email     *string
}

type GetPlayerByEmailProjectRow

type GetPlayerByEmailProjectRow struct {
	ID                          int64
	TenantID                    int64
	ProjectID                   int64
	PasswordHash                []byte
	EmailVerifiedAt             pgtype.Timestamptz
	EmailVerificationCodeHash   []byte
	EmailVerificationSalt       []byte
	EmailVerificationExpiresAt  pgtype.Timestamptz
	EmailVerificationAttempts   int32
	EmailVerificationLastSentAt pgtype.Timestamptz
	DisabledAt                  pgtype.Timestamptz
}

type GetPlayerByEmailRow

type GetPlayerByEmailRow struct {
	ID              int64
	ProjectID       int64
	PasswordHash    []byte
	EmailVerifiedAt pgtype.Timestamptz
}

type GetPlayerByExternalIDParams

type GetPlayerByExternalIDParams struct {
	ProjectID  int64
	ExternalID string
}

type GetPlayerByExternalIDRow

type GetPlayerByExternalIDRow struct {
	ID              int64
	ProjectID       int64
	EmailVerifiedAt pgtype.Timestamptz
}

type GetPlayerDeleteRequestedByAccountParams

type GetPlayerDeleteRequestedByAccountParams struct {
	ID              int64
	PlayerAccountID pgtype.UUID
}

type GetPlayerForAccountLinkParams

type GetPlayerForAccountLinkParams struct {
	ProjectID int64
	Email     *string
}

type GetPlayerForAccountLinkRow

type GetPlayerForAccountLinkRow struct {
	ID              int64
	PlayerAccountID pgtype.UUID
}

type GetPlayerForProjectParams

type GetPlayerForProjectParams struct {
	TenantID  int64
	ProjectID int64
	ID        int64
}

type GetPlayerForProjectRow

type GetPlayerForProjectRow struct {
	ID                     int64
	ExternalID             string
	Email                  string
	EmailVerifiedAt        pgtype.Timestamptz
	DisabledAt             pgtype.Timestamptz
	DeleteRequestedAt      pgtype.Timestamptz
	DeleteRequestedByAdmin bool
	CreatedAt              pgtype.Timestamptz
	TenantID               int64
	ProjectID              int64
	PlayerAccountID        pgtype.UUID
	RemoteAddrIpLan        *string
	RemoteAddrIpPublic     *string
	RemoteAddrDns          *string
	RemoteAddrIroh         *string
	TenantBanned           bool
}

type GetPlayerForVerifyRow

type GetPlayerForVerifyRow struct {
	ID              int64
	TenantID        int64
	ProjectID       int64
	ExternalID      string
	SessionEpoch    int32
	PlayerAccountID pgtype.UUID
	Email           string
}

type GetPlayerIDByEmailParams

type GetPlayerIDByEmailParams struct {
	ProjectID int64
	Email     *string
}

type GetPlayerInvitationByCodeHashRow

type GetPlayerInvitationByCodeHashRow struct {
	ID              int64
	TenantID        int64
	ProjectID       int64
	Email           string
	ExpiresAt       pgtype.Timestamptz
	AcceptedAt      pgtype.Timestamptz
	RevokedAt       pgtype.Timestamptz
	InvitedByUserID int64
	CreatedAt       pgtype.Timestamptz
	ProjectPlayerID *int64
	ProjectName     string
}

type GetPlayerModerationStateParams

type GetPlayerModerationStateParams struct {
	ID        int64
	ProjectID int64
}

type GetPlayerModerationStateRow

type GetPlayerModerationStateRow struct {
	ID         int64
	DisabledAt pgtype.Timestamptz
}

type GetPlayerPasswordResetStateParams

type GetPlayerPasswordResetStateParams struct {
	ProjectID int64
	Email     *string
}

type GetPlayerPasswordResetStateRow

type GetPlayerPasswordResetStateRow struct {
	ID                            int64
	PasswordHash                  []byte
	PasswordResetCodeHash         []byte
	PasswordResetSalt             []byte
	PasswordResetExpiresAt        pgtype.Timestamptz
	PasswordResetAttempts         int32
	PasswordResetLifetimeAttempts int32
	PasswordResetLockedUntil      pgtype.Timestamptz
	PasswordResetLastSentAt       pgtype.Timestamptz
}

type GetPlayerPendingDeleteByEmailParams

type GetPlayerPendingDeleteByEmailParams struct {
	ProjectID int64
	Email     *string
}

type GetPlayerPendingDeleteByEmailRow

type GetPlayerPendingDeleteByEmailRow struct {
	ID                     int64
	ProjectID              int64
	PasswordHash           []byte
	DeleteRequestedAt      pgtype.Timestamptz
	DeleteRequestedByAdmin bool
}

type GetPlayerSessionRow

type GetPlayerSessionRow struct {
	ID         int64
	PlayerID   int64
	ExpiresAt  pgtype.Timestamptz
	RevokedAt  pgtype.Timestamptz
	Email      *string
	ProjectID  int64
	TenantID   int64
	DisabledAt pgtype.Timestamptz
}

type GetPlayerVerificationStateByIDRow

type GetPlayerVerificationStateByIDRow struct {
	EmailVerifiedAt                   pgtype.Timestamptz
	EmailVerificationCodeHash         []byte
	EmailVerificationSalt             []byte
	EmailVerificationExpiresAt        pgtype.Timestamptz
	EmailVerificationAttempts         int32
	EmailVerificationLifetimeAttempts int32
	EmailVerificationLockedUntil      pgtype.Timestamptz
	EmailVerificationLastSentAt       pgtype.Timestamptz
}

type GetPlayerVerificationStateParams

type GetPlayerVerificationStateParams struct {
	ProjectID int64
	Email     *string
}

type GetPlayerVerificationStateRow

type GetPlayerVerificationStateRow struct {
	ID                                int64
	EmailVerifiedAt                   pgtype.Timestamptz
	EmailVerificationCodeHash         []byte
	EmailVerificationSalt             []byte
	EmailVerificationExpiresAt        pgtype.Timestamptz
	EmailVerificationAttempts         int32
	EmailVerificationLifetimeAttempts int32
	EmailVerificationLockedUntil      pgtype.Timestamptz
	EmailVerificationLastSentAt       pgtype.Timestamptz
}

type GetPresenceRow

type GetPresenceRow struct {
	Status    string
	SessionID *string
	UpdatedAt pgtype.Timestamptz
}

type GetProfileEmailStateRow

type GetProfileEmailStateRow struct {
	Email                       *string
	EmailVerifiedAt             pgtype.Timestamptz
	EmailVerificationLastSentAt pgtype.Timestamptz
}

type GetProfileRow

type GetProfileRow struct {
	ID              int64
	ProjectID       int64
	ExternalID      string
	Email           *string
	Xuid            *string
	EmailVerifiedAt pgtype.Timestamptz
	CreatedAt       pgtype.Timestamptz
	FriendCode      *string
	DisplayName     *string
}

type GetProjectSteamAuthConfigForControlPanelParams

type GetProjectSteamAuthConfigForControlPanelParams struct {
	ProjectID int64
	TenantID  int64
}

type GetProjectSteamAuthConfigForControlPanelRow

type GetProjectSteamAuthConfigForControlPanelRow struct {
	SteamAppID         string
	SteamKeyConfigured *bool
}

type GetProjectSteamAuthConfigRow

type GetProjectSteamAuthConfigRow struct {
	SteamAppID     string
	SteamWebAPIKey []byte
}

type GetProjectTenantRow

type GetProjectTenantRow struct {
	ID       int64
	TenantID int64
	Name     string
}

type GetPublicPlayerByFriendCodeParams

type GetPublicPlayerByFriendCodeParams struct {
	FriendCode *string
	ProjectID  int64
	CallerID   int64
}

type GetPublicPlayerByFriendCodeRow

type GetPublicPlayerByFriendCodeRow struct {
	ID          int64
	DisplayName *string
	CreatedAt   pgtype.Timestamptz
}

type GetPublicPlayerParams

type GetPublicPlayerParams struct {
	ID        int64
	ProjectID int64
}

type GetPublicPlayerRow

type GetPublicPlayerRow struct {
	ID          int64
	DisplayName *string
	CreatedAt   pgtype.Timestamptz
}

type GetQueuedTicketForPlayerParams

type GetQueuedTicketForPlayerParams struct {
	ProjectID int64
	PlayerID  int64
}

type GetRemoteConfigForControlPanelParams

type GetRemoteConfigForControlPanelParams struct {
	ProjectID int64
	TenantID  int64
}

type GetSessionByRefreshHashParams

type GetSessionByRefreshHashParams struct {
	ProjectID   int64
	RefreshHash []byte
}

type GetSessionByRefreshHashRow

type GetSessionByRefreshHashRow struct {
	ID            int64
	PlayerID      int64
	ProjectID     int64
	ExpiresAt     pgtype.Timestamptz
	RevokedAt     pgtype.Timestamptz
	RevokedReason *string
}

type GetSettingsRevisionParams

type GetSettingsRevisionParams struct {
	ProjectID    int64
	ResourceKind string
	ResourceID   int64
	Revision     int64
}

type GetStorageObjectParams

type GetStorageObjectParams struct {
	ProjectID   int64
	OwnerUserID int64
	Key         string
}

type GetStorageObjectRow

type GetStorageObjectRow struct {
	ID        int64
	Value     []byte
	Version   int64
	UpdatedAt pgtype.Timestamptz
}

type GetTenantChangeRequestByIDRow

type GetTenantChangeRequestByIDRow struct {
	ID             int64
	TenantID       int64
	Kind           string
	RequestedTier  *int16
	Feature        *string
	RequestedLimit *int64
	Note           string
	Status         string
}

type GetTenantDisabledStateRow

type GetTenantDisabledStateRow struct {
	DisabledAt pgtype.Timestamptz
	DisabledBy *string
}

type GetTenantFactsRow

type GetTenantFactsRow struct {
	Name                 string
	Tier                 int16
	EnforceQuotas        bool
	PublicJoiningEnabled bool
	DisabledAt           pgtype.Timestamptz
	DisabledBy           *string
}

type GetTenantQuotaContextLockedRow

type GetTenantQuotaContextLockedRow struct {
	Tier          int16
	EnforceQuotas bool
	PlayerCount   int64
	Overrides     []byte
}

type GetTenantQuotaContextRow

type GetTenantQuotaContextRow struct {
	Tier          int16
	EnforceQuotas bool
	PlayerCount   int64
	Overrides     []byte
}

type GetTenantSignupRequestByCodeHashRow

type GetTenantSignupRequestByCodeHashRow struct {
	ID                  int64
	Email               string
	RequestedTenantName string
	FinalTenantName     *string
	ProjectDescription  string
	StudioName          *string
	Status              string
	CodeHash            []byte
	CodeExpiresAt       pgtype.Timestamptz
	ReviewedByUserID    *int64
	ReviewedAt          pgtype.Timestamptz
	ReviewReason        *string
	TenantID            *int64
	AcceptedAt          pgtype.Timestamptz
	CreatedAt           pgtype.Timestamptz
}

type GetTenantSignupRequestByIDRow

type GetTenantSignupRequestByIDRow struct {
	ID                  int64
	Email               string
	RequestedTenantName string
	FinalTenantName     *string
	ProjectDescription  string
	StudioName          *string
	Status              string
	CodeHash            []byte
	CodeExpiresAt       pgtype.Timestamptz
	ReviewedByUserID    *int64
	ReviewedAt          pgtype.Timestamptz
	ReviewReason        *string
	TenantID            *int64
	AcceptedAt          pgtype.Timestamptz
	CreatedAt           pgtype.Timestamptz
}

type IncrementRelaySessionsParams

type IncrementRelaySessionsParams struct {
	Month     pgtype.Date
	Allowance int64
}

type InsertAllocationEventParams

type InsertAllocationEventParams struct {
	AllocationID int64
	Status       AllocationStatus
	Address      string
	ErrMessage   string
}

type InsertControlPanelTOTPBackupCodesParams

type InsertControlPanelTOTPBackupCodesParams struct {
	ControlPanelUserID int64
	CodeHash           []byte
}

type InsertControlPanelUserConnectionParams

type InsertControlPanelUserConnectionParams struct {
	ControlPanelUserID int64
	Provider           string
	Subject            string
}

type InsertGameSessionSignalParams

type InsertGameSessionSignalParams struct {
	SessionID     string
	FromPlayerID  int64
	ToPlayerID    int64
	NegotiationID string
	Kind          string
	Payload       string
}

type InsertMatchmakerMatchParams

type InsertMatchmakerMatchParams struct {
	ID           string
	ProjectID    int64
	Mode         string
	FleetID      *int64
	Address      string
	Protocol     string
	SessionID    string
	JoinCode     string
	AllocationID *int64
	ClaimedAt    pgtype.Timestamptz
	Roster       []byte
	ExpiresAt    pgtype.Timestamptz
	HostPlayerID *int64
}

type InsertMatchmakingTicketParams

type InsertMatchmakingTicketParams struct {
	ProjectID         int64
	FleetID           *int64
	PlayerID          int64
	Region            string
	GameMode          string
	Attributes        []byte
	Mode              string
	MinCount          int32
	MaxCount          int32
	CountMultiple     int32
	AllowCrossRegion  bool
	Query             string
	StringProperties  []byte
	NumericProperties []byte
	ExpiresAt         pgtype.Timestamptz
}

type InsertMatchmakingTicketRow

type InsertMatchmakingTicketRow struct {
	ID        int64
	EntryID   int64
	Status    string
	CreatedAt pgtype.Timestamptz
}

type InsertPlayerAccountConnectionParams

type InsertPlayerAccountConnectionParams struct {
	PlayerAccountID pgtype.UUID
	Provider        string
	Subject         string
}

type InsertPlayerAccountTOTPBackupCodesParams

type InsertPlayerAccountTOTPBackupCodesParams struct {
	PlayerAccountID pgtype.UUID
	CodeHash        []byte
}

type InsertServerSecretParams

type InsertServerSecretParams struct {
	Name  string
	Value []byte
}

type InsertSettingsRevisionParams

type InsertSettingsRevisionParams struct {
	ProjectID    int64
	ResourceKind string
	ResourceID   int64
	Revision     int64
	Snapshot     []byte
	ActorUserID  *int64
	McpTokenID   *int64
	Source       string
}

type IsAccountBannedInTenantParams

type IsAccountBannedInTenantParams struct {
	TenantID        int64
	PlayerAccountID pgtype.UUID
}

type IsBlockedBetweenAccountsParams

type IsBlockedBetweenAccountsParams struct {
	A pgtype.UUID
	B pgtype.UUID
}

type IsGameSessionMemberParams

type IsGameSessionMemberParams struct {
	SessionID string
	PlayerID  int64
}

type LatestSettingsRevisionParams

type LatestSettingsRevisionParams struct {
	ProjectID    int64
	ResourceKind string
	ResourceID   int64
}

type Leaderboard

type Leaderboard struct {
	ID                int64
	TenantID          int64
	ProjectID         int64
	Name              string
	SortOrder         string
	CreatedAt         pgtype.Timestamptz
	DeletedAt         pgtype.Timestamptz
	ScoreOperator     string
	Metadata          []byte
	ClientSubmissions bool
	ScoreMin          *int64
	ScoreMax          *int64
	ResetSchedule     string
	AttemptCap        *int32
	CurrentPeriod     int32
	PeriodStartedAt   pgtype.Timestamptz
	NextResetAt       pgtype.Timestamptz
}

type LeaderboardEntriesForPlayersParams

type LeaderboardEntriesForPlayersParams struct {
	LeaderboardID int64
	Period        int32
	ProjectID     int64
	PlayerIds     []int64
	RowLimit      int32
}

type LeaderboardEntriesForPlayersRow

type LeaderboardEntriesForPlayersRow struct {
	PlayerID    int64
	Score       int64
	Metadata    []byte
	DisplayName *string
}

type LeaderboardEntry

type LeaderboardEntry struct {
	ID            int64
	TenantID      int64
	LeaderboardID int64
	PlayerID      int64
	Score         int64
	RecordedAt    pgtype.Timestamptz
	Period        int32
	Attempts      int32
	Metadata      []byte
	UpdatedAt     pgtype.Timestamptz
}

type LeaderboardPeriod

type LeaderboardPeriod struct {
	ID            int64
	TenantID      int64
	LeaderboardID int64
	Period        int32
	StartedAt     pgtype.Timestamptz
	EndedAt       pgtype.Timestamptz
}

type LeaderboardRangeByRankParams

type LeaderboardRangeByRankParams struct {
	RankLow       int64
	RankHigh      int64
	LeaderboardID int64
	Period        int32
	ProjectID     int64
}

type LeaderboardRangeByRankRow

type LeaderboardRangeByRankRow struct {
	PlayerID    int64
	Score       int64
	Metadata    []byte
	DisplayName *string
	Rank        int64
}

type LeaderboardUserRankParams

type LeaderboardUserRankParams struct {
	PlayerID      int64
	LeaderboardID int64
	Period        int32
	ProjectID     int64
}

type LinkPlayerEmailCredentialsParams

type LinkPlayerEmailCredentialsParams struct {
	Email                      *string
	PasswordHash               []byte
	EmailVerificationCodeHash  []byte
	EmailVerificationSalt      []byte
	EmailVerificationExpiresAt pgtype.Timestamptz
	ID                         int64
}

type LinkPlayerToAccountParams

type LinkPlayerToAccountParams struct {
	PlayerAccountID pgtype.UUID
	ID              int64
}

type ListAPIKeysRow

type ListAPIKeysRow struct {
	ID          int64
	ProjectID   *int64
	ProjectName *string
	Label       *string
	KeyType     string
	Scopes      []string
	CreatedAt   pgtype.Timestamptz
	RevokedAt   pgtype.Timestamptz
}

type ListAccountIdentitiesRow

type ListAccountIdentitiesRow struct {
	ID          pgtype.UUID
	Email       string
	DisplayName *string
}

type ListActiveAllocationsParams

type ListActiveAllocationsParams struct {
	ProjectID int64
	Limit     int32
}

type ListActiveAllocationsRow

type ListActiveAllocationsRow struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	FleetID     *int64
	Backend     string
	BackendRef  string
	Region      string
	Address     string
	Status      string
	Metadata    []byte
	RequestedAt pgtype.Timestamptz
	ReadyAt     pgtype.Timestamptz
	ReleasedAt  pgtype.Timestamptz
}

type ListAllRateLimitOverridesForTenantRow

type ListAllRateLimitOverridesForTenantRow struct {
	ID        int64
	ProjectID *int64
	Kind      string
	Rate      float64
	Burst     float64
	UpdatedBy *int64
	UpdatedAt pgtype.Timestamptz
}

type ListAllocationBackendsForTenantRow

type ListAllocationBackendsForTenantRow struct {
	Backend         string
	AllocationCount int64
}

type ListAllocationEventsParams

type ListAllocationEventsParams struct {
	AllocationID int64
	Lim          int32
}

type ListAllocationEventsRow

type ListAllocationEventsRow struct {
	ID           int64
	AllocationID int64
	Status       string
	Address      string
	ErrMessage   string
	CreatedAt    pgtype.Timestamptz
}

type ListAllocationsForProjectParams

type ListAllocationsForProjectParams struct {
	ProjectID       int64
	IncludeTerminal bool
	Off             int32
	Lim             int32
}

type ListAllocationsForProjectRow

type ListAllocationsForProjectRow struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	FleetID     *int64
	Backend     string
	BackendRef  string
	Region      string
	Address     string
	Status      string
	Metadata    []byte
	RequestedAt pgtype.Timestamptz
	ReadyAt     pgtype.Timestamptz
	ReleasedAt  pgtype.Timestamptz
}

type ListControlPanelInvitationsForTenantRow

type ListControlPanelInvitationsForTenantRow struct {
	ID              int64
	Email           string
	Role            string
	ExpiresAt       pgtype.Timestamptz
	InvitedByUserID int64
	CreatedAt       pgtype.Timestamptz
}

type ListControlPanelMembersForTenantRow

type ListControlPanelMembersForTenantRow struct {
	MembershipID    int64
	UserID          int64
	Email           string
	Role            string
	IsPlatformAdmin bool
	LastLoginAt     pgtype.Timestamptz
	CreatedAt       pgtype.Timestamptz
}

type ListControlPanelTenantsForPlatformAdminRow

type ListControlPanelTenantsForPlatformAdminRow struct {
	ID        int64
	Name      string
	Role      string
	CreatedAt pgtype.Timestamptz
}

type ListControlPanelTenantsForUserRow

type ListControlPanelTenantsForUserRow struct {
	ID        int64
	Name      string
	Role      string
	CreatedAt pgtype.Timestamptz
}

type ListControlPanelUserConnectionsRow

type ListControlPanelUserConnectionsRow struct {
	Provider  string
	CreatedAt pgtype.Timestamptz
}

type ListControlPanelUsersForPlatformAdminParams

type ListControlPanelUsersForPlatformAdminParams struct {
	EmailFilter *string
	Off         int32
	Lim         int32
}

type ListControlPanelUsersForPlatformAdminRow

type ListControlPanelUsersForPlatformAdminRow struct {
	ID              int64
	Email           string
	IsPlatformAdmin bool
	DisabledAt      pgtype.Timestamptz
	LastLoginAt     pgtype.Timestamptz
	CreatedAt       pgtype.Timestamptz
	TenantCount     int64
}

type ListDeletedLeaderboardsForProjectRow

type ListDeletedLeaderboardsForProjectRow struct {
	ID        int64
	Name      string
	DeletedAt pgtype.Timestamptz
}

type ListDueLeaderboardResetsRow

type ListDueLeaderboardResetsRow struct {
	ID              int64
	CurrentPeriod   int32
	PeriodStartedAt pgtype.Timestamptz
	NextResetAt     pgtype.Timestamptz
	ResetSchedule   string
	CreatedAt       pgtype.Timestamptz
}

type ListEnforcedTenantStorageRow

type ListEnforcedTenantStorageRow struct {
	TenantID              int64
	Name                  string
	Tier                  int16
	TotalBytes            int64
	LastNotifiedThreshold int16
	Overrides             []byte
}

type ListExpiredUnclaimedMatchmakerAllocationsRow

type ListExpiredUnclaimedMatchmakerAllocationsRow struct {
	ID           string
	TenantID     int64
	AllocationID int64
}

type ListFriendsByStatusForAccountParams

type ListFriendsByStatusForAccountParams struct {
	Status   string
	Me       pgtype.UUID
	Cursor   int64
	RowLimit int32
}

type ListGameSessionPeersRow

type ListGameSessionPeersRow struct {
	PlayerID    int64
	Ip          *string
	Port        *int32
	Qos         []byte
	LastSeen    pgtype.Timestamptz
	Xuid        *string
	DisplayName *string
}

type ListGameSessionSignalsForRecipientParams

type ListGameSessionSignalsForRecipientParams struct {
	SessionID  string
	ToPlayerID int64
	AfterID    int64
}

type ListGameSessionSignalsForRecipientRow

type ListGameSessionSignalsForRecipientRow struct {
	ID            int64
	FromPlayerID  int64
	ToPlayerID    int64
	NegotiationID string
	Kind          string
	Payload       string
	CreatedAt     pgtype.Timestamptz
}

type ListLeaderboardPeriodsParams

type ListLeaderboardPeriodsParams struct {
	LeaderboardID int64
	ProjectID     int64
	BeforePeriod  int32
	RowLimit      int32
}

type ListLeaderboardPeriodsRow

type ListLeaderboardPeriodsRow struct {
	Period    int32
	StartedAt pgtype.Timestamptz
	EndedAt   pgtype.Timestamptz
}

type ListLeaderboardsForProjectRow

type ListLeaderboardsForProjectRow struct {
	ID                int64
	Name              string
	SortOrder         string
	ScoreOperator     string
	Metadata          []byte
	ClientSubmissions bool
	ScoreMin          *int64
	ScoreMax          *int64
	ResetSchedule     string
	AttemptCap        *int32
	CurrentPeriod     int32
	PeriodStartedAt   pgtype.Timestamptz
	NextResetAt       pgtype.Timestamptz
	CreatedAt         pgtype.Timestamptz
}

type ListMCPTokensForProjectRow

type ListMCPTokensForProjectRow struct {
	ID              int64
	Label           string
	TokenHint       string
	Scopes          []string
	CreatedByUserID int64
	CreatorEmail    string
	ExpiresAt       pgtype.Timestamptz
	LastUsedAt      pgtype.Timestamptz
	CreatedAt       pgtype.Timestamptz
}

type ListMatchmakerBucketsForProjectRow

type ListMatchmakerBucketsForProjectRow struct {
	Mode         string
	Region       string
	GameMode     string
	Status       string
	TicketCount  int64
	Oldest       pgtype.Timestamptz
	MinCountLow  int32
	MaxCountHigh int32
}

type ListPendingGameInvitesRow

type ListPendingGameInvitesRow struct {
	ID           int64
	FromPlayerID int64
	SessionID    string
	JoinCode     string
	ExpiresAt    pgtype.Timestamptz
	FromEmail    string
	FromXuid     *string
}

type ListPendingTenantChangeRequestsRow

type ListPendingTenantChangeRequestsRow struct {
	ID             int64
	TenantID       int64
	TenantName     string
	CurrentTier    int16
	Kind           string
	RequestedTier  *int16
	Feature        *string
	RequestedLimit *int64
	Note           string
	CreatedAt      pgtype.Timestamptz
	RequesterEmail string
}

type ListPendingTenantSignupRequestsRow

type ListPendingTenantSignupRequestsRow struct {
	ID                  int64
	Email               string
	RequestedTenantName string
	ProjectDescription  string
	StudioName          *string
	CreatedAt           pgtype.Timestamptz
}

type ListPlatformAdminInvitationsRow

type ListPlatformAdminInvitationsRow struct {
	ID              int64
	Email           string
	Role            string
	ExpiresAt       pgtype.Timestamptz
	InvitedByUserID int64
	CreatedAt       pgtype.Timestamptz
}

type ListPlatformAdminsRow

type ListPlatformAdminsRow struct {
	UserID      int64
	Email       string
	LastLoginAt pgtype.Timestamptz
	CreatedAt   pgtype.Timestamptz
}

type ListPlayerAccountConnectionsRow

type ListPlayerAccountConnectionsRow struct {
	Provider  string
	CreatedAt pgtype.Timestamptz
}

type ListPlayerInvitationsForProjectRow

type ListPlayerInvitationsForProjectRow struct {
	ID              int64
	Email           string
	ExpiresAt       pgtype.Timestamptz
	InvitedByUserID int64
	CreatedAt       pgtype.Timestamptz
}

type ListPlayerSessionEpochsRow

type ListPlayerSessionEpochsRow struct {
	ID           int64
	SessionEpoch int32
}

type ListPlayersDueForPurgeParams

type ListPlayersDueForPurgeParams struct {
	Cutoff pgtype.Timestamptz
	Batch  int32
}

type ListPlayersDueForPurgeRow

type ListPlayersDueForPurgeRow struct {
	ID                int64
	ProjectID         int64
	ExternalID        string
	DeleteRequestedAt pgtype.Timestamptz
	DeletedAt         pgtype.Timestamptz
}

type ListPlayersForProjectParams

type ListPlayersForProjectParams struct {
	TenantID    int64
	ProjectID   int64
	EmailFilter *string
	Off         int32
	Lim         int32
}

type ListPlayersForProjectRow

type ListPlayersForProjectRow struct {
	ID                int64
	ExternalID        string
	Email             string
	EmailVerifiedAt   pgtype.Timestamptz
	DisabledAt        pgtype.Timestamptz
	DeleteRequestedAt pgtype.Timestamptz
	CreatedAt         pgtype.Timestamptz
}

type ListPresenceForUsersRow

type ListPresenceForUsersRow struct {
	PlayerID  int64
	Status    string
	SessionID *string
}

type ListProjectsForTenantRow

type ListProjectsForTenantRow struct {
	ID                   int64
	Name                 string
	CreatedAt            pgtype.Timestamptz
	PublicJoiningEnabled bool
}

type ListPublicOpenGameSessionsParams

type ListPublicOpenGameSessionsParams struct {
	ProjectID int64
	CursorID  string
	TitleID   string
	RowLimit  int32
}

type ListPublicOpenGameSessionsRow

type ListPublicOpenGameSessionsRow struct {
	ID              string
	TitleID         string
	Props           []byte
	MaxPlayers      int32
	HostPlayerID    int64
	CreatedAt       pgtype.Timestamptz
	HostDisplayName *string
	PlayerCount     int64
}

type ListPublicPlayersParams

type ListPublicPlayersParams struct {
	Ids       []int64
	ProjectID int64
}

type ListPublicPlayersRow

type ListPublicPlayersRow struct {
	ID          int64
	DisplayName *string
	CreatedAt   pgtype.Timestamptz
}

type ListQuotaOverridesForTenantRow

type ListQuotaOverridesForTenantRow struct {
	Axis      string
	Limit     int64
	UpdatedAt pgtype.Timestamptz
}

type ListReadyMatchmakerBucketsRow

type ListReadyMatchmakerBucketsRow struct {
	TenantID    int64
	ProjectID   int64
	Mode        string
	FleetID     *int64
	Region      string
	GameMode    string
	TicketCount int64
}

type ListRelayNodesRow

type ListRelayNodesRow struct {
	RelayNode RelayNode
	Eligible  bool
}

type ListSettingsRevisionsParams

type ListSettingsRevisionsParams struct {
	ProjectID    int64
	ResourceKind string
	ResourceID   int64
}

type ListSettingsRevisionsRow

type ListSettingsRevisionsRow struct {
	Revision    int64
	Snapshot    []byte
	ActorUserID *int64
	McpTokenID  *int64
	Source      string
	CreatedAt   pgtype.Timestamptz
}

type ListStorageObjectsParams

type ListStorageObjectsParams struct {
	ProjectID   int64
	OwnerUserID int64
	KeyPrefix   string
	CursorID    int64
	RowLimit    int32
}

type ListStorageObjectsRow

type ListStorageObjectsRow struct {
	ID        int64
	Key       string
	SizeBytes int64
	Version   int64
	UpdatedAt pgtype.Timestamptz
}

type ListTenantChangeRequestsRow

type ListTenantChangeRequestsRow struct {
	ID             int64
	Kind           string
	RequestedTier  *int16
	Feature        *string
	RequestedLimit *int64
	Note           string
	Status         string
	ReviewReason   *string
	CreatedAt      pgtype.Timestamptz
	ReviewedAt     pgtype.Timestamptz
}

type ListTenantCustomTokenSecretsRow

type ListTenantCustomTokenSecretsRow struct {
	ID                int64
	CustomTokenSecret []byte
}

type ListTenantPlayerBansRow

type ListTenantPlayerBansRow struct {
	PlayerAccountID pgtype.UUID
	Email           string
	Reason          *string
	CreatedAt       pgtype.Timestamptz
}

type LockControlPanelUserVerificationParams

type LockControlPanelUserVerificationParams struct {
	LockedUntil pgtype.Timestamptz
	ID          int64
}

type LockPlayerAccountVerificationParams

type LockPlayerAccountVerificationParams struct {
	LockedUntil pgtype.Timestamptz
	ID          pgtype.UUID
}

type LockPlayerPasswordResetParams

type LockPlayerPasswordResetParams struct {
	LockedUntil pgtype.Timestamptz
	ID          int64
}

type LockPlayerVerificationParams

type LockPlayerVerificationParams struct {
	LockedUntil pgtype.Timestamptz
	ID          int64
}

type LockStorageObjectForWriteParams

type LockStorageObjectForWriteParams struct {
	ProjectID   int64
	OwnerUserID int64
	Key         string
}

type MarkAllocationReadyParams

type MarkAllocationReadyParams struct {
	ID         int64
	BackendRef string
	Address    string
}

type MarkTenantSignupAcceptedParams

type MarkTenantSignupAcceptedParams struct {
	TenantID *int64
	ID       int64
}

type MatchmakerMatch

type MatchmakerMatch struct {
	ID           string
	TenantID     int64
	ProjectID    int64
	Mode         string
	FleetID      *int64
	Address      string
	Protocol     string
	SessionID    string
	JoinCode     string
	Roster       []byte
	CreatedAt    pgtype.Timestamptz
	ExpiresAt    pgtype.Timestamptz
	AllocationID *int64
	ClaimedAt    pgtype.Timestamptz
	HostPlayerID *int64
}

type MatchmakerQueueStatsRow

type MatchmakerQueueStatsRow struct {
	Mode             string
	Region           string
	Depth            int64
	OldestAgeSeconds float64
}

type MatchmakingEntry

type MatchmakingEntry struct {
	ID              int64
	TenantID        int64
	ProjectID       int64
	PartyID         *int64
	Status          TicketStatus
	IdempotencyKey  *string
	PreviousMatchID string
	CreatedAt       pgtype.Timestamptz
}

type MatchmakingResolution

type MatchmakingResolution struct {
	ID            string
	TenantID      int64
	ProjectID     int64
	ExpiresAt     pgtype.Timestamptz
	NextAttemptAt pgtype.Timestamptz
}

type MatchmakingTicket

type MatchmakingTicket struct {
	ID                 int64
	TenantID           int64
	ProjectID          int64
	PlayerID           int64
	Region             string
	GameMode           string
	Attributes         []byte
	Status             TicketStatus
	MatchAddress       string
	CreatedAt          pgtype.Timestamptz
	MatchedAt          pgtype.Timestamptz
	FleetID            *int64
	ClaimID            pgtype.UUID
	ClaimedAt          pgtype.Timestamptz
	ClaimExpiresAt     pgtype.Timestamptz
	AllocationAttempts int32
	MatchProtocol      string
	Mode               string
	MatchID            string
	MinCount           int32
	MaxCount           int32
	CountMultiple      int32
	AllowCrossRegion   bool
	Query              string
	StringProperties   []byte
	NumericProperties  []byte
	ExpiresAt          pgtype.Timestamptz
	FailureReason      *string
	EntryID            int64
	PartyID            *int64
}

type McpToken

type McpToken struct {
	ID              int64
	TenantID        int64
	ProjectID       int64
	CreatedByUserID int64
	Label           string
	TokenHash       []byte
	TokenHint       string
	Scopes          []string
	ExpiresAt       pgtype.Timestamptz
	LastUsedAt      pgtype.Timestamptz
	CreatedAt       pgtype.Timestamptz
	RevokedAt       pgtype.Timestamptz
}

type NullAllocationStatus

type NullAllocationStatus struct {
	AllocationStatus AllocationStatus
	Valid            bool // Valid is true if AllocationStatus is not NULL
}

func (*NullAllocationStatus) Scan

func (ns *NullAllocationStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullAllocationStatus) Value

func (ns NullAllocationStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullRiverJobState

type NullRiverJobState struct {
	RiverJobState RiverJobState
	Valid         bool // Valid is true if RiverJobState is not NULL
}

func (*NullRiverJobState) Scan

func (ns *NullRiverJobState) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRiverJobState) Value

func (ns NullRiverJobState) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTicketStatus

type NullTicketStatus struct {
	TicketStatus TicketStatus
	Valid        bool // Valid is true if TicketStatus is not NULL
}

func (*NullTicketStatus) Scan

func (ns *NullTicketStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTicketStatus) Value

func (ns NullTicketStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Party

type Party struct {
	ID                  int64
	TenantID            int64
	ProjectID           int64
	LeaderID            *int64
	State               string
	Version             int64
	RosterVersion       int64
	Settings            []byte
	MaxMembers          int32
	CurrentQueueEntryID *int64
	LastMatchID         string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	ClosedAt            pgtype.Timestamptz
}

type PartyCodeAttempt

type PartyCodeAttempt struct {
	TenantID     int64
	ProjectID    int64
	Subject      string
	Failures     int32
	WindowStart  pgtype.Timestamptz
	BlockedUntil pgtype.Timestamptz
}

type PartyCodeIpAttempt

type PartyCodeIpAttempt struct {
	Ip           string
	Failures     int32
	WindowStart  pgtype.Timestamptz
	BlockedUntil pgtype.Timestamptz
}

type PartyInvite

type PartyInvite struct {
	ID        int64
	TenantID  int64
	ProjectID int64
	PartyID   int64
	TargetID  int64
	ExpiresAt pgtype.Timestamptz
	Status    string
}

type PartyInviteCode

type PartyInviteCode struct {
	ID        int64
	TenantID  int64
	ProjectID int64
	PartyID   int64
	CodeHash  []byte
	MaxUses   int32
	Uses      int32
	ExpiresAt pgtype.Timestamptz
	RevokedAt pgtype.Timestamptz
}

type PartyMember

type PartyMember struct {
	TenantID           int64
	ProjectID          int64
	PartyID            int64
	PlayerID           int64
	ReadyVersion       int64
	StringProperties   []byte
	NumericProperties  []byte
	Attributes         []byte
	JoinedAt           pgtype.Timestamptz
	LastSeenAt         pgtype.Timestamptz
	DisconnectDeadline pgtype.Timestamptz
}

type PlatformAuditLog

type PlatformAuditLog struct {
	ID           int64
	ActorUserID  *int64
	Action       string
	Target       *string
	Payload      []byte
	OccurredAt   pgtype.Timestamptz
	ActorService *string
}

type PlatformSignupConfig

type PlatformSignupConfig struct {
	ID                        int16
	PublicTenantSignupEnabled bool
	UpdatedBy                 *int64
	UpdatedAt                 pgtype.Timestamptz
}

type PlayerAccount

type PlayerAccount struct {
	ID                                pgtype.UUID
	Email                             string
	PasswordHash                      []byte
	DisplayName                       *string
	EmailVerifiedAt                   pgtype.Timestamptz
	DisabledAt                        pgtype.Timestamptz
	SessionEpoch                      int32
	EmailVerificationCodeHash         []byte
	EmailVerificationSalt             []byte
	EmailVerificationExpiresAt        pgtype.Timestamptz
	EmailVerificationAttempts         int32
	EmailVerificationLifetimeAttempts int32
	EmailVerificationLockedUntil      pgtype.Timestamptz
	EmailVerificationLastSentAt       pgtype.Timestamptz
	CreatedAt                         pgtype.Timestamptz
	UpdatedAt                         pgtype.Timestamptz
	RemoteAddrIpLan                   *string
	RemoteAddrIpPublic                *string
	RemoteAddrDns                     *string
	RemoteAddrIroh                    *string
}

type PlayerAccountConnection

type PlayerAccountConnection struct {
	ID              int64
	PlayerAccountID pgtype.UUID
	Provider        string
	Subject         string
	CreatedAt       pgtype.Timestamptz
	LastUsedAt      pgtype.Timestamptz
}

type PlayerAccountPasswordReset

type PlayerAccountPasswordReset struct {
	ID              int64
	PlayerAccountID pgtype.UUID
	TokenHash       []byte
	ExpiresAt       pgtype.Timestamptz
	UsedAt          pgtype.Timestamptz
	CreatedAt       pgtype.Timestamptz
}

type PlayerAccountSession

type PlayerAccountSession struct {
	ID              int64
	PlayerAccountID pgtype.UUID
	RefreshHash     []byte
	SessionEpoch    int32
	ExpiresAt       pgtype.Timestamptz
	RevokedAt       pgtype.Timestamptz
	CreatedAt       pgtype.Timestamptz
}

type PlayerAccountTotp

type PlayerAccountTotp struct {
	PlayerAccountID pgtype.UUID
	SecretEnc       []byte
	ConfirmedAt     pgtype.Timestamptz
	LastUsedStep    int64
	Attempts        int32
	LockedUntil     pgtype.Timestamptz
	CreatedAt       pgtype.Timestamptz
}

type PlayerAccountTotpBackupCode

type PlayerAccountTotpBackupCode struct {
	ID              int64
	PlayerAccountID pgtype.UUID
	CodeHash        []byte
	UsedAt          pgtype.Timestamptz
	CreatedAt       pgtype.Timestamptz
}

type PlayerAccountTrustedDevice

type PlayerAccountTrustedDevice struct {
	ID              int64
	PlayerAccountID pgtype.UUID
	TokenHash       []byte
	ExpiresAt       pgtype.Timestamptz
	CreatedAt       pgtype.Timestamptz
}

type PlayerInvitation

type PlayerInvitation struct {
	ID              int64
	TenantID        int64
	ProjectID       int64
	Email           string
	CodeHash        []byte
	ExpiresAt       pgtype.Timestamptz
	AcceptedAt      pgtype.Timestamptz
	RevokedAt       pgtype.Timestamptz
	InvitedByUserID int64
	CreatedAt       pgtype.Timestamptz
	ProjectPlayerID *int64
}

type PlayerInviteLookupRow

type PlayerInviteLookupRow struct {
	ID              int64
	TenantID        int64
	ProjectID       int64
	Email           string
	ExpiresAt       pgtype.Timestamptz
	ProjectName     string
	ProjectPlayerID int64
}

type Presence

type Presence struct {
	TenantID  int64
	PlayerID  int64
	Status    string
	SessionID *string
	UpdatedAt pgtype.Timestamptz
}

type Project

type Project struct {
	ID                   int64
	TenantID             int64
	Name                 string
	CreatedAt            pgtype.Timestamptz
	DeletedAt            pgtype.Timestamptz
	PublicJoiningEnabled bool
	RemoteConfig         []byte
	SteamAppID           string
	SteamWebAPIKey       []byte
	AllowedOrigins       []string
}

type ProjectPlayer

type ProjectPlayer struct {
	ID                                int64
	TenantID                          int64
	ProjectID                         int64
	ExternalID                        string
	Email                             *string
	EmailVerifiedAt                   pgtype.Timestamptz
	PasswordHash                      []byte
	CreatedAt                         pgtype.Timestamptz
	DeletedAt                         pgtype.Timestamptz
	EmailVerificationCodeHash         []byte
	EmailVerificationExpiresAt        pgtype.Timestamptz
	EmailVerificationSalt             []byte
	EmailVerificationAttempts         int32
	EmailVerificationLastSentAt       pgtype.Timestamptz
	DisabledAt                        pgtype.Timestamptz
	EmailVerificationLifetimeAttempts int32
	EmailVerificationLockedUntil      pgtype.Timestamptz
	Xuid                              *string
	PlayerAccountID                   pgtype.UUID
	SessionEpoch                      int32
	UnlinkedAt                        pgtype.Timestamptz
	FriendCode                        *string
	PasswordResetCodeHash             []byte
	PasswordResetSalt                 []byte
	PasswordResetExpiresAt            pgtype.Timestamptz
	PasswordResetAttempts             int32
	PasswordResetLifetimeAttempts     int32
	PasswordResetLockedUntil          pgtype.Timestamptz
	PasswordResetLastSentAt           pgtype.Timestamptz
	DeleteRequestedAt                 pgtype.Timestamptz
	DeleteRequestedByAdmin            bool
}

type PruneSettingsRevisionsParams

type PruneSettingsRevisionsParams struct {
	ProjectID    int64
	ResourceKind string
	ResourceID   int64
	BelowOrAt    int64
}

type PutStorageObjectIfMatchParams

type PutStorageObjectIfMatchParams struct {
	ProjectID   int64
	OwnerUserID int64
	Key         string
	Version     int64
	Value       []byte
}

type PutStorageObjectIfMatchRow

type PutStorageObjectIfMatchRow struct {
	ID        int64
	Version   int64
	UpdatedAt pgtype.Timestamptz
}

type PutStorageObjectParams

type PutStorageObjectParams struct {
	ProjectID   int64
	OwnerUserID int64
	Key         string
	Value       []byte
}

type PutStorageObjectRow

type PutStorageObjectRow struct {
	ID        int64
	Version   int64
	UpdatedAt pgtype.Timestamptz
}

type Querier

type Querier interface {
	AdvanceLeaderboardPeriod(ctx context.Context, arg AdvanceLeaderboardPeriodParams) (int64, error)
	// Adjust the current tenant's storage counter by delta (bytes; negative on
	// delete/shrink), clamped at zero. Called in the write tx after a successful
	// object write so the counter stays in lockstep. Runs in tenant context.
	ApplyTenantStorageDelta(ctx context.Context, delta int64) error
	ApproveTenantChangeRequest(ctx context.Context, arg ApproveTenantChangeRequestParams) (int64, error)
	ApproveTenantSignupRequest(ctx context.Context, arg ApproveTenantSignupRequestParams) (int64, error)
	ArchiveLeaderboardPeriod(ctx context.Context, arg ArchiveLeaderboardPeriodParams) error
	// Edge id if an accepted friendship exists in either direction.
	AreAccountsFriendsAccepted(ctx context.Context, arg AreAccountsFriendsAcceptedParams) (int64, error)
	// Tenant-scoped: admin "link player" accept binds a proven email + global
	// account onto an existing (external-id) row, marking it verified. Guards, any
	// of which affecting 0 rows makes the caller treat the accept as a conflict:
	//   * the email unique index may reject if another player already owns the
	//     address;
	//   * the account guard prevents clobbering a row already linked to a
	//     different account;
	//   * the verified-email guard refuses to overwrite an address the player has
	//     already verified under a different email — so a link invite accepted
	//     after the player self-verifies a different address can't silently
	//     replace (and re-mark verified) their real email.
	BindPlayerLinkedEmail(ctx context.Context, arg BindPlayerLinkedEmailParams) (int64, error)
	// Bump every player of an account within a tenant (tenant-ban path), so all
	// their live JWTs are rejected at server-verify immediately.
	BumpAccountPlayerEpochsInTenant(ctx context.Context, arg BumpAccountPlayerEpochsInTenantParams) error
	// Atomic increment + conditional lockout. The previous read-then-write
	// pattern was TOCTOU-racy: N parallel failed logins all read the same value
	// and wrote N+1, so 10 simultaneous wrong passwords landed at login_failures=1
	// and the lockout never fired. UPDATE...RETURNING serialises under the row
	// lock pgx already takes.
	BumpControlPanelLoginFailure(ctx context.Context, arg BumpControlPanelLoginFailureParams) (BumpControlPanelLoginFailureRow, error)
	// Single player (project disable path).
	BumpPlayerSessionEpoch(ctx context.Context, id int64) error
	// Cancelling a claimed-but-not-yet-committed ticket is allowed: the worker's
	// CommitClaim will find zero rows and deallocate the orphan server.
	CancelMatchmakingTicket(ctx context.Context, arg CancelMatchmakingTicketParams) (int64, error)
	// Clears the pending request; lifts the disable only when the request created
	// it (disabled_at = delete_requested_at), so a pre-existing admin suspension
	// survives the cancel. An admin's request is not the player's to cancel.
	// 0 rows = no pending player request (or already purged).
	CancelPlayerDeleteByAccount(ctx context.Context, arg CancelPlayerDeleteByAccountParams) (int64, error)
	// Clears the pending request; lifts the disable only when the request created
	// it (disabled_at = delete_requested_at), so a pre-existing admin suspension
	// survives the cancel. SET expressions read pre-update values, so the CASE
	// sees delete_requested_at before it is cleared.
	CancelPlayerDeleteInProject(ctx context.Context, arg CancelPlayerDeleteInProjectParams) (int64, error)
	// Clears the pending request; lifts the disable only when the request created
	// it (disabled_at = delete_requested_at), so a suspension that predates the
	// request survives the cancel. An admin's request is not the player's to
	// cancel. 0 rows = no pending player request (or purged).
	CancelPlayerDeleteSelf(ctx context.Context, id int64) (int64, error)
	// Bound the player count without splitting entries. The oldest entry can
	// exceed a small budget so it is never starved. Their tickets
	// stay 'queued'; only claim_id/claimed_at/claim_expires_at are set, so a
	// subsequent ClaimBucket (different worker) skips them. The caller commits
	// via CommitMatchmakerTickets (success) or ReleaseMatchmakerTickets (failure);
	// a crashed caller's claim is released by the sweeper once
	// claim_expires_at < now(). fleet_id is NULL for non-fleet modes, hence
	// IS NOT DISTINCT FROM.
	ClaimMatchmakerBucket(ctx context.Context, arg ClaimMatchmakerBucketParams) ([]ClaimMatchmakerBucketRow, error)
	// Poll/realtime delivery claims only live matches. The expiry guard prevents a
	// late poll from reviving an allocation after the GC lease has elapsed.
	ClaimMatchmakerMatch(ctx context.Context, id string) (MatchmakerMatch, error)
	// Race-safe half of find-or-create for a proven email (the caller re-reads
	// after this, so a concurrent creator's row is picked up); ON CONFLICT never
	// aborts the surrounding transaction. An unverified row is claimed: whoever
	// created it never proved the email, so the proven owner's password replaces
	// theirs and the row's pending code and display name are cleared. A verified
	// row is left alone.
	ClaimVerifiedPlayerAccount(ctx context.Context, arg ClaimVerifiedPlayerAccountParams) error
	ClearControlPanelVerificationCode(ctx context.Context, id int64) error
	// Runs when a confirm attempt arrives after the lockout expired: the lockout
	// window is over, so the lifetime budget restarts with it.
	ClearPlayerPasswordResetLock(ctx context.Context, id int64) error
	ClearPlayerVerificationCode(ctx context.Context, id int64) error
	// The ClearPlayerPasswordResetLock twin for email verification.
	ClearPlayerVerificationLock(ctx context.Context, id int64) error
	ClearProjectSteamAuthConfig(ctx context.Context, projectID int64) (int64, error)
	// Flip the given still-queued tickets holding this claim_id to 'matched'
	// and stamp the match id, address + protocol. Rows that drifted (cancelled,
	// swept) won't match the WHERE and are excluded — the caller compares
	// rows-affected and deallocates the orphan server when 0.
	CommitMatchmakerTickets(ctx context.Context, arg CommitMatchmakerTicketsParams) (int64, error)
	// Sets the new password, clears the challenge, and bumps the session epoch so
	// every outstanding access token (possibly an attacker's) dies immediately.
	// A proven reset also restarts the lifetime budget and drops any lockout:
	// the caller just demonstrated control of the inbox. The code_hash condition
	// pins completion to the exact challenge the caller validated — 0 rows means
	// a concurrent re-request replaced it and the code no longer counts.
	CompletePlayerPasswordReset(ctx context.Context, arg CompletePlayerPasswordResetParams) (int64, error)
	// last_used_step records the enrollment code's timestep so the same code
	// cannot be replayed at the first login challenge.
	ConfirmControlPanelTOTP(ctx context.Context, arg ConfirmControlPanelTOTPParams) (int64, error)
	ConfirmPlayerAccountTOTP(ctx context.Context, arg ConfirmPlayerAccountTOTPParams) (int64, error)
	// Atomic single-use consume: 0 rows means unknown, expired, or already used.
	ConsumeControlPanelPasswordReset(ctx context.Context, tokenHash []byte) (int64, error)
	// Single-use enforced by the used_at IS NULL guard in the same statement
	// that marks it used. 0 rows = unknown or already-spent code.
	ConsumeControlPanelTOTPBackupCode(ctx context.Context, arg ConsumeControlPanelTOTPBackupCodeParams) (int64, error)
	// Atomic single-use consume: 0 rows means unknown, expired, or already used.
	ConsumePlayerAccountPasswordReset(ctx context.Context, tokenHash []byte) (pgtype.UUID, error)
	ConsumePlayerAccountTOTPBackupCode(ctx context.Context, arg ConsumePlayerAccountTOTPBackupCodeParams) (int64, error)
	ControlPanelCreateTenant(ctx context.Context, arg ControlPanelCreateTenantParams) (ControlPanelCreateTenantRow, error)
	ControlPanelCreateTenantBare(ctx context.Context, arg ControlPanelCreateTenantBareParams) (int64, error)
	CountActiveAPIKeysForProject(ctx context.Context, projectID *int64) (int64, error)
	// Counts peers seen within the activity window, excluding a given user so a
	// re-joining member doesn't count against the session's capacity.
	CountActiveGameSessionPeers(ctx context.Context, arg CountActiveGameSessionPeersParams) (int64, error)
	CountActiveMCPTokens(ctx context.Context, projectID int64) (int64, error)
	// Counts how many of the given players are ACTIVE members (last_seen within
	// 30 s, matching ListGameSessionPeers/CountActiveGameSessionPeers) of an
	// open, unexpired session in this project. The signal handlers pass both
	// endpoints for a send (expecting 2) or just the caller for a poll
	// (expecting 1), so the count defines "both peers are in the same live
	// session" without diverging from the roster the clients themselves see.
	CountActiveSignalMembers(ctx context.Context, arg CountActiveSignalMembersParams) (int64, error)
	CountAllocationsForProject(ctx context.Context, arg CountAllocationsForProjectParams) (int64, error)
	CountControlPanelTOTPBackupCodesRemaining(ctx context.Context, controlPanelUserID int64) (int64, error)
	CountControlPanelUserConnections(ctx context.Context, controlPanelUserID int64) (int64, error)
	CountControlPanelUsers(ctx context.Context) (int64, error)
	CountControlPanelUsersForPlatformAdmin(ctx context.Context, emailFilter *string) (int64, error)
	CountEnabledPlatformAdmins(ctx context.Context) (int64, error)
	// Control panel matchmaker page: matches formed per mode within the retention
	// window (rows are GC'd after MatchTTL, so this reads as "recent matches").
	CountMatchmakerMatchesByMode(ctx context.Context, projectID int64) ([]CountMatchmakerMatchesByModeRow, error)
	// Counts non-ended, non-expired sessions for the project. Used in the
	// create handler to enforce a per-project session cap.
	CountOpenGameSessionsForProject(ctx context.Context, projectID int64) (int64, error)
	// Whether an unexpired invite exists for (session, recipient) in the caller's
	// tenant. Gates joining/resolving a private session by a non-member.
	CountPendingGameInviteForSessionPlayer(ctx context.Context, arg CountPendingGameInviteForSessionPlayerParams) (int64, error)
	CountPlayerAccountConnections(ctx context.Context, playerAccountID pgtype.UUID) (int64, error)
	CountPlayerAccountTOTPBackupCodesRemaining(ctx context.Context, playerAccountID pgtype.UUID) (int64, error)
	// Unclaimed, unexpired fleet-allocation matches this player still holds. The
	// per-player cap counts these at enqueue time so a player can't loop
	// enqueue -> matched -> abandon to hoard dedicated servers until the 24h GC.
	// Fleet matches carry no host, so the player is found via the roster.
	CountPlayerLiveFleetAllocations(ctx context.Context, playerID int64) (int64, error)
	CountPlayersForProject(ctx context.Context, arg CountPlayersForProjectParams) (int64, error)
	// Live (non-soft-deleted) project count for the current tenant.
	CountProjectsForTenant(ctx context.Context) (int64, error)
	// Queued, unclaimed, unexpired tickets in the same bucket as a ticket. Uses
	// matchmaking_tickets_queued_idx.
	CountQueuedTicketsLike(ctx context.Context, arg CountQueuedTicketsLikeParams) (int64, error)
	// Signals this player has sent into this session in the trailing minute; the
	// handler rejects once it reaches the per-minute cap.
	CountRecentGameSessionSignals(ctx context.Context, arg CountRecentGameSessionSignalsParams) (int64, error)
	// key_type is a security boundary (the token-route per-IP limiter exempts
	// secret keys), so it is an explicit parameter — never the column default.
	CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) (CreateAPIKeyRow, error)
	CreateAnonymousPlayer(ctx context.Context, arg CreateAnonymousPlayerParams) (CreateAnonymousPlayerRow, error)
	// The caller passes the scopes; projectadmin.CreateAPIKey always includes
	// matchmaker, a zero-config feature.
	CreateControlPanelAPIKey(ctx context.Context, arg CreateControlPanelAPIKeyParams) (CreateControlPanelAPIKeyRow, error)
	// Control panel team invitations (operator-side: platform / tenant admins).
	CreateControlPanelInvitation(ctx context.Context, arg CreateControlPanelInvitationParams) (CreateControlPanelInvitationRow, error)
	CreateControlPanelMembership(ctx context.Context, arg CreateControlPanelMembershipParams) (int64, error)
	CreateControlPanelPasswordReset(ctx context.Context, arg CreateControlPanelPasswordResetParams) error
	CreateControlPanelSession(ctx context.Context, arg CreateControlPanelSessionParams) (CreateControlPanelSessionRow, error)
	CreateControlPanelTrustedDevice(ctx context.Context, arg CreateControlPanelTrustedDeviceParams) error
	CreateControlPanelUser(ctx context.Context, arg CreateControlPanelUserParams) (CreateControlPanelUserRow, error)
	CreateEmailPlayer(ctx context.Context, arg CreateEmailPlayerParams) (int64, error)
	CreateFirstControlPanelAdmin(ctx context.Context, arg CreateFirstControlPanelAdminParams) (CreateFirstControlPanelAdminRow, error)
	// Fleet templates: operator-defined recipes that allocations are drawn from.
	// Lookup is by project-scoped name (the public identifier used by the SDK,
	// matchmaker API, and control panel URLs). Soft delete keeps historical
	// allocations referenceable in the UI.
	CreateFleet(ctx context.Context, arg CreateFleetParams) (Fleet, error)
	CreateGameInvite(ctx context.Context, arg CreateGameInviteParams) (int64, error)
	CreateGameSession(ctx context.Context, arg CreateGameSessionParams) (CreateGameSessionRow, error)
	CreateLeaderboard(ctx context.Context, arg CreateLeaderboardParams) (int64, error)
	// Tenant-scoped: creates a verified player already linked to a global
	// account (public-join / invite-accept). The account's email ownership is
	// already proven, so email_verified_at is set.
	CreateLinkedPlayer(ctx context.Context, arg CreateLinkedPlayerParams) (int64, error)
	CreateMCPToken(ctx context.Context, arg CreateMCPTokenParams) (int64, error)
	CreatePendingAllocation(ctx context.Context, arg CreatePendingAllocationParams) (CreatePendingAllocationRow, error)
	// Used by the player UI signup flow; takes project_id explicitly because
	// the player site doesn't have an api_key bearer.
	CreatePlayer(ctx context.Context, arg CreatePlayerParams) (CreatePlayerRow, error)
	// Global player accounts. Platform-global (no tenant RLS): every query here is
	// run through db.Pool.BootstrapQ.
	// Creates an unverified account with its first verification code inlined
	// (mirrors CreatePlayer). Fails on the UNIQUE email constraint if an
	// account already exists.
	CreatePlayerAccount(ctx context.Context, arg CreatePlayerAccountParams) (CreatePlayerAccountRow, error)
	CreatePlayerAccountPasswordReset(ctx context.Context, arg CreatePlayerAccountPasswordResetParams) error
	CreatePlayerAccountSession(ctx context.Context, arg CreatePlayerAccountSessionParams) (int64, error)
	CreatePlayerAccountTrustedDevice(ctx context.Context, arg CreatePlayerAccountTrustedDeviceParams) error
	// Player invitations.
	// project_player_id is set only for admin "link player" invites, which bind the
	// proven email onto that existing row on accept; NULL keeps find-or-create-by-email.
	CreatePlayerInvitation(ctx context.Context, arg CreatePlayerInvitationParams) (CreatePlayerInvitationRow, error)
	CreatePlayerSession(ctx context.Context, arg CreatePlayerSessionParams) (int64, error)
	CreateProjectForTenant(ctx context.Context, name string) (CreateProjectForTenantRow, error)
	CreateRealtimeTicket(ctx context.Context, arg CreateRealtimeTicketParams) error
	CreateRelayNode(ctx context.Context, arg CreateRelayNodeParams) (RelayNode, error)
	CreateSession(ctx context.Context, arg CreateSessionParams) (CreateSessionRow, error)
	// Submit a tenant change request. The pending-unique index rejects a second
	// open request of the same kind/feature (surfaced as a friendly message).
	CreateTenantChangeRequest(ctx context.Context, arg CreateTenantChangeRequestParams) (int64, error)
	// Tenant-wide player bans. tenant_player_bans has no RLS, so every query
	// filters tenant_id explicitly. Enforcement runs in both tenant Pool.Q and
	// account BootstrapQ contexts.
	CreateTenantPlayerBan(ctx context.Context, arg CreateTenantPlayerBanParams) error
	CreateTenantSignupRequest(ctx context.Context, arg CreateTenantSignupRequestParams) (CreateTenantSignupRequestRow, error)
	// Used by invite acceptance: creates a new user who is verified by
	// definition (they had to click the invite link in their inbox).
	CreateVerifiedControlPanelUser(ctx context.Context, arg CreateVerifiedControlPanelUserParams) (CreateVerifiedControlPanelUserRow, error)
	// Creates an already-verified account (used by invite acceptance, where the
	// magic link delivered to the invited inbox proves email ownership).
	CreateVerifiedPlayerAccount(ctx context.Context, arg CreateVerifiedPlayerAccountParams) (pgtype.UUID, error)
	// Used when the host ends the session so peer rows don't linger until GC.
	DeleteAllGameSessionPeers(ctx context.Context, sessionID string) error
	// Invite rows cascade only after all roster and matchmaking references are gone.
	DeleteClosedParties(ctx context.Context, retention pgtype.Interval) (int64, error)
	DeleteConnectionLimitOverride(ctx context.Context, tenantID int64) (int64, error)
	DeleteControlPanelMembership(ctx context.Context, arg DeleteControlPanelMembershipParams) error
	// Removes a membership row but refuses to delete the actor's own row. The
	// previous approach loaded every member to do this check client-side; this
	// predicate folds it into one statement.
	DeleteControlPanelMembershipUnlessSelf(ctx context.Context, arg DeleteControlPanelMembershipUnlessSelfParams) (int64, error)
	// Backup codes cascade with the credential row.
	DeleteControlPanelTOTP(ctx context.Context, controlPanelUserID int64) error
	DeleteControlPanelTOTPBackupCodes(ctx context.Context, controlPanelUserID int64) error
	DeleteControlPanelTrustedDevicesForUser(ctx context.Context, controlPanelUserID int64) error
	DeleteControlPanelUserConnection(ctx context.Context, arg DeleteControlPanelUserConnectionParams) (int64, error)
	// Retention sweep (password_reset_gc): rows are inert once expired — every
	// lookup filters expires_at — so deleting them a day later is pure hygiene.
	DeleteExpiredControlPanelPasswordResets(ctx context.Context) (int64, error)
	DeleteExpiredControlPanelTrustedDevices(ctx context.Context) (int64, error)
	// Removes invites past their expiry for the current tenant. Called per
	// tenant by the GC goroutine.
	DeleteExpiredGameInvitesForTenant(ctx context.Context) (int64, error)
	// Removes signals past their two-minute expiry for the current tenant. Called
	// per tenant by the game-session GC sweep so long-lived sessions don't
	// accumulate expired rows (session/tenant deletion already cascades the rest).
	DeleteExpiredGameSessionSignalsForTenant(ctx context.Context) (int64, error)
	// Removes sessions past their expiry for the current tenant. Called once
	// per tenant by the GC goroutine.
	DeleteExpiredGameSessionsForTenant(ctx context.Context) (int64, error)
	// Drop expired matches that do not need allocation cleanup. Unclaimed fleet
	// matches stay until the backend deallocation above succeeds.
	DeleteExpiredMatchmakerMatches(ctx context.Context) (int64, error)
	// Retention sweep (password_reset_gc): rows are inert once expired — every
	// lookup filters expires_at — so deleting them a day later is pure hygiene.
	DeleteExpiredPlayerAccountPasswordResets(ctx context.Context) (int64, error)
	DeleteExpiredPlayerAccountTrustedDevices(ctx context.Context) (int64, error)
	DeleteExpiredRealtimeTickets(ctx context.Context) (int64, error)
	// An expired approval can never be accepted, so it must not hold its tenant name
	// or its email slot. The person can apply again. The audit log keeps the approval.
	DeleteExpiredTenantSignupApprovals(ctx context.Context) (int64, error)
	// Delete only after its allocation has been successfully deallocated. The
	// guards make retries and a concurrent cleanup safe.
	DeleteExpiredUnclaimedMatchmakerMatch(ctx context.Context, id string) (int64, error)
	// Symmetric unfriend: caller can be on either side. Never removes a 'blocked'
	// edge — a block is cleared only via the directed unblock path
	// (DeleteFriendEdgeDirected), so a blockee cannot delete the blocker's block.
	DeleteFriendEdgeByAccount(ctx context.Context, arg DeleteFriendEdgeByAccountParams) (int64, error)
	// Directed delete (unblock: only remove the edge the caller initiated).
	DeleteFriendEdgeDirected(ctx context.Context, arg DeleteFriendEdgeDirectedParams) (int64, error)
	// Either sender (cancel) or recipient (decline/dismiss) may delete an invite.
	DeleteGameInvite(ctx context.Context, arg DeleteGameInviteParams) (int64, error)
	DeleteGameSession(ctx context.Context, id string) error
	DeleteGameSessionPeer(ctx context.Context, arg DeleteGameSessionPeerParams) error
	DeletePlayerAccountConnection(ctx context.Context, arg DeletePlayerAccountConnectionParams) (int64, error)
	DeletePlayerAccountTOTP(ctx context.Context, playerAccountID pgtype.UUID) error
	DeletePlayerAccountTOTPBackupCodes(ctx context.Context, playerAccountID pgtype.UUID) error
	DeletePlayerAccountTrustedDevicesForAccount(ctx context.Context, playerAccountID pgtype.UUID) error
	// from/to player columns carry no foreign keys, and signals in a surviving
	// session outlive the player-row cascade. Remove every signal the purged
	// players sent or were addressed by, so no player IDs or SDP payloads remain
	// after the purge (the 2-minute TTL GC is not guaranteed to have run).
	DeletePlayerGameSessionSignals(ctx context.Context, ids []int64) error
	// Clear one axis override so the class ladder applies again.
	DeleteQuotaOverride(ctx context.Context, arg DeleteQuotaOverrideParams) error
	DeleteRateLimitOverride(ctx context.Context, arg DeleteRateLimitOverrideParams) error
	DeleteTenantPlayerBan(ctx context.Context, arg DeleteTenantPlayerBanParams) (int64, error)
	// GC (River job, leader-elected): drop matched/cancelled/failed tickets
	// older than the retention interval. Privileged — runs without a tenant GUC.
	// Anchored on when the ticket became terminal (matched_at for matched
	// tickets, created_at otherwise) so a matched ticket isn't purged before its
	// paired match row's retention window — otherwise a poll would 404 while the
	// match is still recoverable.
	DeleteTerminalMatchmakerTickets(ctx context.Context, retention pgtype.Interval) (int64, error)
	// Keep entries while a retained ticket or current party still references them.
	DeleteTerminalMatchmakingEntries(ctx context.Context, retention pgtype.Interval) (int64, error)
	// Drop a match whose tickets never committed, once its backend server has been
	// released. Same guards as the GC delete above minus the expiry, because this
	// runs immediately rather than waiting out the match TTL: until the row is
	// gone it still counts against the player's live-allocation cap.
	DeleteUnclaimedMatchmakerMatch(ctx context.Context, id string) (int64, error)
	DenyTenantChangeRequest(ctx context.Context, arg DenyTenantChangeRequestParams) (int64, error)
	DenyTenantSignupRequest(ctx context.Context, arg DenyTenantSignupRequestParams) (int64, error)
	// A platform disable supersedes an existing self-disable: it promotes
	// disabled_by to 'platform' in place, with no re-enable window. The original
	// disabled_at is kept. 0 rows only when already platform-disabled or gone.
	DisableTenantByPlatformAdmin(ctx context.Context, id int64) (int64, error)
	// Tenant self-disable; 0 rows means already disabled or gone.
	DisableTenantBySelf(ctx context.Context, id int64) (int64, error)
	// Declarative entitlement apply: switch a tenant-level grant off in place so
	// the row survives (audit trail, later re-enable). Runs in tenant RLS context.
	DisableTenantFeatureGrant(ctx context.Context, arg DisableTenantFeatureGrantParams) (int64, error)
	EnableTenantByPlatformAdmin(ctx context.Context, id int64) (int64, error)
	// A tenant admin can only undo a self-disable; 0 rows on a platform disable.
	EnableTenantByTenantAdmin(ctx context.Context, id int64) (int64, error)
	// TTL enforcement: unclaimed queued tickets past expires_at flip to 'failed'
	// with the structured reason 'expired'. Claimed tickets are left alone — the
	// claim path settles them.
	ExpireMatchmakerTickets(ctx context.Context) (int64, error)
	// TTL-expire this player's stale queued ticket ahead of a re-enqueue. An
	// expired-but-unswept ticket still occupies the one-active unique index (the
	// index predicate can't be time-aware), so without this the player is locked
	// out of re-queuing until the periodic sweeper runs. Mirrors
	// ExpireMatchmakerTickets but scoped to the one player; claimed tickets are
	// left for the claim path to settle.
	ExpirePlayerQueuedTicket(ctx context.Context, arg ExpirePlayerQueuedTicketParams) (int64, error)
	// Pushes a session's expiry out to the given time when that is later. The
	// join handler uses it to promote a short-lived pending matchmade session
	// to its full lifetime once a player actually joins.
	ExtendGameSessionExpiry(ctx context.Context, arg ExtendGameSessionExpiryParams) error
	// Sliding-window extension for member heartbeats: push the expiry out only
	// when less than the threshold remains, so steady heartbeats don't rewrite
	// the row every few seconds (self-gating, single statement — deliberately
	// NOT the greatest-wins ExtendGameSessionExpiry, which writes on every
	// call). Never revives an ended or already-expired session.
	ExtendGameSessionExpiryOnHeartbeat(ctx context.Context, arg ExtendGameSessionExpiryOnHeartbeatParams) (int64, error)
	FindAccountIDByEmail(ctx context.Context, email string) (pgtype.UUID, error)
	// Exact display-name match. LIMIT 2 lets the caller detect ambiguity (display
	// names are not unique) and refuse rather than friend the wrong person.
	FindAccountIDsByDisplayName(ctx context.Context, displayName *string) ([]FindAccountIDsByDisplayNameRow, error)
	FindVerifiedAccountIDByEmail(ctx context.Context, email string) (pgtype.UUID, error)
	// Bootstrap query used by the tenant middleware to resolve a Bearer token
	// to its tenant_id + project_id + tenant tier + key_type + optional realtime
	// connection envelope. Resolving them in one authoritative query prevents a
	// second per-process cache from admitting against a stale raised or lowered
	// envelope. Runs without an app.tenant_id GUC set; the api_keys_bootstrap
	// policy in 0010 lets it
	// through. Note: this query does NOT filter by tenants table RLS because
	// tenants.id = current_setting GUC is unset at bootstrap; if/when we add
	// a bootstrap policy on tenants, the JOIN keeps working.
	GetAPIKeyByHash(ctx context.Context, keyHash []byte) (GetAPIKeyByHashRow, error)
	GetAPIKeyScopes(ctx context.Context, id int64) (GetAPIKeyScopesRow, error)
	GetAPIKeyType(ctx context.Context, id int64) (string, error)
	// Tenant-level HTTP API override (project_id NULL, kind 'api'). Read by the
	// rate-limit middleware; falls back to compiled tier defaults when absent.
	GetAPIRateLimitOverride(ctx context.Context, tenantID int64) (GetAPIRateLimitOverrideRow, error)
	GetAllocation(ctx context.Context, id int64) (GetAllocationRow, error)
	GetAllowedOrigins(ctx context.Context, projectID int64) ([]string, error)
	GetAllowedOriginsForUpdate(ctx context.Context, projectID int64) ([]string, error)
	// Tenant-level realtime admission envelope. The WebSocket admission path falls
	// back to compiled tier defaults when no row exists.
	GetConnectionLimitOverride(ctx context.Context, tenantID int64) (GetConnectionLimitOverrideRow, error)
	GetControlPanelInvitationByCodeHash(ctx context.Context, codeHash []byte) (GetControlPanelInvitationByCodeHashRow, error)
	GetControlPanelInvitationByID(ctx context.Context, id int64) (GetControlPanelInvitationByIDRow, error)
	GetControlPanelMembership(ctx context.Context, arg GetControlPanelMembershipParams) (GetControlPanelMembershipRow, error)
	// Joined to control_panel_users so the session dies as soon as a platform
	// admin sets disabled_at, without needing a separate session-purge step
	// on every request path. requireSession maps ErrNoRows to a redirect to
	// /login, which is what we want for disabled accounts.
	GetControlPanelSessionByRefreshHash(ctx context.Context, refreshHash []byte) (GetControlPanelSessionByRefreshHashRow, error)
	GetControlPanelTOTP(ctx context.Context, controlPanelUserID int64) (GetControlPanelTOTPRow, error)
	// Keyed by user AND token so a token minted for one account can never
	// satisfy another's challenge.
	GetControlPanelTrustedDevice(ctx context.Context, arg GetControlPanelTrustedDeviceParams) (int64, error)
	// Status-blind variant used ONLY by the invite-accept code path so we
	// can distinguish "no row" (truly new email — create user) from "row
	// exists but disabled" (refuse with errInviteForDisabledAccount).
	// DO NOT use this for authentication.
	GetControlPanelUserAnyStatusByEmail(ctx context.Context, email string) (GetControlPanelUserAnyStatusByEmailRow, error)
	// Status-blind like GetControlPanelUserAnyStatusByEmail: the caller refuses a
	// disabled user with the same answer as an unknown connection.
	GetControlPanelUserByConnection(ctx context.Context, arg GetControlPanelUserByConnectionParams) (GetControlPanelUserByConnectionRow, error)
	// Disabled accounts (disabled_at IS NOT NULL) are filtered out here so
	// /v1/control-panel/login behaves identically to an unknown email — same
	// dummy bcrypt + invalid_credentials response.
	GetControlPanelUserByEmail(ctx context.Context, email string) (GetControlPanelUserByEmailRow, error)
	GetControlPanelUserByID(ctx context.Context, id int64) (GetControlPanelUserByIDRow, error)
	GetControlPanelUserVerificationState(ctx context.Context, id int64) (GetControlPanelUserVerificationStateRow, error)
	GetFleetByID(ctx context.Context, id int64) (Fleet, error)
	// Resolves a project-scoped name to a fleet row. Soft-deleted rows are
	// excluded so a retired fleet doesn't collide with a freshly created one
	// under the same name.
	GetFleetByName(ctx context.Context, arg GetFleetByNameParams) (Fleet, error)
	GetFriendEdgeByAccount(ctx context.Context, arg GetFriendEdgeByAccountParams) (GetFriendEdgeByAccountRow, error)
	// Scoped by project as well as tenant: the caller's key is project-pinned, so a
	// player in project A must not read a session belonging to project B of the same
	// tenant (which would leak peers' public IP:port across projects).
	GetGameSession(ctx context.Context, arg GetGameSessionParams) (GetGameSessionRow, error)
	// Open, unexpired sessions only — an expired session lingering before GC
	// must not be resolvable by join code. Returns private + host so the handler
	// can withhold a private session from a non-member/non-invitee. Project-scoped
	// so a join code can't resolve a session in another project of the same tenant.
	GetGameSessionByJoinCode(ctx context.Context, arg GetGameSessionByJoinCodeParams) (GetGameSessionByJoinCodeRow, error)
	// Row-locking variant used by the join handler so concurrent joins for the
	// same session serialize on the session row and max_players is enforced
	// without a TOCTOU race. Project-scoped (see GetGameSession).
	GetGameSessionForUpdate(ctx context.Context, arg GetGameSessionForUpdateParams) (GetGameSessionForUpdateRow, error)
	// Most-specific-wins: a project-scoped row overrides a tenant-wide row for the
	// same kind. Used by the invite throttle.
	GetInviteRateLimitOverride(ctx context.Context, arg GetInviteRateLimitOverrideParams) (GetInviteRateLimitOverrideRow, error)
	// Leaderboard entries hold ONE row per (leaderboard, player, period). The
	// board's score operator is applied at write time by the SubmitScore upsert,
	// so every read is a plain ORDER BY score. Scheduled boards bump
	// leaderboards.current_period on reset; old entries stay in place under
	// their period number.
	GetLeaderboard(ctx context.Context, arg GetLeaderboardParams) (GetLeaderboardRow, error)
	GetLeaderboardForControlPanel(ctx context.Context, arg GetLeaderboardForControlPanelParams) (GetLeaderboardForControlPanelRow, error)
	// The submit-path twin of GetLeaderboard. FOR KEY SHARE conflicts with the
	// reset job's FOR UPDATE (ListDueLeaderboardResets), so a submission blocks
	// on an in-flight reset and re-reads the advanced period instead of writing
	// into the just-archived one. Concurrent submissions do not block each other.
	GetLeaderboardForSubmit(ctx context.Context, arg GetLeaderboardForSubmitParams) (GetLeaderboardForSubmitRow, error)
	// Locks the board so concurrent writers take revision numbers in order.
	GetLeaderboardForUpdate(ctx context.Context, arg GetLeaderboardForUpdateParams) (GetLeaderboardForUpdateRow, error)
	// Runs with no tenant set (mcp_tokens_bootstrap and tenants_bootstrap allow
	// it). projects has no bootstrap policy, so the project check is a second
	// query in the tenant scope.
	GetMCPTokenByHash(ctx context.Context, tokenHash []byte) (GetMCPTokenByHashRow, error)
	GetMCPTokenCreator(ctx context.Context, arg GetMCPTokenCreatorParams) (int64, error)
	GetMatchmakerMatch(ctx context.Context, id string) (MatchmakerMatch, error)
	GetMatchmakingTicket(ctx context.Context, arg GetMatchmakingTicketParams) (GetMatchmakingTicketRow, error)
	// Diagnostic read by primary key, scoped to one project.
	GetMatchmakingTicketForTrace(ctx context.Context, arg GetMatchmakingTicketForTraceParams) (GetMatchmakingTicketForTraceRow, error)
	// Single sign-on connections. Both tables are platform-global (no tenant
	// RLS): every query here runs through db.Pool.BootstrapQ. The subject always
	// comes from a verified provider round trip, never from client input.
	GetPlayerAccountByConnection(ctx context.Context, arg GetPlayerAccountByConnectionParams) (GetPlayerAccountByConnectionRow, error)
	GetPlayerAccountByEmail(ctx context.Context, email string) (GetPlayerAccountByEmailRow, error)
	GetPlayerAccountByID(ctx context.Context, id pgtype.UUID) (GetPlayerAccountByIDRow, error)
	// Tenant-scoped: resolve a player (in a project the caller's secret key is
	// pinned to) to its linked account id, for the server-side remote-address
	// read path. NULL account => unlinked player, no address.
	GetPlayerAccountForProjectRead(ctx context.Context, arg GetPlayerAccountForProjectReadParams) (pgtype.UUID, error)
	GetPlayerAccountRemoteAddrs(ctx context.Context, id pgtype.UUID) (GetPlayerAccountRemoteAddrsRow, error)
	// Session lookup joins the account so the caller can enforce epoch match and
	// the disabled gate in one round-trip.
	GetPlayerAccountSession(ctx context.Context, refreshHash []byte) (GetPlayerAccountSessionRow, error)
	GetPlayerAccountTOTP(ctx context.Context, playerAccountID pgtype.UUID) (GetPlayerAccountTOTPRow, error)
	GetPlayerAccountTrustedDevice(ctx context.Context, arg GetPlayerAccountTrustedDeviceParams) (int64, error)
	GetPlayerAccountVerificationState(ctx context.Context, id pgtype.UUID) (GetPlayerAccountVerificationStateRow, error)
	// Change-password / self-disable state read for the authenticated caller.
	GetPlayerAuthCredentials(ctx context.Context, id int64) (GetPlayerAuthCredentialsRow, error)
	// Disabled accounts (disabled_at IS NOT NULL) are filtered out here so
	// /v1/auth/login behaves identically to an unknown email — same dummy
	// bcrypt + invalid_credentials response. Same for players who unlinked
	// themselves from the project (unlinked_at): blocked until re-invited.
	GetPlayerByEmail(ctx context.Context, arg GetPlayerByEmailParams) (GetPlayerByEmailRow, error)
	// Privileged variant of GetPlayerByEmail used by the player UI before
	// the tenant context is set; the caller already knows the project_id from
	// the URL and looks up tenant + verification state in one shot.
	GetPlayerByEmailProject(ctx context.Context, arg GetPlayerByEmailProjectParams) (GetPlayerByEmailProjectRow, error)
	GetPlayerByExternalID(ctx context.Context, arg GetPlayerByExternalIDParams) (GetPlayerByExternalIDRow, error)
	// Race repair for the idempotent portal request: when the guarded UPDATE
	// matched no rows because another surface scheduled the deletion first, this
	// reads the timestamp that request stored.
	GetPlayerDeleteRequestedByAccount(ctx context.Context, arg GetPlayerDeleteRequestedByAccountParams) (pgtype.Timestamptz, error)
	// Tenant-scoped: finds an existing (possibly unlinked) player by project +
	// email so a public-join / invite can link it instead of creating a duplicate.
	GetPlayerForAccountLink(ctx context.Context, arg GetPlayerForAccountLinkParams) (GetPlayerForAccountLinkRow, error)
	// Enriched with the linked global account: remote addresses (project admins
	// may read them; publishable keys never) and tenant-ban status. player_accounts
	// and tenant_player_bans are global (no RLS), so the LEFT JOINs resolve under
	// the tenant Pool.Q used by the control panel.
	GetPlayerForProject(ctx context.Context, arg GetPlayerForProjectParams) (GetPlayerForProjectRow, error)
	// Lookup a player by ID for the POST /v1/server/player-sessions/verify endpoint
	// (gameserver session-token verification). Filters deleted/disabled
	// accounts so a forged token claiming a stale id rejects with 401.
	// The explicit tenant_id predicate matches the project's RLS-via-GUC
	// convention (Pool.Q sets app.tenant_id) and survives a hypothetical
	// RLS disable; the JOINs against tenants/projects enforce the
	// soft-delete kill-switch — a wound-down project can't continue to
	// verify sessions.
	GetPlayerForVerify(ctx context.Context, id int64) (GetPlayerForVerifyRow, error)
	// Resolves an invite recipient by email within the caller's project.
	GetPlayerIDByEmail(ctx context.Context, arg GetPlayerIDByEmailParams) (int64, error)
	GetPlayerInvitationByCodeHash(ctx context.Context, codeHash []byte) (GetPlayerInvitationByCodeHashRow, error)
	// Tenant-scoped: the global account a player is linked to (NULL if the
	// player is anonymous / unlinked).
	GetPlayerLinkedAccountID(ctx context.Context, id int64) (pgtype.UUID, error)
	// Server-tier gate: does the named player exist in the caller's project, and
	// may a game server act for them? The tenants/projects JOINs mirror
	// GetPlayerForVerify so a wound-down project can't keep taking writes.
	GetPlayerModerationState(ctx context.Context, arg GetPlayerModerationStateParams) (GetPlayerModerationStateRow, error)
	// Reset-request/confirm state read, keyed like login. Filters mirror
	// GetPlayerByEmail: disabled/unlinked players read as unknown.
	GetPlayerPasswordResetState(ctx context.Context, arg GetPlayerPasswordResetStateParams) (GetPlayerPasswordResetStateRow, error)
	// Credential lookup for the pre-session delete-cancel endpoint: the request
	// revoked every session and login filters disabled players, so cancel
	// re-authenticates with email + password against the pending row directly.
	GetPlayerPendingDeleteByEmail(ctx context.Context, arg GetPlayerPendingDeleteByEmailParams) (GetPlayerPendingDeleteByEmailRow, error)
	GetPlayerSession(ctx context.Context, refreshHash []byte) (GetPlayerSessionRow, error)
	// PK lookup used at token issuance to snapshot the current epoch into the JWT.
	GetPlayerSessionEpoch(ctx context.Context, id int64) (int32, error)
	GetPlayerVerificationState(ctx context.Context, arg GetPlayerVerificationStateParams) (GetPlayerVerificationStateRow, error)
	GetPlayerVerificationStateByID(ctx context.Context, id int64) (GetPlayerVerificationStateByIDRow, error)
	GetPresence(ctx context.Context, playerID int64) (GetPresenceRow, error)
	// display_name lives on the linked global account; NULL for anonymous /
	// unlinked players.
	GetProfile(ctx context.Context, id int64) (GetProfileRow, error)
	// Feeds the PATCH /v1/profile email guard: is the address changing, is it
	// already verified, and when did the last code go out (resend cooldown).
	GetProfileEmailState(ctx context.Context, id int64) (GetProfileEmailStateRow, error)
	// Runtime read for the Steam sign-in endpoint, tenant-scoped via RLS GUC.
	GetProjectSteamAuthConfig(ctx context.Context, projectID int64) (GetProjectSteamAuthConfigRow, error)
	// Control-panel read: reports whether a key is stored, never its value.
	GetProjectSteamAuthConfigForControlPanel(ctx context.Context, arg GetProjectSteamAuthConfigForControlPanelParams) (GetProjectSteamAuthConfigForControlPanelRow, error)
	// Project → tenant lookup (privileged; used by the player UI which knows
	// the project from the URL but has no tenant context yet).
	GetProjectTenant(ctx context.Context, id int64) (GetProjectTenantRow, error)
	// Public player lookup. Project-scoped: an id from a sibling project resolves
	// to no rows (the handler 404s). Only public fields are selected — never the
	// account email.
	GetPublicPlayer(ctx context.Context, arg GetPublicPlayerParams) (GetPublicPlayerRow, error)
	// Friend-code resolve: same public shape and project scoping as GetPublicPlayer.
	// Disabled (including pending-delete) players and a block in either direction
	// with the caller look the same as an unknown code.
	GetPublicPlayerByFriendCode(ctx context.Context, arg GetPublicPlayerByFriendCodeParams) (GetPublicPlayerByFriendCodeRow, error)
	GetPublicSignupEnabled(ctx context.Context) (bool, error)
	// The player's current queued ticket in the project, if any. Used to surface
	// the active ticket id in the 409 when a second create hits the one-active
	// unique index.
	GetQueuedTicketForPlayer(ctx context.Context, arg GetQueuedTicketForPlayerParams) (int64, error)
	GetRelaySessionUsage(ctx context.Context, month pgtype.Date) (int64, error)
	GetRemoteConfig(ctx context.Context, projectID int64) ([]byte, error)
	GetRemoteConfigForControlPanel(ctx context.Context, arg GetRemoteConfigForControlPanelParams) ([]byte, error)
	// Locks the project row so concurrent writers take revision numbers in order.
	GetRemoteConfigForUpdate(ctx context.Context, projectID int64) ([]byte, error)
	GetServerSecret(ctx context.Context, name string) ([]byte, error)
	// Joined to project_players so refresh fails for disabled / deleted accounts
	// even if the refresh token is still otherwise valid. revoked_reason lets the
	// refresh handler tell a replayed *rotated* token (theft) from a logged-out one.
	GetSessionByRefreshHash(ctx context.Context, arg GetSessionByRefreshHashParams) (GetSessionByRefreshHashRow, error)
	GetSettingsRevision(ctx context.Context, arg GetSettingsRevisionParams) ([]byte, error)
	GetStorageObject(ctx context.Context, arg GetStorageObjectParams) (GetStorageObjectRow, error)
	GetTenantChangeRequestByID(ctx context.Context, id int64) (GetTenantChangeRequestByIDRow, error)
	GetTenantCustomTokenPublicKey(ctx context.Context) (string, error)
	GetTenantCustomTokenPublicKeyForControlPanel(ctx context.Context, tenantID int64) (string, error)
	// Lean per-request probe used by the control panel's tenant-access gate:
	// a platform-disabled tenant locks its tenant admins out.
	GetTenantDisabledState(ctx context.Context, id int64) (GetTenantDisabledStateRow, error)
	GetTenantFacts(ctx context.Context, id int64) (GetTenantFactsRow, error)
	// Lock-free snapshot of the current tenant's class, enforcement flag,
	// registered-player count, and quota overrides (axis→limit jsonb; NULL when
	// none). Read inside an RLS-scoped tx (app.tenant_id set) before a
	// quota-gated growth operation. Deliberately NOT FOR UPDATE: the
	// authoritative player gate is ReserveTenantPlayerSlot, so this read must
	// never serialize concurrent creates on the tenant row.
	GetTenantQuotaContext(ctx context.Context) (GetTenantQuotaContextRow, error)
	// FOR UPDATE variant for rare growth paths (project create, storage writes)
	// whose check-then-apply exactness relies on tenant-row serialization. Never
	// use it on the player-create path — that gate is ReserveTenantPlayerSlot,
	// and the whole point of the split is that creates don't serialize.
	GetTenantQuotaContextLocked(ctx context.Context) (GetTenantQuotaContextLockedRow, error)
	// Acceptance lookup: only an approved request with a live code is acceptable.
	GetTenantSignupRequestByCodeHash(ctx context.Context, codeHash []byte) (GetTenantSignupRequestByCodeHashRow, error)
	GetTenantSignupRequestByID(ctx context.Context, id int64) (GetTenantSignupRequestByIDRow, error)
	// Metered storage total for a tenant by id (0 if never written). Read in a
	// bootstrap tx by the control-panel settings page for the used/limit display.
	GetTenantStorageUsageByID(ctx context.Context, tenantID int64) (int64, error)
	// The tenant's billing tier, used to show the correct compiled default on the
	// rate-limits page (enforcement keys off the same tier via the API key).
	GetTenantTier(ctx context.Context, id int64) (int16, error)
	// The point of no return: FK cascades remove sessions, presence, leaderboard
	// entries, storage objects, matchmaking tickets, invites, and hosted game
	// sessions; audit_log rows survive with actor_user_id set NULL.
	HardDeletePlayers(ctx context.Context, ids []int64) (int64, error)
	IncrementControlPanelVerificationAttempts(ctx context.Context, id int64) (int32, error)
	IncrementPlayerVerificationAttempts(ctx context.Context, id int64) (int32, error)
	IncrementPlayerVerificationAttemptsByID(ctx context.Context, id int64) (int32, error)
	// Counts one managed-relay credential issuance for the tenant month. The
	// allowance check and the increment are one atomic statement: past the
	// allowance the conflict-update WHERE fails and no row returns (refuse new
	// issuance). A negative allowance means unmetered. Runs in tenant RLS context.
	IncrementRelaySessions(ctx context.Context, arg IncrementRelaySessionsParams) (int64, error)
	// Append an event for the watch stream. The trim trigger keeps history
	// bounded per allocation_id; callers can fire-and-forget.
	InsertAllocationEvent(ctx context.Context, arg InsertAllocationEventParams) error
	// Bulk-inserts a fresh backup-code set in one round-trip (pgx COPY).
	InsertControlPanelTOTPBackupCodes(ctx context.Context, arg []InsertControlPanelTOTPBackupCodesParams) (int64, error)
	InsertControlPanelUserConnection(ctx context.Context, arg InsertControlPanelUserConnectionParams) error
	InsertGameSessionSignal(ctx context.Context, arg InsertGameSessionSignalParams) (int64, error)
	InsertMatchmakerMatch(ctx context.Context, arg InsertMatchmakerMatchParams) error
	InsertMatchmakingTicket(ctx context.Context, arg InsertMatchmakingTicketParams) (InsertMatchmakingTicketRow, error)
	InsertPlayerAccountConnection(ctx context.Context, arg InsertPlayerAccountConnectionParams) error
	// Bulk-inserts a fresh backup-code set in one round-trip (pgx COPY).
	InsertPlayerAccountTOTPBackupCodes(ctx context.Context, arg []InsertPlayerAccountTOTPBackupCodesParams) (int64, error)
	// ON CONFLICT DO NOTHING makes first-boot generation race-safe: concurrent
	// instances all insert, one wins, and everyone reads the winner back.
	InsertServerSecret(ctx context.Context, arg InsertServerSecretParams) (int64, error)
	InsertSettingsRevision(ctx context.Context, arg InsertSettingsRevisionParams) error
	// Burns every outstanding reset link for the user. Run in the same
	// transaction as any password change so an older emailed link cannot reset
	// the password again afterwards.
	InvalidateControlPanelPasswordResets(ctx context.Context, controlPanelUserID int64) error
	// Burns every outstanding reset link for the account. Run in the same
	// transaction as any password change so an older emailed link cannot reset
	// the password again afterwards.
	InvalidatePlayerAccountPasswordResets(ctx context.Context, playerAccountID pgtype.UUID) error
	IsAccountBannedInTenant(ctx context.Context, arg IsAccountBannedInTenantParams) (int64, error)
	// Edge id if EITHER account has blocked the other. Defense-in-depth gate on
	// every interaction path (friend request, game invite, presence).
	IsBlockedBetweenAccounts(ctx context.Context, arg IsBlockedBetweenAccountsParams) (int64, error)
	IsEmailSuppressed(ctx context.Context, email string) (bool, error)
	IsGameSessionMember(ctx context.Context, arg IsGameSessionMemberParams) (bool, error)
	// Enforcement helper: is the given player's linked account tenant-banned in
	// the player's own tenant? Runs in a tenant Pool.Q (project_players RLS-filtered).
	// Returns pgx.ErrNoRows when not banned (or the player is unlinked).
	IsPlayerBannedByTenant(ctx context.Context, playerID int64) (int64, error)
	LatestSettingsRevision(ctx context.Context, arg LatestSettingsRevisionParams) (int64, error)
	// Friends view: current-period entries for an explicit player set, in rank
	// order. The caller re-ranks 0-based within the returned set.
	LeaderboardEntriesForPlayers(ctx context.Context, arg LeaderboardEntriesForPlayersParams) ([]LeaderboardEntriesForPlayersRow, error)
	// Any period counts: past-period entries are ranked under the board's
	// current sort order too, so history alone locks it.
	LeaderboardHasEntries(ctx context.Context, leaderboardID int64) (bool, error)
	LeaderboardRangeByRank(ctx context.Context, arg LeaderboardRangeByRankParams) ([]LeaderboardRangeByRankRow, error)
	LeaderboardUserRank(ctx context.Context, arg LeaderboardUserRankParams) (int64, error)
	// POST /v1/auth/link: attach email + password sign-in to a player that has
	// none, minting the verification challenge in the same write. The email IS
	// NULL guard makes 0 rows mean "already has credentials"; the per-project
	// email unique index rejects an address another player uses.
	LinkPlayerEmailCredentials(ctx context.Context, arg LinkPlayerEmailCredentialsParams) (int64, error)
	// ListPlayerAccountLinkedProjects is intentionally NOT a sqlc query: it reads
	// the SECURITY DEFINER player_account_linked_projects(uuid) table-function,
	// which sqlc's analyzer can't resolve column types for. It is called via raw
	// tx.Query in internal/players (same approach as project_player_tenant).
	// Tenant-scoped (run under Pool.Q with app.tenant_id set): attaches a
	// per-project player to a global account. Guarded by RLS on project_players.
	// Clears unlinked_at: a re-invite restores an unlinked player's access.
	LinkPlayerToAccount(ctx context.Context, arg LinkPlayerToAccountParams) error
	ListAPIKeys(ctx context.Context) ([]ListAPIKeysRow, error)
	// Every account the caller has an accepted friendship with, either direction.
	// Used by views that need the full friend set at once (friends leaderboard).
	ListAcceptedFriendAccountIDs(ctx context.Context, me pgtype.UUID) ([]pgtype.UUID, error)
	// Bulk-fetch email + display_name for a set of accounts (friend-list enrich).
	ListAccountIdentities(ctx context.Context, accountIds []pgtype.UUID) ([]ListAccountIdentitiesRow, error)
	ListActiveAllocations(ctx context.Context, arg ListActiveAllocationsParams) ([]ListActiveAllocationsRow, error)
	// Runs with no tenant set; see all_project_allowed_origins().
	ListAllProjectAllowedOrigins(ctx context.Context) ([]string, error)
	// Every override for a tenant — tenant-wide (project_id NULL) and per-project —
	// in one query. The rate-limits page groups these in Go rather than issuing one
	// ListRateLimitOverridesForProject per project (an N+1 over the project list).
	ListAllRateLimitOverridesForTenant(ctx context.Context, tenantID int64) ([]ListAllRateLimitOverridesForTenantRow, error)
	// Distinct backends seen across this tenant's recent allocations. Drives
	// the backends-health page so operators see which backends actually serve
	// traffic, not just the one currently configured.
	ListAllocationBackendsForTenant(ctx context.Context) ([]ListAllocationBackendsForTenantRow, error)
	ListAllocationEvents(ctx context.Context, arg ListAllocationEventsParams) ([]ListAllocationEventsRow, error)
	// Control panel fleet list: optionally include terminal rows (shutdown/failed)
	// and paginate. include_terminal=false keeps the page focused on live
	// allocations; the UI toggles it via a query param.
	ListAllocationsForProject(ctx context.Context, arg ListAllocationsForProjectParams) ([]ListAllocationsForProjectRow, error)
	ListControlPanelInvitationsForTenant(ctx context.Context, tenantID *int64) ([]ListControlPanelInvitationsForTenantRow, error)
	ListControlPanelMembersForTenant(ctx context.Context, tenantID int64) ([]ListControlPanelMembersForTenantRow, error)
	ListControlPanelTenantsForPlatformAdmin(ctx context.Context) ([]ListControlPanelTenantsForPlatformAdminRow, error)
	ListControlPanelTenantsForUser(ctx context.Context, controlPanelUserID int64) ([]ListControlPanelTenantsForUserRow, error)
	ListControlPanelUserConnections(ctx context.Context, controlPanelUserID int64) ([]ListControlPanelUserConnectionsRow, error)
	// Powers the /v1/control-panel/admin/users page. tenant_count is a
	// correlated subquery so users with zero memberships still appear.
	ListControlPanelUsersForPlatformAdmin(ctx context.Context, arg ListControlPanelUsersForPlatformAdminParams) ([]ListControlPanelUsersForPlatformAdminRow, error)
	ListDeletedLeaderboardsForProject(ctx context.Context, projectID int64) ([]ListDeletedLeaderboardsForProjectRow, error)
	// Boards whose scheduled reset boundary has passed, locked for the reset
	// transaction so two job runs can never double-archive a period. as_of is the
	// job's clock — the same instant it computes the next boundary from, so the
	// due filter and the new boundary can never disagree.
	ListDueLeaderboardResets(ctx context.Context, asOf pgtype.Timestamptz) ([]ListDueLeaderboardResetsRow, error)
	// Eligible: known, last probe succeeded, reported active, and probed within
	// the freshness window.
	ListEligibleRelayNodes(ctx context.Context, maxAgeSeconds float64) ([]RelayNode, error)
	// Name, usage, class, quota overrides, and last-notified threshold for every
	// quota-enforced tenant. Read cross-tenant by the storage-warn River job
	// (bootstrap tx).
	ListEnforcedTenantStorage(ctx context.Context) ([]ListEnforcedTenantStorageRow, error)
	// GC candidates whose allocation lease elapsed without a poll or realtime
	// delivery. Privileged — runs without a tenant GUC.
	ListExpiredUnclaimedMatchmakerAllocations(ctx context.Context) ([]ListExpiredUnclaimedMatchmakerAllocationsRow, error)
	// Control panel list. Soft-deleted rows are excluded; include_deleted is reserved
	// for a future "archive" view but not wired through the UI yet.
	ListFleetsForProject(ctx context.Context, projectID int64) ([]Fleet, error)
	// Caller-aware. For 'blocked', only rows the caller initiated are returned —
	// never rows where the caller is the blockee (which would let a blocked user
	// learn who blocked them).
	ListFriendsByStatusForAccount(ctx context.Context, arg ListFriendsByStatusForAccountParams) ([]FriendEdge, error)
	// Returns active peers (last_seen within 30 s) with each peer's optional
	// xuid and display name (from the linked global account, when present).
	// RLS on game_session_peer scopes rows to the current tenant.
	ListGameSessionPeers(ctx context.Context, sessionID string) ([]ListGameSessionPeersRow, error)
	// Recipient-scoped, cursor-ordered, unexpired signals. The to_player_id filter
	// plus RLS ensure a player only ever reads signals addressed to them, and the
	// id > after_id cursor makes repeat polls return only new signals.
	ListGameSessionSignalsForRecipient(ctx context.Context, arg ListGameSessionSignalsForRecipientParams) ([]ListGameSessionSignalsForRecipientRow, error)
	ListKnownRelayNodes(ctx context.Context) ([]RelayNode, error)
	// Finished periods, newest first, keyset-paginated on the period number.
	ListLeaderboardPeriods(ctx context.Context, arg ListLeaderboardPeriodsParams) ([]ListLeaderboardPeriodsRow, error)
	ListLeaderboardsForProject(ctx context.Context, projectID int64) ([]ListLeaderboardsForProjectRow, error)
	// Unexpired tokens, plus tokens that expired in the last 30 days so a person
	// can see why an agent stopped. Older expired tokens leave the list, so they
	// cannot push active tokens past the LIMIT.
	ListMCPTokensForProject(ctx context.Context, projectID int64) ([]ListMCPTokensForProjectRow, error)
	// Control panel matchmaker page: queue depth per (mode, region, game_mode)
	// bucket for the current tenant's project, plus oldest queued ticket and
	// the min/max count spread so operators can spot stuck buckets at a glance.
	ListMatchmakerBucketsForProject(ctx context.Context, projectID int64) ([]ListMatchmakerBucketsForProjectRow, error)
	// Target player IDs of open, unexpired invitations, for the "invite pending"
	// list badge. Expired-but-unswept invites are excluded so the badge matches
	// what the accept flow would actually honor.
	ListOpenInvitationTargetsForProject(ctx context.Context, projectID int64) ([]*int64, error)
	// Returns unexpired invites for the target user, enriched with the sender's
	// email and optional xuid for display.
	ListPendingGameInvites(ctx context.Context, toPlayerID int64) ([]ListPendingGameInvitesRow, error)
	// Platform-admin review queue: pending requests with tenant name + current
	// class. Read cross-tenant (bootstrap tx).
	ListPendingTenantChangeRequests(ctx context.Context) ([]ListPendingTenantChangeRequestsRow, error)
	ListPendingTenantSignupRequests(ctx context.Context) ([]ListPendingTenantSignupRequestsRow, error)
	ListPlatformAdminInvitations(ctx context.Context) ([]ListPlatformAdminInvitationsRow, error)
	ListPlatformAdmins(ctx context.Context) ([]ListPlatformAdminsRow, error)
	ListPlayerAccountConnections(ctx context.Context, playerAccountID pgtype.UUID) ([]ListPlayerAccountConnectionsRow, error)
	ListPlayerInvitationsForProject(ctx context.Context, projectID int64) ([]ListPlayerInvitationsForProjectRow, error)
	// Batched lifecycle sweep for live WebSockets: one query per tenant with
	// open sockets per sweep interval (O(tenants), not O(sockets)). A player
	// missing from the result (deleted) reads as revoked.
	ListPlayerSessionEpochs(ctx context.Context, ids []int64) ([]ListPlayerSessionEpochsRow, error)
	// One purge batch for the current tenant. FOR UPDATE serializes against a
	// racing cancel: the cancel either lands first (the row drops out of the
	// result) or blocks until the delete commits and reports "no pending
	// deletion". deleted_at is returned so the caller only releases quota slots
	// for rows that ever held one.
	ListPlayersDueForPurge(ctx context.Context, arg ListPlayersDueForPurgeParams) ([]ListPlayersDueForPurgeRow, error)
	// Control-panel-side player management queries. Privileged: the control panel
	// runs them as platform/tenant admin via BootstrapQ, so we filter by
	// tenant_id explicitly rather than relying on RLS.
	ListPlayersForProject(ctx context.Context, arg ListPlayersForProjectParams) ([]ListPlayersForProjectRow, error)
	ListPresenceForUsers(ctx context.Context, playerIds []int64) ([]ListPresenceForUsersRow, error)
	ListProjectsForTenant(ctx context.Context) ([]ListProjectsForTenantRow, error)
	// The public session browser: open, public, unexpired sessions in the
	// caller's project that still have room. Player counts come from the peer
	// heartbeat window (last_seen within 30 s, matching ListGameSessionPeers), and
	// a session with no live peer is a ghost lobby nobody can play in, so it is
	// excluded too. Keyset-paginated on the session id.
	ListPublicOpenGameSessions(ctx context.Context, arg ListPublicOpenGameSessionsParams) ([]ListPublicOpenGameSessionsRow, error)
	// Unknown and out-of-project ids drop out of the result set silently.
	ListPublicPlayers(ctx context.Context, arg ListPublicPlayersParams) ([]ListPublicPlayersRow, error)
	// Per-axis overrides for one tenant, for the control-panel views and the
	// platform-admin editor. Hot paths never call this — they get the same rows
	// aggregated into the quota-context snapshot above.
	ListQuotaOverridesForTenant(ctx context.Context, tenantID int64) ([]ListQuotaOverridesForTenantRow, error)
	// Region is a bucket dimension only for fleet_allocation (the server must
	// be placed in a concrete region); non-fleet modes mix regions inside one
	// bucket and the worker applies the soft-region grouping rules in Go.
	ListReadyMatchmakerBuckets(ctx context.Context) ([]ListReadyMatchmakerBucketsRow, error)
	// eligible uses the same rule and clock as ListEligibleRelayNodes, so the
	// admin list agrees with what credentials serve.
	ListRelayNodes(ctx context.Context, maxAgeSeconds float64) ([]ListRelayNodesRow, error)
	ListSettingsRevisions(ctx context.Context, arg ListSettingsRevisionsParams) ([]ListSettingsRevisionsRow, error)
	ListStorageObjects(ctx context.Context, arg ListStorageObjectsParams) ([]ListStorageObjectsRow, error)
	// Verified emails of a tenant's owner/admin members, for operational notices
	// (e.g. storage-quota warnings). Read cross-tenant by background jobs.
	ListTenantAdminEmails(ctx context.Context, tenantID int64) ([]string, error)
	// The tenant's own requests (any status) for the settings page. Filters by
	// explicit tenant_id (the table has no RLS).
	ListTenantChangeRequests(ctx context.Context, tenantID int64) ([]ListTenantChangeRequestsRow, error)
	// Tenant-level features the tenant already holds, to exclude from the request
	// dropdown. Reads feature_grants in tenant RLS context.
	ListTenantEnabledFeatures(ctx context.Context) ([]string, error)
	// Control panel list for a tenant, enriched with the banned account's email.
	ListTenantPlayerBans(ctx context.Context, tenantID int64) ([]ListTenantPlayerBansRow, error)
	// Same row lock as LockPlayerAccountSignInMethods.
	LockControlPanelUserSignInMethods(ctx context.Context, id int64) (bool, error)
	// Set the lockout window on an account that just tipped over
	// MaxLifetimeAttempts. The Go side computes the timestamp so the lockout
	// duration stays a single source of truth.
	LockControlPanelUserVerification(ctx context.Context, arg LockControlPanelUserVerificationParams) error
	// Serializes last-admin checks by locking the currently enabled platform
	// admin rows before counting them in the surrounding transaction.
	LockEnabledPlatformAdmins(ctx context.Context) ([]int64, error)
	// Serializes creates that check a per-project limit.
	LockLiveProject(ctx context.Context, projectID int64) (int64, error)
	// Row lock for the last-sign-in-method rule: two concurrent unlink requests
	// serialize here, so they cannot both pass the count and remove the last
	// two methods.
	LockPlayerAccountSignInMethods(ctx context.Context, id pgtype.UUID) (bool, error)
	LockPlayerAccountVerification(ctx context.Context, arg LockPlayerAccountVerificationParams) error
	// Transaction-scoped advisory lock serializing the per-player fleet-allocation
	// cap. The enqueue check and the worker's match insert are separate
	// transactions, so without it a ticket enqueued while an earlier one is still
	// allocating counts a stale total and both commit. Released on commit/rollback.
	LockPlayerForFleetAllocation(ctx context.Context, playerID int64) error
	LockPlayerPasswordReset(ctx context.Context, arg LockPlayerPasswordResetParams) error
	LockPlayerVerification(ctx context.Context, arg LockPlayerVerificationParams) error
	// Transaction-scoped advisory lock serializing session creation per project
	// so the open-session cap can't be raced past. Released on commit/rollback.
	LockProjectForGameSessionCreate(ctx context.Context, projectID int64) error
	// Serializes a player's concurrent signal sends within the transaction so the
	// per-minute count+insert below can't be raced past the cap under READ
	// COMMITTED. player_id (project_players.id) is globally unique, so the lock
	// key never collides across tenants. Released on commit/rollback.
	LockSignalRate(ctx context.Context, fromPlayerID int64) error
	// Transaction-scoped advisory lock serializing concurrent writes (put/delete)
	// to a single storage object so the read-modify-write of the tenant byte
	// counter can't be raced past. Released on commit/rollback.
	LockStorageObjectForWrite(ctx context.Context, arg LockStorageObjectForWriteParams) error
	// A released row stays 'shutdown'. A 'ready' row can still fail, because the
	// commit of MarkAllocationReady can succeed and report an error.
	MarkAllocationFailed(ctx context.Context, id int64) error
	// 0 rows = the row left 'pending' during the backend call, so the caller must
	// free the server that the call created.
	MarkAllocationReady(ctx context.Context, arg MarkAllocationReadyParams) (int64, error)
	MarkControlPanelInvitationAccepted(ctx context.Context, id int64) (int64, error)
	MarkControlPanelUserVerified(ctx context.Context, id int64) error
	MarkPlayerAccountVerified(ctx context.Context, id pgtype.UUID) error
	MarkPlayerInvitationAccepted(ctx context.Context, id int64) (int64, error)
	// A proven verification also restarts the lifetime budget and drops any
	// lockout, mirroring CompletePlayerPasswordReset.
	MarkPlayerVerified(ctx context.Context, id int64) error
	MarkPlayerVerifiedByID(ctx context.Context, id int64) error
	// Claims the right to send the single 100% warning email for this month.
	MarkRelayUsageWarned100(ctx context.Context, month pgtype.Date) (int64, error)
	// Claims the right to send the single 80% warning email for this month
	// (0 rows = another request already sent it).
	MarkRelayUsageWarned80(ctx context.Context, month pgtype.Date) (int64, error)
	// Clears the code hash so the magic link can't be replayed after acceptance.
	MarkTenantSignupAccepted(ctx context.Context, arg MarkTenantSignupAcceptedParams) (int64, error)
	// Cross-tenant queue-depth + oldest-queued-ticket age, sampled by the
	// observability collector for the queue gauges. Privileged: runs over the
	// bootstrap role (no tenant GUC), mirroring the sweeper's scan. Region is a
	// bucket dimension only for fleet_allocation; blanked for other modes so the
	// gauge label set matches the worker's buckets. Deliberately does NOT group by
	// game_mode: that column is developer-supplied free text, so labelling the
	// Prometheus gauges with it would make the series count unbounded.
	MatchmakerQueueStats(ctx context.Context) ([]MatchmakerQueueStatsRow, error)
	// Read-only validity probe for the GET form page; ConsumeControlPanelPasswordReset
	// is the single-use gate on the actual POST.
	PeekControlPanelPasswordReset(ctx context.Context, tokenHash []byte) (int64, error)
	// Read-only validity probe for the GET form page; ConsumePlayerAccountPasswordReset
	// is the single-use gate on the actual POST.
	PeekPlayerAccountPasswordReset(ctx context.Context, tokenHash []byte) (pgtype.UUID, error)
	// Privileged (SECURITY DEFINER) lookup used by the player invite-accept
	// page. Returns the tenant_id so the caller can SET app.tenant_id and
	// continue under normal RLS enforcement.
	//
	// The per-column casts give sqlc concrete types: it cannot introspect
	// SECURITY DEFINER table functions, so it would otherwise fall back to
	// interface{} for every column.
	PlayerInviteLookup(ctx context.Context, codeHash []byte) (PlayerInviteLookupRow, error)
	// Tenant-scoped existence probe used by the link-player accept path to tell a
	// vanished/soft-deleted target row (the invite is dead) apart from a genuine
	// conflict when BindPlayerLinkedEmail affects 0 rows.
	PlayerLinkTargetExists(ctx context.Context, id int64) (bool, error)
	ProjectIsLive(ctx context.Context, projectID int64) (bool, error)
	PromoteControlPanelUserToPlatformAdmin(ctx context.Context, id int64) error
	PruneSettingsRevisions(ctx context.Context, arg PruneSettingsRevisionsParams) error
	PruneStaleGameSessionPeers(ctx context.Context, sessionID string) (int64, error)
	// Upsert; bumps version. Caller may pass If-Match via expected_version param.
	PutStorageObject(ctx context.Context, arg PutStorageObjectParams) (PutStorageObjectRow, error)
	// Optimistic concurrency variant — only updates if the row's current
	// version matches expected. RETURNING NULL row on mismatch.
	PutStorageObjectIfMatch(ctx context.Context, arg PutStorageObjectIfMatchParams) (PutStorageObjectIfMatchRow, error)
	RecordControlPanelLoginSuccess(ctx context.Context, id int64) error
	// Stores what the probe read; a probe that read nothing clears the lifecycle
	// columns. It returns the previous probe result, read under a row lock, so
	// concurrent probers each see the result the other wrote and a change is
	// logged once. No row when the node was retired since it was listed.
	RecordRelayNodeProbe(ctx context.Context, arg RecordRelayNodeProbeParams) (RecordRelayNodeProbeRow, error)
	// Single use: the row is deleted as it is read. Runs with no tenant set.
	RedeemRealtimeTicket(ctx context.Context, ticketHash []byte) (RedeemRealtimeTicketRow, error)
	ReleaseAllocation(ctx context.Context, id int64) error
	// Worker-driven release of one failed group: the resolver (allocator,
	// session creator) failed. Bump allocation_attempts; flip to 'failed' on
	// the Nth attempt, stamping the structured reason. Returns how many tickets
	// flipped to 'failed' this call so the caller can meter the
	// attempts_exhausted failure counter without re-reading the rows.
	ReleaseMatchmakerTickets(ctx context.Context, arg ReleaseMatchmakerTicketsParams) (int64, error)
	// Counter mirror of ReserveTenantPlayerSlot for the delete-purge path: the
	// caller passes how many non-soft-deleted players it hard-deleted in the same
	// transaction (soft-deleted rows never held a slot). GREATEST guards against
	// drift from out-of-band writes ever pushing the counter negative.
	ReleaseTenantPlayerSlots(ctx context.Context, n int64) error
	// Steam linking: swap a generated identity for the platform identity.
	// Compare-and-swap on the old value so a concurrent change loses cleanly;
	// the per-project external_id unique index rejects an identity another
	// player already holds.
	ReplacePlayerExternalID(ctx context.Context, arg ReplacePlayerExternalIDParams) (int64, error)
	// Friend edges between GLOBAL player_accounts. friend_edges has no tenant_id
	// and no RLS, so these run in either a tenant Pool.Q or a BootstrapQ
	// transaction. Account ids are UUIDs.
	// One current row per directed pair. Re-requests after rejection update in
	// place; pending/accepted are idempotent (WHERE filters them, DO UPDATE
	// no-ops); blocked is terminal (WHERE omits it).
	RequestFriendByAccount(ctx context.Context, arg RequestFriendByAccountParams) (RequestFriendByAccountRow, error)
	// Per-project player deletion: account-portal request/cancel plus the purge
	// sweep. The portal queries run under BootstrapQ with app.tenant_id set for
	// the link's tenant (same pattern as UnlinkPlayerFromAccount); the sweep runs
	// per tenant under Pool.Q. The account guard stops one account from deleting
	// another account's player.
	// Portal-side delete request: disables the player (keeping an earlier
	// suspension timestamp intact) and stamps delete_requested_at with the same
	// now() so cancel can tell the two apart. 0 rows = not this account's player
	// or already pending.
	RequestPlayerDeleteByAccount(ctx context.Context, arg RequestPlayerDeleteByAccountParams) (pgtype.Timestamptz, error)
	// Admin-side delete request: disables the player (keeping an earlier
	// suspension timestamp intact) and stamps delete_requested_at with the same
	// now() so cancel can tell the two apart. Marks the request as the admin's,
	// so the player cannot cancel it. A pending player request becomes the admin's
	// and keeps its time stamp, so the purge time does not move. 0 rows = gone or
	// already the admin's.
	RequestPlayerDeleteInProject(ctx context.Context, arg RequestPlayerDeleteInProjectParams) (pgtype.Timestamptz, error)
	// Self-service delete request: disables the player (keeping an earlier
	// suspension timestamp intact) and stamps delete_requested_at with the same
	// now() so cancel can tell the two apart. The purge sweep hard-deletes the
	// row once the grace window passes. 0 rows = gone or already pending.
	RequestPlayerDeleteSelf(ctx context.Context, id int64) (pgtype.Timestamptz, error)
	// Atomic check-and-bump, same shape as ReserveControlPanelVerifyAttempt: the
	// cap lives in the WHERE so parallel wrong codes cannot overshoot it.
	// Returns 0 rows when already at cap (caller treats as locked).
	ReserveControlPanelTOTPAttempt(ctx context.Context, arg ReserveControlPanelTOTPAttemptParams) (ReserveControlPanelTOTPAttemptRow, error)
	// Atomic check-and-bump used in place of the previous fetch-then-increment
	// pattern: two parallel wrong codes used to both pass the cap check before
	// either incremented, so the lockout could be overshot. The WHERE clause
	// now folds the bound into the same statement that mutates the counter.
	// Returns 0 rows when already at cap (caller treats as errVerifyLocked).
	ReserveControlPanelVerifyAttempt(ctx context.Context, arg ReserveControlPanelVerifyAttemptParams) (ReserveControlPanelVerifyAttemptRow, error)
	ReservePlayerAccountTOTPAttempt(ctx context.Context, arg ReservePlayerAccountTOTPAttemptParams) (ReservePlayerAccountTOTPAttemptRow, error)
	// Atomic check-and-bump; returns 0 rows when already at the per-code cap.
	ReservePlayerAccountVerifyAttempt(ctx context.Context, arg ReservePlayerAccountVerifyAttemptParams) (ReservePlayerAccountVerifyAttemptRow, error)
	// Atomic check-and-bump, the ReservePlayerVerifyAttempt twin for resets.
	ReservePlayerPasswordResetAttempt(ctx context.Context, arg ReservePlayerPasswordResetAttemptParams) (ReservePlayerPasswordResetAttemptRow, error)
	// Atomic check-and-bump (see ReserveControlPanelVerifyAttempt for the
	// TOCTOU explanation). Returns 0 rows when already at cap.
	ReservePlayerVerifyAttempt(ctx context.Context, arg ReservePlayerVerifyAttemptParams) (ReservePlayerVerifyAttemptRow, error)
	// Authoritative player-quota gate: atomically claims one registered-player
	// slot by bumping player_count, refusing at the class cap (0 rows affected).
	// Run it as the LAST statement before commit so the tenant-row lock is held
	// for a single round trip instead of across the whole create transaction.
	// player_limit is quota.Limits.Players; -1 is quota.Unlimited. The
	// NOT enforce_quotas arm admits unenforced tenants while still counting
	// them, so player_count stays exact for every tenant and flipping
	// enforce_quotas on later needs no recompute. Out-of-band player writes
	// (bulk seeds, imports) must maintain the counter themselves.
	ReserveTenantPlayerSlot(ctx context.Context, playerLimit int64) (int64, error)
	ResetControlPanelTOTPAttempts(ctx context.Context, controlPanelUserID int64) error
	ResetPlayerAccountTOTPAttempts(ctx context.Context, playerAccountID pgtype.UUID) error
	// Accept or reject. Only a pending edge can move, so a block or an unfriend that
	// commits first wins: the row lock makes this re-check status, and it returns 0.
	ResolvePendingFriendEdge(ctx context.Context, arg ResolvePendingFriendEdgeParams) (int64, error)
	// Tenant-scoped: maps a set of accounts back to their player in a specific
	// project, for presence sharing and JSON-API user_id mapping.
	ResolvePlayersForAccountsInProject(ctx context.Context, arg ResolvePlayersForAccountsInProjectParams) ([]ResolvePlayersForAccountsInProjectRow, error)
	// Undo a code reservation only when it is still the code whose delivery
	// failed. A concurrent request that installed a newer code must win.
	RestoreControlPanelUserVerificationCode(ctx context.Context, arg RestoreControlPanelUserVerificationCodeParams) error
	RestoreLeaderboard(ctx context.Context, arg RestoreLeaderboardParams) (int64, error)
	// Undo a code reservation only when it is still the code whose delivery
	// failed. A concurrent request that installed a newer code must win.
	RestorePlayerAccountVerificationCode(ctx context.Context, arg RestorePlayerAccountVerificationCodeParams) error
	// Retiring is idempotent and keeps the row. A retired node is never probed
	// or advertised again.
	RetireRelayNode(ctx context.Context, id int64) (RelayNode, error)
	// Un-claim whatever the claim still holds without penalty: tickets that
	// didn't fit a group this pass simply go back to waiting.
	ReturnMatchmakerClaim(ctx context.Context, claimID pgtype.UUID) (int64, error)
	// Penalty-free un-claim of specific still-queued tickets holding this claim:
	// the survivors of a short commit go back to waiting without an attempt bump.
	// Drifted tickets (cancelled/failed) are no longer 'queued' and are skipped.
	ReturnMatchmakerTicketsByID(ctx context.Context, arg ReturnMatchmakerTicketsByIDParams) (int64, error)
	RevokeAPIKey(ctx context.Context, id int64) error
	// Reuse-detection response: nuke every live session for the player in this
	// project. Paired with BumpPlayerSessionEpoch so outstanding access tokens die
	// at the epoch gate immediately, not just at TTL.
	RevokeActivePlayerSessions(ctx context.Context, arg RevokeActivePlayerSessionsParams) (int64, error)
	RevokeAllControlPanelSessionsForUser(ctx context.Context, controlPanelUserID int64) error
	RevokeAllPlayerAccountSessions(ctx context.Context, playerAccountID pgtype.UUID) error
	// Runs under the RLS-bypassing bootstrap role, so scope to the tenant in SQL
	// rather than relying solely on the caller's precheck.
	RevokeControlPanelInvitation(ctx context.Context, arg RevokeControlPanelInvitationParams) error
	RevokeControlPanelSession(ctx context.Context, id int64) error
	RevokeMCPToken(ctx context.Context, arg RevokeMCPTokenParams) (int64, error)
	// Bulk-revoke the outgoing invitations a (now-disabled) user created.
	// Re-enabling does NOT un-revoke these; the platform admin can re-issue.
	RevokeOpenInvitationsByInviter(ctx context.Context, invitedByUserID int64) error
	// 2FA enable/disable revokes every session except the one doing the change;
	// the RevokeAll variant would log the acting user out mid-flow.
	RevokeOtherControlPanelSessionsForUser(ctx context.Context, arg RevokeOtherControlPanelSessionsForUserParams) error
	RevokeOtherPlayerAccountSessions(ctx context.Context, arg RevokeOtherPlayerAccountSessionsParams) error
	RevokePlayerAccountSession(ctx context.Context, refreshHash []byte) error
	RevokePlayerInvitation(ctx context.Context, id int64) error
	RevokePlayerSession(ctx context.Context, refreshHash []byte) error
	// Rotation path: the token is being superseded by a freshly-issued one, so a
	// later replay of this hash is a reuse (theft) signal.
	RevokeSession(ctx context.Context, id int64) (int64, error)
	// Logout path: a later replay of this hash is a benign stale-client retry, not
	// reuse, so it must NOT trip the family kill.
	RevokeSessionByRefreshHash(ctx context.Context, refreshHash []byte) (int64, error)
	// Link-player resend path: clear any open invite that would collide with the
	// fresh one before it is inserted — either a prior invite for the same target
	// row, or any open invite (targeted or plain) to the same (project_id, email).
	// The open-invite unique index is keyed on (project_id, email) alone, so a
	// pre-existing plain invite to the same address must be superseded too or the
	// insert 409s.
	RevokeSupersededPlayerInvitations(ctx context.Context, arg RevokeSupersededPlayerInvitationsParams) error
	// Platform-admin search by email prefix. Bounded LIMIT keeps the scan cheap.
	SearchPlayerAccounts(ctx context.Context, arg SearchPlayerAccountsParams) ([]SearchPlayerAccountsRow, error)
	SetAPIKeyScopes(ctx context.Context, arg SetAPIKeyScopesParams) error
	SetAllocationStatus(ctx context.Context, arg SetAllocationStatusParams) error
	SetAllowedOrigins(ctx context.Context, arg SetAllowedOriginsParams) error
	// The monotonic guard in the WHERE makes replay detection atomic: 0 rows
	// means another request already consumed this timestep.
	SetControlPanelTOTPLastUsedStep(ctx context.Context, arg SetControlPanelTOTPLastUsedStepParams) (int64, error)
	// Nullable timestamptz so the same query handles disable (now()) and
	// enable (NULL).
	SetControlPanelUserDisabled(ctx context.Context, arg SetControlPanelUserDisabledParams) error
	SetControlPanelUserVerificationCode(ctx context.Context, arg SetControlPanelUserVerificationCodeParams) error
	// Platform-level disable. Bumps session_epoch to kill live sessions.
	SetPlayerAccountDisabled(ctx context.Context, id pgtype.UUID) error
	// Player-set display name (PATCH /v1/profile). NULL clears it.
	SetPlayerAccountDisplayName(ctx context.Context, arg SetPlayerAccountDisplayNameParams) error
	SetPlayerAccountEnabled(ctx context.Context, id pgtype.UUID) error
	// Password change bumps session_epoch so every outstanding account session is
	// invalidated on its next request.
	SetPlayerAccountPassword(ctx context.Context, arg SetPlayerAccountPasswordParams) error
	SetPlayerAccountRemoteAddrs(ctx context.Context, arg SetPlayerAccountRemoteAddrsParams) error
	SetPlayerAccountTOTPLastUsedStep(ctx context.Context, arg SetPlayerAccountTOTPLastUsedStepParams) (int64, error)
	SetPlayerAccountVerificationCode(ctx context.Context, arg SetPlayerAccountVerificationCodeParams) error
	SetPlayerDisabled(ctx context.Context, arg SetPlayerDisabledParams) error
	// Project-level disable (NOT tenant-wide — a tenant-wide ban lives in
	// tenant_player_bans). Bumps session_epoch so live JWTs are rejected at
	// server-verify immediately. A pending delete request owns the disabled
	// state: 0 rows on an existing player means "cancel the deletion first".
	SetPlayerDisabledInProject(ctx context.Context, arg SetPlayerDisabledInProjectParams) (int64, error)
	// Self-service disable: the epoch bump revokes live access tokens through the
	// middleware gate. 0 rows = already disabled or gone.
	SetPlayerDisabledSelf(ctx context.Context, id int64) (int64, error)
	// Regenerate: overwrites unconditionally, invalidating the old code.
	// 0 rows = soft-deleted or missing caller.
	SetPlayerFriendCode(ctx context.Context, arg SetPlayerFriendCodeParams) (int64, error)
	// Lazy first-read initialization: 0 rows means a concurrent reader won the
	// race (re-read) or the caller already has a code.
	SetPlayerFriendCodeIfAbsent(ctx context.Context, arg SetPlayerFriendCodeIfAbsentParams) (int64, error)
	// Mints a fresh reset code: per-code attempts restart, lifetime attempts and
	// the lockout survive so re-requesting codes never grants extra guesses.
	SetPlayerPasswordResetChallenge(ctx context.Context, arg SetPlayerPasswordResetChallengeParams) error
	SetPlayerVerificationCode(ctx context.Context, arg SetPlayerVerificationCodeParams) error
	SetPlayerVerificationCodeByID(ctx context.Context, arg SetPlayerVerificationCodeByIDParams) error
	SetProjectPublicJoining(ctx context.Context, arg SetProjectPublicJoiningParams) error
	SetPublicSignupEnabled(ctx context.Context, arg SetPublicSignupEnabledParams) error
	// Flip the per-tenant enforcement flag. Used by provisioning when the operator
	// has enabled quota enforcement for new tenants. player_count is maintained
	// for unenforced tenants too, so flipping this on later is safe as long as
	// players were only ever created through the app's create paths.
	SetTenantEnforceQuotas(ctx context.Context, arg SetTenantEnforceQuotasParams) error
	SetTenantPublicJoining(ctx context.Context, enabled bool) error
	SetTenantStorageNotifiedThreshold(ctx context.Context, arg SetTenantStorageNotifiedThresholdParams) error
	// Platform-admin direct tier changes may move in either direction. Capture the
	// prior tier under the same row lock so the audit record cannot race another
	// administrator's update.
	SetTenantTierByID(ctx context.Context, arg SetTenantTierByIDParams) (SetTenantTierByIDRow, error)
	// Declarative entitlement apply: converge on an exact class in either
	// direction (downgrades rely on the existing grace path). 0 rows = no-op.
	// Runs in tenant RLS context.
	SetTenantTierExact(ctx context.Context, tier int16) (int64, error)
	// Auto-applied on tier-upgrade approval. The direction check and write are one
	// atomic operation so a stale request can never lower the current tier.
	SetTenantTierIfUpgrade(ctx context.Context, tier int16) (int64, error)
	SoftDeleteFleet(ctx context.Context, id int64) error
	SoftDeleteLeaderboard(ctx context.Context, arg SoftDeleteLeaderboardParams) (int64, error)
	// Soft-deletes and returns the freed byte count (octet_length(value::text)) so
	// the caller can decrement the tenant storage counter in the same tx. Returns
	// no rows when the object is already absent (delete is idempotent).
	SoftDeleteStorageObject(ctx context.Context, arg SoftDeleteStorageObjectParams) (int64, error)
	// One-shot inputs for the pre-write storage-quota check: the tenant's current
	// metered total, the existing object's size (0 if new), and the incoming
	// value's size — all measured as octet_length(value::text) so they match the
	// counter maintained by ApplyTenantStorageDelta. Runs in the write tx
	// (app.tenant_id set), serialized per object by LockStorageObjectForWrite.
	StorageUsageForWrite(ctx context.Context, arg StorageUsageForWriteParams) (StorageUsageForWriteRow, error)
	// Operator-aware upsert. 'best' keeps the better score by sort order, 'set'
	// replaces, 'incr' adds. clamp_min/clamp_max bound the ACCUMULATED 'incr'
	// total (the request-level bounds check only sees the delta, so without this
	// a client could stack in-bounds deltas past score_max); callers pass NULL to
	// leave the total unclamped. Metadata follows the standing score on 'best'
	// (a worse run must not overwrite the record run's metadata) and the latest
	// submission otherwise. Zero rows means the attempt cap blocked the write —
	// the arbiter matched but the DO UPDATE WHERE refused it.
	SubmitScore(ctx context.Context, arg SubmitScoreParams) (int64, error)
	// Idempotent: repeated unsubscribes are a no-op.
	SuppressEmail(ctx context.Context, email string) error
	// Release every claim whose lease has expired. Same accounting as
	// ReleaseMatchmakerClaim (bump attempts, fail at the cap). Runs out of a
	// detached context so it isn't tied to any request lifetime. Returns the
	// number of claims released and, of those, how many flipped to 'failed' at
	// the cap so the caller can meter the attempts_exhausted failure counter.
	SweepStaleMatchmakerClaims(ctx context.Context, maxAttempts int32) (SweepStaleMatchmakerClaimsRow, error)
	// A name is taken if an active tenant has it, or another live (pending/approved)
	// signup request claims it. exclude_request_id lets the approve re-check ignore
	// the request being approved; pass 0 at submit time.
	TenantNameTaken(ctx context.Context, arg TenantNameTakenParams) (bool, error)
	// display_name rides along from the entry's linked global account (NULL for
	// anonymous players); joining pp/a cannot fan out because pp.id is unique.
	TopN(ctx context.Context, arg TopNParams) ([]TopNRow, error)
	TouchControlPanelSession(ctx context.Context, arg TouchControlPanelSessionParams) error
	TouchControlPanelUserConnection(ctx context.Context, arg TouchControlPanelUserConnectionParams) error
	// Returns rows affected (0 when the caller isn't a member of the session)
	// so the heartbeat handler can reject non-members instead of leaking the
	// roster.
	TouchGameSessionPeer(ctx context.Context, arg TouchGameSessionPeerParams) (int64, error)
	// At most one write per minute for each token.
	TouchMCPTokenLastUsed(ctx context.Context, id int64) error
	TouchPlayerAccountConnection(ctx context.Context, arg TouchPlayerAccountConnectionParams) error
	// Player-initiated, non-destructive unlink. The row and its game data stay;
	// the account link goes inactive and player-credential auth is blocked
	// (unlinked_at filters on the auth queries). The epoch bump kills live access
	// tokens immediately; the caller also revokes the player's sessions. The
	// account guard stops one account from unlinking another account's player.
	// A pending deletion blocks the unlink: severing the link would remove the
	// portal's only cancellation path while the purge stays scheduled.
	UnlinkPlayerFromAccount(ctx context.Context, arg UnlinkPlayerFromAccountParams) (int64, error)
	UpdateAPIKeyLabel(ctx context.Context, arg UpdateAPIKeyLabelParams) error
	UpdateControlPanelPassword(ctx context.Context, arg UpdateControlPanelPasswordParams) error
	UpdateFleet(ctx context.Context, arg UpdateFleetParams) error
	UpdateGameSessionState(ctx context.Context, arg UpdateGameSessionStateParams) error
	// score_operator and current_period are deliberately absent: the operator is
	// fixed at creation and the period only moves via AdvanceLeaderboardPeriod.
	UpdateLeaderboard(ctx context.Context, arg UpdateLeaderboardParams) (int64, error)
	UpdatePlayerPassword(ctx context.Context, arg UpdatePlayerPasswordParams) error
	// Profile updates are deliberately narrow — only fields explicitly
	// enumerated server-side may change. PATCHing email re-triggers the
	// verify flow (handler clears email_verified_at).
	UpdateProfileEmail(ctx context.Context, arg UpdateProfileEmailParams) error
	// Self-set secondary identifier. NULL clears it. The unique partial index
	// on (project_id, xuid) rejects collisions with a constraint violation.
	UpdateProfileXuid(ctx context.Context, arg UpdateProfileXuidParams) error
	// A NULL key keeps the stored one, so the settings form can update the app id
	// without re-entering the secret (replace-on-write).
	UpdateProjectSteamAuthConfig(ctx context.Context, arg UpdateProjectSteamAuthConfigParams) (int64, error)
	UpdateRemoteConfig(ctx context.Context, arg UpdateRemoteConfigParams) (int64, error)
	UpdateTenantCustomTokenPublicKey(ctx context.Context, arg UpdateTenantCustomTokenPublicKeyParams) (int64, error)
	UpsertConnectionLimitOverride(ctx context.Context, arg UpsertConnectionLimitOverrideParams) error
	// Starts (or restarts) enrollment. The WHERE guard makes this a no-op for a
	// confirmed credential — zero rows means "already enabled", so a stray setup
	// POST can never silently replace a live secret.
	UpsertControlPanelTOTPPending(ctx context.Context, arg UpsertControlPanelTOTPPendingParams) (int64, error)
	// Used for block: create-or-overwrite the directed edge to a terminal status
	// regardless of the prior state (blocking a stranger, a pending, or a friend).
	UpsertFriendEdgeStatusByAccount(ctx context.Context, arg UpsertFriendEdgeStatusByAccountParams) error
	UpsertGameSessionPeer(ctx context.Context, arg UpsertGameSessionPeerParams) error
	// Player-account mirrors of control_panel_totp.sql; see the comments there for
	// the atomicity rationale on each statement.
	UpsertPlayerAccountTOTPPending(ctx context.Context, arg UpsertPlayerAccountTOTPPendingParams) (pgtype.UUID, error)
	// Custom-token flow: find existing player with this external_id under
	// (tenant, project) or create one. Idempotent across repeated calls.
	UpsertPlayerByExternalID(ctx context.Context, arg UpsertPlayerByExternalIDParams) (int64, error)
	UpsertPresence(ctx context.Context, arg UpsertPresenceParams) error
	// Write one axis override. Platform-admin only (directly or via an approved
	// change request); the axis CHECK constraint rejects unknown axes.
	UpsertQuotaOverride(ctx context.Context, arg UpsertQuotaOverrideParams) error
	UpsertRateLimitOverride(ctx context.Context, arg UpsertRateLimitOverrideParams) error
	// Auto-applied on feature-request approval. Tenant-level grant (project_id
	// NULL); runs in tenant RLS context.
	UpsertTenantFeatureGrant(ctx context.Context, arg UpsertTenantFeatureGrantParams) error
	WriteAudit(ctx context.Context, arg WriteAuditParams) error
	WritePlatformAudit(ctx context.Context, arg WritePlatformAuditParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AdvanceLeaderboardPeriod

func (q *Queries) AdvanceLeaderboardPeriod(ctx context.Context, arg AdvanceLeaderboardPeriodParams) (int64, error)

func (*Queries) ApplyTenantStorageDelta

func (q *Queries) ApplyTenantStorageDelta(ctx context.Context, delta int64) error

Adjust the current tenant's storage counter by delta (bytes; negative on delete/shrink), clamped at zero. Called in the write tx after a successful object write so the counter stays in lockstep. Runs in tenant context.

func (*Queries) ApproveTenantChangeRequest

func (q *Queries) ApproveTenantChangeRequest(ctx context.Context, arg ApproveTenantChangeRequestParams) (int64, error)

func (*Queries) ApproveTenantSignupRequest

func (q *Queries) ApproveTenantSignupRequest(ctx context.Context, arg ApproveTenantSignupRequestParams) (int64, error)

func (*Queries) ArchiveLeaderboardPeriod

func (q *Queries) ArchiveLeaderboardPeriod(ctx context.Context, arg ArchiveLeaderboardPeriodParams) error

func (*Queries) AreAccountsFriendsAccepted

func (q *Queries) AreAccountsFriendsAccepted(ctx context.Context, arg AreAccountsFriendsAcceptedParams) (int64, error)

Edge id if an accepted friendship exists in either direction.

func (*Queries) BindPlayerLinkedEmail

func (q *Queries) BindPlayerLinkedEmail(ctx context.Context, arg BindPlayerLinkedEmailParams) (int64, error)

Tenant-scoped: admin "link player" accept binds a proven email + global account onto an existing (external-id) row, marking it verified. Guards, any of which affecting 0 rows makes the caller treat the accept as a conflict:

  • the email unique index may reject if another player already owns the address;
  • the account guard prevents clobbering a row already linked to a different account;
  • the verified-email guard refuses to overwrite an address the player has already verified under a different email — so a link invite accepted after the player self-verifies a different address can't silently replace (and re-mark verified) their real email.

func (*Queries) BumpAccountPlayerEpochsInTenant

func (q *Queries) BumpAccountPlayerEpochsInTenant(ctx context.Context, arg BumpAccountPlayerEpochsInTenantParams) error

Bump every player of an account within a tenant (tenant-ban path), so all their live JWTs are rejected at server-verify immediately.

func (*Queries) BumpControlPanelLoginFailure

Atomic increment + conditional lockout. The previous read-then-write pattern was TOCTOU-racy: N parallel failed logins all read the same value and wrote N+1, so 10 simultaneous wrong passwords landed at login_failures=1 and the lockout never fired. UPDATE...RETURNING serialises under the row lock pgx already takes.

func (*Queries) BumpPlayerSessionEpoch

func (q *Queries) BumpPlayerSessionEpoch(ctx context.Context, id int64) error

Single player (project disable path).

func (*Queries) CancelMatchmakingTicket

func (q *Queries) CancelMatchmakingTicket(ctx context.Context, arg CancelMatchmakingTicketParams) (int64, error)

Cancelling a claimed-but-not-yet-committed ticket is allowed: the worker's CommitClaim will find zero rows and deallocate the orphan server.

func (*Queries) CancelPlayerDeleteByAccount

func (q *Queries) CancelPlayerDeleteByAccount(ctx context.Context, arg CancelPlayerDeleteByAccountParams) (int64, error)

Clears the pending request; lifts the disable only when the request created it (disabled_at = delete_requested_at), so a pre-existing admin suspension survives the cancel. An admin's request is not the player's to cancel. 0 rows = no pending player request (or already purged).

func (*Queries) CancelPlayerDeleteInProject

func (q *Queries) CancelPlayerDeleteInProject(ctx context.Context, arg CancelPlayerDeleteInProjectParams) (int64, error)

Clears the pending request; lifts the disable only when the request created it (disabled_at = delete_requested_at), so a pre-existing admin suspension survives the cancel. SET expressions read pre-update values, so the CASE sees delete_requested_at before it is cleared.

func (*Queries) CancelPlayerDeleteSelf

func (q *Queries) CancelPlayerDeleteSelf(ctx context.Context, id int64) (int64, error)

Clears the pending request; lifts the disable only when the request created it (disabled_at = delete_requested_at), so a suspension that predates the request survives the cancel. An admin's request is not the player's to cancel. 0 rows = no pending player request (or purged).

func (*Queries) ClaimMatchmakerBucket

func (q *Queries) ClaimMatchmakerBucket(ctx context.Context, arg ClaimMatchmakerBucketParams) ([]ClaimMatchmakerBucketRow, error)

Bound the player count without splitting entries. The oldest entry can exceed a small budget so it is never starved. Their tickets stay 'queued'; only claim_id/claimed_at/claim_expires_at are set, so a subsequent ClaimBucket (different worker) skips them. The caller commits via CommitMatchmakerTickets (success) or ReleaseMatchmakerTickets (failure); a crashed caller's claim is released by the sweeper once claim_expires_at < now(). fleet_id is NULL for non-fleet modes, hence IS NOT DISTINCT FROM.

func (*Queries) ClaimMatchmakerMatch

func (q *Queries) ClaimMatchmakerMatch(ctx context.Context, id string) (MatchmakerMatch, error)

Poll/realtime delivery claims only live matches. The expiry guard prevents a late poll from reviving an allocation after the GC lease has elapsed.

func (*Queries) ClaimVerifiedPlayerAccount

func (q *Queries) ClaimVerifiedPlayerAccount(ctx context.Context, arg ClaimVerifiedPlayerAccountParams) error

Race-safe half of find-or-create for a proven email (the caller re-reads after this, so a concurrent creator's row is picked up); ON CONFLICT never aborts the surrounding transaction. An unverified row is claimed: whoever created it never proved the email, so the proven owner's password replaces theirs and the row's pending code and display name are cleared. A verified row is left alone.

func (*Queries) ClearControlPanelVerificationCode

func (q *Queries) ClearControlPanelVerificationCode(ctx context.Context, id int64) error

func (*Queries) ClearPlayerPasswordResetLock

func (q *Queries) ClearPlayerPasswordResetLock(ctx context.Context, id int64) error

Runs when a confirm attempt arrives after the lockout expired: the lockout window is over, so the lifetime budget restarts with it.

func (*Queries) ClearPlayerVerificationCode

func (q *Queries) ClearPlayerVerificationCode(ctx context.Context, id int64) error

func (*Queries) ClearPlayerVerificationLock

func (q *Queries) ClearPlayerVerificationLock(ctx context.Context, id int64) error

The ClearPlayerPasswordResetLock twin for email verification.

func (*Queries) ClearProjectSteamAuthConfig

func (q *Queries) ClearProjectSteamAuthConfig(ctx context.Context, projectID int64) (int64, error)

func (*Queries) CommitMatchmakerTickets

func (q *Queries) CommitMatchmakerTickets(ctx context.Context, arg CommitMatchmakerTicketsParams) (int64, error)

Flip the given still-queued tickets holding this claim_id to 'matched' and stamp the match id, address + protocol. Rows that drifted (cancelled, swept) won't match the WHERE and are excluded — the caller compares rows-affected and deallocates the orphan server when 0.

func (*Queries) CompletePlayerPasswordReset

func (q *Queries) CompletePlayerPasswordReset(ctx context.Context, arg CompletePlayerPasswordResetParams) (int64, error)

Sets the new password, clears the challenge, and bumps the session epoch so every outstanding access token (possibly an attacker's) dies immediately. A proven reset also restarts the lifetime budget and drops any lockout: the caller just demonstrated control of the inbox. The code_hash condition pins completion to the exact challenge the caller validated — 0 rows means a concurrent re-request replaced it and the code no longer counts.

func (*Queries) ConfirmControlPanelTOTP

func (q *Queries) ConfirmControlPanelTOTP(ctx context.Context, arg ConfirmControlPanelTOTPParams) (int64, error)

last_used_step records the enrollment code's timestep so the same code cannot be replayed at the first login challenge.

func (*Queries) ConfirmPlayerAccountTOTP

func (q *Queries) ConfirmPlayerAccountTOTP(ctx context.Context, arg ConfirmPlayerAccountTOTPParams) (int64, error)

func (*Queries) ConsumeControlPanelPasswordReset

func (q *Queries) ConsumeControlPanelPasswordReset(ctx context.Context, tokenHash []byte) (int64, error)

Atomic single-use consume: 0 rows means unknown, expired, or already used.

func (*Queries) ConsumeControlPanelTOTPBackupCode

func (q *Queries) ConsumeControlPanelTOTPBackupCode(ctx context.Context, arg ConsumeControlPanelTOTPBackupCodeParams) (int64, error)

Single-use enforced by the used_at IS NULL guard in the same statement that marks it used. 0 rows = unknown or already-spent code.

func (*Queries) ConsumePlayerAccountPasswordReset

func (q *Queries) ConsumePlayerAccountPasswordReset(ctx context.Context, tokenHash []byte) (pgtype.UUID, error)

Atomic single-use consume: 0 rows means unknown, expired, or already used.

func (*Queries) ConsumePlayerAccountTOTPBackupCode

func (q *Queries) ConsumePlayerAccountTOTPBackupCode(ctx context.Context, arg ConsumePlayerAccountTOTPBackupCodeParams) (int64, error)

func (*Queries) ControlPanelCreateTenant

func (*Queries) ControlPanelCreateTenantBare

func (q *Queries) ControlPanelCreateTenantBare(ctx context.Context, arg ControlPanelCreateTenantBareParams) (int64, error)

func (*Queries) CountActiveAPIKeysForProject

func (q *Queries) CountActiveAPIKeysForProject(ctx context.Context, projectID *int64) (int64, error)

func (*Queries) CountActiveGameSessionPeers

func (q *Queries) CountActiveGameSessionPeers(ctx context.Context, arg CountActiveGameSessionPeersParams) (int64, error)

Counts peers seen within the activity window, excluding a given user so a re-joining member doesn't count against the session's capacity.

func (*Queries) CountActiveMCPTokens

func (q *Queries) CountActiveMCPTokens(ctx context.Context, projectID int64) (int64, error)

func (*Queries) CountActiveSignalMembers

func (q *Queries) CountActiveSignalMembers(ctx context.Context, arg CountActiveSignalMembersParams) (int64, error)

Counts how many of the given players are ACTIVE members (last_seen within 30 s, matching ListGameSessionPeers/CountActiveGameSessionPeers) of an open, unexpired session in this project. The signal handlers pass both endpoints for a send (expecting 2) or just the caller for a poll (expecting 1), so the count defines "both peers are in the same live session" without diverging from the roster the clients themselves see.

func (*Queries) CountAllocationsForProject

func (q *Queries) CountAllocationsForProject(ctx context.Context, arg CountAllocationsForProjectParams) (int64, error)

func (*Queries) CountControlPanelTOTPBackupCodesRemaining

func (q *Queries) CountControlPanelTOTPBackupCodesRemaining(ctx context.Context, controlPanelUserID int64) (int64, error)

func (*Queries) CountControlPanelUserConnections

func (q *Queries) CountControlPanelUserConnections(ctx context.Context, controlPanelUserID int64) (int64, error)

func (*Queries) CountControlPanelUsers

func (q *Queries) CountControlPanelUsers(ctx context.Context) (int64, error)

func (*Queries) CountControlPanelUsersForPlatformAdmin

func (q *Queries) CountControlPanelUsersForPlatformAdmin(ctx context.Context, emailFilter *string) (int64, error)

func (*Queries) CountEnabledPlatformAdmins

func (q *Queries) CountEnabledPlatformAdmins(ctx context.Context) (int64, error)

func (*Queries) CountMatchmakerMatchesByMode

func (q *Queries) CountMatchmakerMatchesByMode(ctx context.Context, projectID int64) ([]CountMatchmakerMatchesByModeRow, error)

Control panel matchmaker page: matches formed per mode within the retention window (rows are GC'd after MatchTTL, so this reads as "recent matches").

func (*Queries) CountOpenGameSessionsForProject

func (q *Queries) CountOpenGameSessionsForProject(ctx context.Context, projectID int64) (int64, error)

Counts non-ended, non-expired sessions for the project. Used in the create handler to enforce a per-project session cap.

func (*Queries) CountPendingGameInviteForSessionPlayer

func (q *Queries) CountPendingGameInviteForSessionPlayer(ctx context.Context, arg CountPendingGameInviteForSessionPlayerParams) (int64, error)

Whether an unexpired invite exists for (session, recipient) in the caller's tenant. Gates joining/resolving a private session by a non-member.

func (*Queries) CountPlayerAccountConnections

func (q *Queries) CountPlayerAccountConnections(ctx context.Context, playerAccountID pgtype.UUID) (int64, error)

func (*Queries) CountPlayerAccountTOTPBackupCodesRemaining

func (q *Queries) CountPlayerAccountTOTPBackupCodesRemaining(ctx context.Context, playerAccountID pgtype.UUID) (int64, error)

func (*Queries) CountPlayerLiveFleetAllocations

func (q *Queries) CountPlayerLiveFleetAllocations(ctx context.Context, playerID int64) (int64, error)

Unclaimed, unexpired fleet-allocation matches this player still holds. The per-player cap counts these at enqueue time so a player can't loop enqueue -> matched -> abandon to hoard dedicated servers until the 24h GC. Fleet matches carry no host, so the player is found via the roster.

func (*Queries) CountPlayersForProject

func (q *Queries) CountPlayersForProject(ctx context.Context, arg CountPlayersForProjectParams) (int64, error)

func (*Queries) CountProjectsForTenant

func (q *Queries) CountProjectsForTenant(ctx context.Context) (int64, error)

Live (non-soft-deleted) project count for the current tenant.

func (*Queries) CountQueuedTicketsLike

func (q *Queries) CountQueuedTicketsLike(ctx context.Context, arg CountQueuedTicketsLikeParams) (int64, error)

Queued, unclaimed, unexpired tickets in the same bucket as a ticket. Uses matchmaking_tickets_queued_idx.

func (*Queries) CountRecentGameSessionSignals

func (q *Queries) CountRecentGameSessionSignals(ctx context.Context, arg CountRecentGameSessionSignalsParams) (int64, error)

Signals this player has sent into this session in the trailing minute; the handler rejects once it reaches the per-minute cap.

func (*Queries) CreateAPIKey

func (q *Queries) CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) (CreateAPIKeyRow, error)

key_type is a security boundary (the token-route per-IP limiter exempts secret keys), so it is an explicit parameter — never the column default.

func (*Queries) CreateAnonymousPlayer

func (q *Queries) CreateAnonymousPlayer(ctx context.Context, arg CreateAnonymousPlayerParams) (CreateAnonymousPlayerRow, error)

func (*Queries) CreateControlPanelAPIKey

The caller passes the scopes; projectadmin.CreateAPIKey always includes matchmaker, a zero-config feature.

func (*Queries) CreateControlPanelInvitation

Control panel team invitations (operator-side: platform / tenant admins).

func (*Queries) CreateControlPanelMembership

func (q *Queries) CreateControlPanelMembership(ctx context.Context, arg CreateControlPanelMembershipParams) (int64, error)

func (*Queries) CreateControlPanelPasswordReset

func (q *Queries) CreateControlPanelPasswordReset(ctx context.Context, arg CreateControlPanelPasswordResetParams) error

func (*Queries) CreateControlPanelTrustedDevice

func (q *Queries) CreateControlPanelTrustedDevice(ctx context.Context, arg CreateControlPanelTrustedDeviceParams) error

func (*Queries) CreateControlPanelUser

func (q *Queries) CreateControlPanelUser(ctx context.Context, arg CreateControlPanelUserParams) (CreateControlPanelUserRow, error)

func (*Queries) CreateEmailPlayer

func (q *Queries) CreateEmailPlayer(ctx context.Context, arg CreateEmailPlayerParams) (int64, error)

func (*Queries) CreateFleet

func (q *Queries) CreateFleet(ctx context.Context, arg CreateFleetParams) (Fleet, error)

Fleet templates: operator-defined recipes that allocations are drawn from. Lookup is by project-scoped name (the public identifier used by the SDK, matchmaker API, and control panel URLs). Soft delete keeps historical allocations referenceable in the UI.

func (*Queries) CreateGameInvite

func (q *Queries) CreateGameInvite(ctx context.Context, arg CreateGameInviteParams) (int64, error)

func (*Queries) CreateGameSession

func (q *Queries) CreateGameSession(ctx context.Context, arg CreateGameSessionParams) (CreateGameSessionRow, error)

func (*Queries) CreateLeaderboard

func (q *Queries) CreateLeaderboard(ctx context.Context, arg CreateLeaderboardParams) (int64, error)

func (*Queries) CreateLinkedPlayer

func (q *Queries) CreateLinkedPlayer(ctx context.Context, arg CreateLinkedPlayerParams) (int64, error)

Tenant-scoped: creates a verified player already linked to a global account (public-join / invite-accept). The account's email ownership is already proven, so email_verified_at is set.

func (*Queries) CreateMCPToken

func (q *Queries) CreateMCPToken(ctx context.Context, arg CreateMCPTokenParams) (int64, error)

func (*Queries) CreatePendingAllocation

func (q *Queries) CreatePendingAllocation(ctx context.Context, arg CreatePendingAllocationParams) (CreatePendingAllocationRow, error)

func (*Queries) CreatePlayer

func (q *Queries) CreatePlayer(ctx context.Context, arg CreatePlayerParams) (CreatePlayerRow, error)

Used by the player UI signup flow; takes project_id explicitly because the player site doesn't have an api_key bearer.

func (*Queries) CreatePlayerAccount

func (q *Queries) CreatePlayerAccount(ctx context.Context, arg CreatePlayerAccountParams) (CreatePlayerAccountRow, error)

Global player accounts. Platform-global (no tenant RLS): every query here is run through db.Pool.BootstrapQ. Creates an unverified account with its first verification code inlined (mirrors CreatePlayer). Fails on the UNIQUE email constraint if an account already exists.

func (*Queries) CreatePlayerAccountPasswordReset

func (q *Queries) CreatePlayerAccountPasswordReset(ctx context.Context, arg CreatePlayerAccountPasswordResetParams) error

func (*Queries) CreatePlayerAccountSession

func (q *Queries) CreatePlayerAccountSession(ctx context.Context, arg CreatePlayerAccountSessionParams) (int64, error)

func (*Queries) CreatePlayerAccountTrustedDevice

func (q *Queries) CreatePlayerAccountTrustedDevice(ctx context.Context, arg CreatePlayerAccountTrustedDeviceParams) error

func (*Queries) CreatePlayerInvitation

func (q *Queries) CreatePlayerInvitation(ctx context.Context, arg CreatePlayerInvitationParams) (CreatePlayerInvitationRow, error)

Player invitations. project_player_id is set only for admin "link player" invites, which bind the proven email onto that existing row on accept; NULL keeps find-or-create-by-email.

func (*Queries) CreatePlayerSession

func (q *Queries) CreatePlayerSession(ctx context.Context, arg CreatePlayerSessionParams) (int64, error)

func (*Queries) CreateProjectForTenant

func (q *Queries) CreateProjectForTenant(ctx context.Context, name string) (CreateProjectForTenantRow, error)

func (*Queries) CreateRealtimeTicket

func (q *Queries) CreateRealtimeTicket(ctx context.Context, arg CreateRealtimeTicketParams) error

func (*Queries) CreateRelayNode

func (q *Queries) CreateRelayNode(ctx context.Context, arg CreateRelayNodeParams) (RelayNode, error)

func (*Queries) CreateSession

func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (CreateSessionRow, error)

func (*Queries) CreateTenantChangeRequest

func (q *Queries) CreateTenantChangeRequest(ctx context.Context, arg CreateTenantChangeRequestParams) (int64, error)

Submit a tenant change request. The pending-unique index rejects a second open request of the same kind/feature (surfaced as a friendly message).

func (*Queries) CreateTenantPlayerBan

func (q *Queries) CreateTenantPlayerBan(ctx context.Context, arg CreateTenantPlayerBanParams) error

Tenant-wide player bans. tenant_player_bans has no RLS, so every query filters tenant_id explicitly. Enforcement runs in both tenant Pool.Q and account BootstrapQ contexts.

func (*Queries) CreateVerifiedControlPanelUser

Used by invite acceptance: creates a new user who is verified by definition (they had to click the invite link in their inbox).

func (*Queries) CreateVerifiedPlayerAccount

func (q *Queries) CreateVerifiedPlayerAccount(ctx context.Context, arg CreateVerifiedPlayerAccountParams) (pgtype.UUID, error)

Creates an already-verified account (used by invite acceptance, where the magic link delivered to the invited inbox proves email ownership).

func (*Queries) DeleteAllGameSessionPeers

func (q *Queries) DeleteAllGameSessionPeers(ctx context.Context, sessionID string) error

Used when the host ends the session so peer rows don't linger until GC.

func (*Queries) DeleteClosedParties

func (q *Queries) DeleteClosedParties(ctx context.Context, retention pgtype.Interval) (int64, error)

Invite rows cascade only after all roster and matchmaking references are gone.

func (*Queries) DeleteConnectionLimitOverride

func (q *Queries) DeleteConnectionLimitOverride(ctx context.Context, tenantID int64) (int64, error)

func (*Queries) DeleteControlPanelMembership

func (q *Queries) DeleteControlPanelMembership(ctx context.Context, arg DeleteControlPanelMembershipParams) error

func (*Queries) DeleteControlPanelMembershipUnlessSelf

func (q *Queries) DeleteControlPanelMembershipUnlessSelf(ctx context.Context, arg DeleteControlPanelMembershipUnlessSelfParams) (int64, error)

Removes a membership row but refuses to delete the actor's own row. The previous approach loaded every member to do this check client-side; this predicate folds it into one statement.

func (*Queries) DeleteControlPanelTOTP

func (q *Queries) DeleteControlPanelTOTP(ctx context.Context, controlPanelUserID int64) error

Backup codes cascade with the credential row.

func (*Queries) DeleteControlPanelTOTPBackupCodes

func (q *Queries) DeleteControlPanelTOTPBackupCodes(ctx context.Context, controlPanelUserID int64) error

func (*Queries) DeleteControlPanelTrustedDevicesForUser

func (q *Queries) DeleteControlPanelTrustedDevicesForUser(ctx context.Context, controlPanelUserID int64) error

func (*Queries) DeleteControlPanelUserConnection

func (q *Queries) DeleteControlPanelUserConnection(ctx context.Context, arg DeleteControlPanelUserConnectionParams) (int64, error)

func (*Queries) DeleteExpiredControlPanelPasswordResets

func (q *Queries) DeleteExpiredControlPanelPasswordResets(ctx context.Context) (int64, error)

Retention sweep (password_reset_gc): rows are inert once expired — every lookup filters expires_at — so deleting them a day later is pure hygiene.

func (*Queries) DeleteExpiredControlPanelTrustedDevices

func (q *Queries) DeleteExpiredControlPanelTrustedDevices(ctx context.Context) (int64, error)

func (*Queries) DeleteExpiredGameInvitesForTenant

func (q *Queries) DeleteExpiredGameInvitesForTenant(ctx context.Context) (int64, error)

Removes invites past their expiry for the current tenant. Called per tenant by the GC goroutine.

func (*Queries) DeleteExpiredGameSessionSignalsForTenant

func (q *Queries) DeleteExpiredGameSessionSignalsForTenant(ctx context.Context) (int64, error)

Removes signals past their two-minute expiry for the current tenant. Called per tenant by the game-session GC sweep so long-lived sessions don't accumulate expired rows (session/tenant deletion already cascades the rest).

func (*Queries) DeleteExpiredGameSessionsForTenant

func (q *Queries) DeleteExpiredGameSessionsForTenant(ctx context.Context) (int64, error)

Removes sessions past their expiry for the current tenant. Called once per tenant by the GC goroutine.

func (*Queries) DeleteExpiredMatchmakerMatches

func (q *Queries) DeleteExpiredMatchmakerMatches(ctx context.Context) (int64, error)

Drop expired matches that do not need allocation cleanup. Unclaimed fleet matches stay until the backend deallocation above succeeds.

func (*Queries) DeleteExpiredPlayerAccountPasswordResets

func (q *Queries) DeleteExpiredPlayerAccountPasswordResets(ctx context.Context) (int64, error)

Retention sweep (password_reset_gc): rows are inert once expired — every lookup filters expires_at — so deleting them a day later is pure hygiene.

func (*Queries) DeleteExpiredPlayerAccountTrustedDevices

func (q *Queries) DeleteExpiredPlayerAccountTrustedDevices(ctx context.Context) (int64, error)

func (*Queries) DeleteExpiredRealtimeTickets

func (q *Queries) DeleteExpiredRealtimeTickets(ctx context.Context) (int64, error)

func (*Queries) DeleteExpiredTenantSignupApprovals

func (q *Queries) DeleteExpiredTenantSignupApprovals(ctx context.Context) (int64, error)

An expired approval can never be accepted, so it must not hold its tenant name or its email slot. The person can apply again. The audit log keeps the approval.

func (*Queries) DeleteExpiredUnclaimedMatchmakerMatch

func (q *Queries) DeleteExpiredUnclaimedMatchmakerMatch(ctx context.Context, id string) (int64, error)

Delete only after its allocation has been successfully deallocated. The guards make retries and a concurrent cleanup safe.

func (*Queries) DeleteFriendEdgeByAccount

func (q *Queries) DeleteFriendEdgeByAccount(ctx context.Context, arg DeleteFriendEdgeByAccountParams) (int64, error)

Symmetric unfriend: caller can be on either side. Never removes a 'blocked' edge — a block is cleared only via the directed unblock path (DeleteFriendEdgeDirected), so a blockee cannot delete the blocker's block.

func (*Queries) DeleteFriendEdgeDirected

func (q *Queries) DeleteFriendEdgeDirected(ctx context.Context, arg DeleteFriendEdgeDirectedParams) (int64, error)

Directed delete (unblock: only remove the edge the caller initiated).

func (*Queries) DeleteGameInvite

func (q *Queries) DeleteGameInvite(ctx context.Context, arg DeleteGameInviteParams) (int64, error)

Either sender (cancel) or recipient (decline/dismiss) may delete an invite.

func (*Queries) DeleteGameSession

func (q *Queries) DeleteGameSession(ctx context.Context, id string) error

func (*Queries) DeleteGameSessionPeer

func (q *Queries) DeleteGameSessionPeer(ctx context.Context, arg DeleteGameSessionPeerParams) error

func (*Queries) DeletePlayerAccountConnection

func (q *Queries) DeletePlayerAccountConnection(ctx context.Context, arg DeletePlayerAccountConnectionParams) (int64, error)

func (*Queries) DeletePlayerAccountTOTP

func (q *Queries) DeletePlayerAccountTOTP(ctx context.Context, playerAccountID pgtype.UUID) error

func (*Queries) DeletePlayerAccountTOTPBackupCodes

func (q *Queries) DeletePlayerAccountTOTPBackupCodes(ctx context.Context, playerAccountID pgtype.UUID) error

func (*Queries) DeletePlayerAccountTrustedDevicesForAccount

func (q *Queries) DeletePlayerAccountTrustedDevicesForAccount(ctx context.Context, playerAccountID pgtype.UUID) error

func (*Queries) DeletePlayerGameSessionSignals

func (q *Queries) DeletePlayerGameSessionSignals(ctx context.Context, ids []int64) error

from/to player columns carry no foreign keys, and signals in a surviving session outlive the player-row cascade. Remove every signal the purged players sent or were addressed by, so no player IDs or SDP payloads remain after the purge (the 2-minute TTL GC is not guaranteed to have run).

func (*Queries) DeleteQuotaOverride

func (q *Queries) DeleteQuotaOverride(ctx context.Context, arg DeleteQuotaOverrideParams) error

Clear one axis override so the class ladder applies again.

func (*Queries) DeleteRateLimitOverride

func (q *Queries) DeleteRateLimitOverride(ctx context.Context, arg DeleteRateLimitOverrideParams) error

func (*Queries) DeleteTenantPlayerBan

func (q *Queries) DeleteTenantPlayerBan(ctx context.Context, arg DeleteTenantPlayerBanParams) (int64, error)

func (*Queries) DeleteTerminalMatchmakerTickets

func (q *Queries) DeleteTerminalMatchmakerTickets(ctx context.Context, retention pgtype.Interval) (int64, error)

GC (River job, leader-elected): drop matched/cancelled/failed tickets older than the retention interval. Privileged — runs without a tenant GUC. Anchored on when the ticket became terminal (matched_at for matched tickets, created_at otherwise) so a matched ticket isn't purged before its paired match row's retention window — otherwise a poll would 404 while the match is still recoverable.

func (*Queries) DeleteTerminalMatchmakingEntries

func (q *Queries) DeleteTerminalMatchmakingEntries(ctx context.Context, retention pgtype.Interval) (int64, error)

Keep entries while a retained ticket or current party still references them.

func (*Queries) DeleteUnclaimedMatchmakerMatch

func (q *Queries) DeleteUnclaimedMatchmakerMatch(ctx context.Context, id string) (int64, error)

Drop a match whose tickets never committed, once its backend server has been released. Same guards as the GC delete above minus the expiry, because this runs immediately rather than waiting out the match TTL: until the row is gone it still counts against the player's live-allocation cap.

func (*Queries) DenyTenantChangeRequest

func (q *Queries) DenyTenantChangeRequest(ctx context.Context, arg DenyTenantChangeRequestParams) (int64, error)

func (*Queries) DenyTenantSignupRequest

func (q *Queries) DenyTenantSignupRequest(ctx context.Context, arg DenyTenantSignupRequestParams) (int64, error)

func (*Queries) DisableTenantByPlatformAdmin

func (q *Queries) DisableTenantByPlatformAdmin(ctx context.Context, id int64) (int64, error)

A platform disable supersedes an existing self-disable: it promotes disabled_by to 'platform' in place, with no re-enable window. The original disabled_at is kept. 0 rows only when already platform-disabled or gone.

func (*Queries) DisableTenantBySelf

func (q *Queries) DisableTenantBySelf(ctx context.Context, id int64) (int64, error)

Tenant self-disable; 0 rows means already disabled or gone.

func (*Queries) DisableTenantFeatureGrant

func (q *Queries) DisableTenantFeatureGrant(ctx context.Context, arg DisableTenantFeatureGrantParams) (int64, error)

Declarative entitlement apply: switch a tenant-level grant off in place so the row survives (audit trail, later re-enable). Runs in tenant RLS context.

func (*Queries) EnableTenantByPlatformAdmin

func (q *Queries) EnableTenantByPlatformAdmin(ctx context.Context, id int64) (int64, error)

func (*Queries) EnableTenantByTenantAdmin

func (q *Queries) EnableTenantByTenantAdmin(ctx context.Context, id int64) (int64, error)

A tenant admin can only undo a self-disable; 0 rows on a platform disable.

func (*Queries) ExpireMatchmakerTickets

func (q *Queries) ExpireMatchmakerTickets(ctx context.Context) (int64, error)

TTL enforcement: unclaimed queued tickets past expires_at flip to 'failed' with the structured reason 'expired'. Claimed tickets are left alone — the claim path settles them.

func (*Queries) ExpirePlayerQueuedTicket

func (q *Queries) ExpirePlayerQueuedTicket(ctx context.Context, arg ExpirePlayerQueuedTicketParams) (int64, error)

TTL-expire this player's stale queued ticket ahead of a re-enqueue. An expired-but-unswept ticket still occupies the one-active unique index (the index predicate can't be time-aware), so without this the player is locked out of re-queuing until the periodic sweeper runs. Mirrors ExpireMatchmakerTickets but scoped to the one player; claimed tickets are left for the claim path to settle.

func (*Queries) ExtendGameSessionExpiry

func (q *Queries) ExtendGameSessionExpiry(ctx context.Context, arg ExtendGameSessionExpiryParams) error

Pushes a session's expiry out to the given time when that is later. The join handler uses it to promote a short-lived pending matchmade session to its full lifetime once a player actually joins.

func (*Queries) ExtendGameSessionExpiryOnHeartbeat

func (q *Queries) ExtendGameSessionExpiryOnHeartbeat(ctx context.Context, arg ExtendGameSessionExpiryOnHeartbeatParams) (int64, error)

Sliding-window extension for member heartbeats: push the expiry out only when less than the threshold remains, so steady heartbeats don't rewrite the row every few seconds (self-gating, single statement — deliberately NOT the greatest-wins ExtendGameSessionExpiry, which writes on every call). Never revives an ended or already-expired session.

func (*Queries) FindAccountIDByEmail

func (q *Queries) FindAccountIDByEmail(ctx context.Context, email string) (pgtype.UUID, error)

func (*Queries) FindAccountIDsByDisplayName

func (q *Queries) FindAccountIDsByDisplayName(ctx context.Context, displayName *string) ([]FindAccountIDsByDisplayNameRow, error)

Exact display-name match. LIMIT 2 lets the caller detect ambiguity (display names are not unique) and refuse rather than friend the wrong person.

func (*Queries) FindVerifiedAccountIDByEmail

func (q *Queries) FindVerifiedAccountIDByEmail(ctx context.Context, email string) (pgtype.UUID, error)

func (*Queries) GetAPIKeyByHash

func (q *Queries) GetAPIKeyByHash(ctx context.Context, keyHash []byte) (GetAPIKeyByHashRow, error)

Bootstrap query used by the tenant middleware to resolve a Bearer token to its tenant_id + project_id + tenant tier + key_type + optional realtime connection envelope. Resolving them in one authoritative query prevents a second per-process cache from admitting against a stale raised or lowered envelope. Runs without an app.tenant_id GUC set; the api_keys_bootstrap policy in 0010 lets it through. Note: this query does NOT filter by tenants table RLS because tenants.id = current_setting GUC is unset at bootstrap; if/when we add a bootstrap policy on tenants, the JOIN keeps working.

func (*Queries) GetAPIKeyScopes

func (q *Queries) GetAPIKeyScopes(ctx context.Context, id int64) (GetAPIKeyScopesRow, error)

func (*Queries) GetAPIKeyType

func (q *Queries) GetAPIKeyType(ctx context.Context, id int64) (string, error)

func (*Queries) GetAPIRateLimitOverride

func (q *Queries) GetAPIRateLimitOverride(ctx context.Context, tenantID int64) (GetAPIRateLimitOverrideRow, error)

Tenant-level HTTP API override (project_id NULL, kind 'api'). Read by the rate-limit middleware; falls back to compiled tier defaults when absent.

func (*Queries) GetAllocation

func (q *Queries) GetAllocation(ctx context.Context, id int64) (GetAllocationRow, error)

func (*Queries) GetAllowedOrigins

func (q *Queries) GetAllowedOrigins(ctx context.Context, projectID int64) ([]string, error)

func (*Queries) GetAllowedOriginsForUpdate

func (q *Queries) GetAllowedOriginsForUpdate(ctx context.Context, projectID int64) ([]string, error)

func (*Queries) GetConnectionLimitOverride

func (q *Queries) GetConnectionLimitOverride(ctx context.Context, tenantID int64) (GetConnectionLimitOverrideRow, error)

Tenant-level realtime admission envelope. The WebSocket admission path falls back to compiled tier defaults when no row exists.

func (*Queries) GetControlPanelInvitationByCodeHash

func (q *Queries) GetControlPanelInvitationByCodeHash(ctx context.Context, codeHash []byte) (GetControlPanelInvitationByCodeHashRow, error)

func (*Queries) GetControlPanelInvitationByID

func (q *Queries) GetControlPanelInvitationByID(ctx context.Context, id int64) (GetControlPanelInvitationByIDRow, error)

func (*Queries) GetControlPanelSessionByRefreshHash

func (q *Queries) GetControlPanelSessionByRefreshHash(ctx context.Context, refreshHash []byte) (GetControlPanelSessionByRefreshHashRow, error)

Joined to control_panel_users so the session dies as soon as a platform admin sets disabled_at, without needing a separate session-purge step on every request path. requireSession maps ErrNoRows to a redirect to /login, which is what we want for disabled accounts.

func (*Queries) GetControlPanelTOTP

func (q *Queries) GetControlPanelTOTP(ctx context.Context, controlPanelUserID int64) (GetControlPanelTOTPRow, error)

func (*Queries) GetControlPanelTrustedDevice

func (q *Queries) GetControlPanelTrustedDevice(ctx context.Context, arg GetControlPanelTrustedDeviceParams) (int64, error)

Keyed by user AND token so a token minted for one account can never satisfy another's challenge.

func (*Queries) GetControlPanelUserAnyStatusByEmail

func (q *Queries) GetControlPanelUserAnyStatusByEmail(ctx context.Context, email string) (GetControlPanelUserAnyStatusByEmailRow, error)

Status-blind variant used ONLY by the invite-accept code path so we can distinguish "no row" (truly new email — create user) from "row exists but disabled" (refuse with errInviteForDisabledAccount). DO NOT use this for authentication.

func (*Queries) GetControlPanelUserByConnection

Status-blind like GetControlPanelUserAnyStatusByEmail: the caller refuses a disabled user with the same answer as an unknown connection.

func (*Queries) GetControlPanelUserByEmail

func (q *Queries) GetControlPanelUserByEmail(ctx context.Context, email string) (GetControlPanelUserByEmailRow, error)

Disabled accounts (disabled_at IS NOT NULL) are filtered out here so /v1/control-panel/login behaves identically to an unknown email — same dummy bcrypt + invalid_credentials response.

func (*Queries) GetControlPanelUserByID

func (q *Queries) GetControlPanelUserByID(ctx context.Context, id int64) (GetControlPanelUserByIDRow, error)

func (*Queries) GetControlPanelUserVerificationState

func (q *Queries) GetControlPanelUserVerificationState(ctx context.Context, id int64) (GetControlPanelUserVerificationStateRow, error)

func (*Queries) GetFleetByID

func (q *Queries) GetFleetByID(ctx context.Context, id int64) (Fleet, error)

func (*Queries) GetFleetByName

func (q *Queries) GetFleetByName(ctx context.Context, arg GetFleetByNameParams) (Fleet, error)

Resolves a project-scoped name to a fleet row. Soft-deleted rows are excluded so a retired fleet doesn't collide with a freshly created one under the same name.

func (*Queries) GetFriendEdgeByAccount

func (q *Queries) GetFriendEdgeByAccount(ctx context.Context, arg GetFriendEdgeByAccountParams) (GetFriendEdgeByAccountRow, error)

func (*Queries) GetGameSession

func (q *Queries) GetGameSession(ctx context.Context, arg GetGameSessionParams) (GetGameSessionRow, error)

Scoped by project as well as tenant: the caller's key is project-pinned, so a player in project A must not read a session belonging to project B of the same tenant (which would leak peers' public IP:port across projects).

func (*Queries) GetGameSessionByJoinCode

Open, unexpired sessions only — an expired session lingering before GC must not be resolvable by join code. Returns private + host so the handler can withhold a private session from a non-member/non-invitee. Project-scoped so a join code can't resolve a session in another project of the same tenant.

func (*Queries) GetGameSessionForUpdate

func (q *Queries) GetGameSessionForUpdate(ctx context.Context, arg GetGameSessionForUpdateParams) (GetGameSessionForUpdateRow, error)

Row-locking variant used by the join handler so concurrent joins for the same session serialize on the session row and max_players is enforced without a TOCTOU race. Project-scoped (see GetGameSession).

func (*Queries) GetInviteRateLimitOverride

Most-specific-wins: a project-scoped row overrides a tenant-wide row for the same kind. Used by the invite throttle.

func (*Queries) GetLeaderboard

func (q *Queries) GetLeaderboard(ctx context.Context, arg GetLeaderboardParams) (GetLeaderboardRow, error)

Leaderboard entries hold ONE row per (leaderboard, player, period). The board's score operator is applied at write time by the SubmitScore upsert, so every read is a plain ORDER BY score. Scheduled boards bump leaderboards.current_period on reset; old entries stay in place under their period number.

func (*Queries) GetLeaderboardForSubmit

func (q *Queries) GetLeaderboardForSubmit(ctx context.Context, arg GetLeaderboardForSubmitParams) (GetLeaderboardForSubmitRow, error)

The submit-path twin of GetLeaderboard. FOR KEY SHARE conflicts with the reset job's FOR UPDATE (ListDueLeaderboardResets), so a submission blocks on an in-flight reset and re-reads the advanced period instead of writing into the just-archived one. Concurrent submissions do not block each other.

func (*Queries) GetLeaderboardForUpdate

func (q *Queries) GetLeaderboardForUpdate(ctx context.Context, arg GetLeaderboardForUpdateParams) (GetLeaderboardForUpdateRow, error)

Locks the board so concurrent writers take revision numbers in order.

func (*Queries) GetMCPTokenByHash

func (q *Queries) GetMCPTokenByHash(ctx context.Context, tokenHash []byte) (GetMCPTokenByHashRow, error)

Runs with no tenant set (mcp_tokens_bootstrap and tenants_bootstrap allow it). projects has no bootstrap policy, so the project check is a second query in the tenant scope.

func (*Queries) GetMCPTokenCreator

func (q *Queries) GetMCPTokenCreator(ctx context.Context, arg GetMCPTokenCreatorParams) (int64, error)

func (*Queries) GetMatchmakerMatch

func (q *Queries) GetMatchmakerMatch(ctx context.Context, id string) (MatchmakerMatch, error)

func (*Queries) GetMatchmakingTicket

func (q *Queries) GetMatchmakingTicket(ctx context.Context, arg GetMatchmakingTicketParams) (GetMatchmakingTicketRow, error)

func (*Queries) GetMatchmakingTicketForTrace

Diagnostic read by primary key, scoped to one project.

func (*Queries) GetPlayerAccountByConnection

Single sign-on connections. Both tables are platform-global (no tenant RLS): every query here runs through db.Pool.BootstrapQ. The subject always comes from a verified provider round trip, never from client input.

func (*Queries) GetPlayerAccountByEmail

func (q *Queries) GetPlayerAccountByEmail(ctx context.Context, email string) (GetPlayerAccountByEmailRow, error)

func (*Queries) GetPlayerAccountByID

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

func (*Queries) GetPlayerAccountForProjectRead

func (q *Queries) GetPlayerAccountForProjectRead(ctx context.Context, arg GetPlayerAccountForProjectReadParams) (pgtype.UUID, error)

Tenant-scoped: resolve a player (in a project the caller's secret key is pinned to) to its linked account id, for the server-side remote-address read path. NULL account => unlinked player, no address.

func (*Queries) GetPlayerAccountRemoteAddrs

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

func (*Queries) GetPlayerAccountSession

func (q *Queries) GetPlayerAccountSession(ctx context.Context, refreshHash []byte) (GetPlayerAccountSessionRow, error)

Session lookup joins the account so the caller can enforce epoch match and the disabled gate in one round-trip.

func (*Queries) GetPlayerAccountTOTP

func (q *Queries) GetPlayerAccountTOTP(ctx context.Context, playerAccountID pgtype.UUID) (GetPlayerAccountTOTPRow, error)

func (*Queries) GetPlayerAccountTrustedDevice

func (q *Queries) GetPlayerAccountTrustedDevice(ctx context.Context, arg GetPlayerAccountTrustedDeviceParams) (int64, error)

func (*Queries) GetPlayerAccountVerificationState

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

func (*Queries) GetPlayerAuthCredentials

func (q *Queries) GetPlayerAuthCredentials(ctx context.Context, id int64) (GetPlayerAuthCredentialsRow, error)

Change-password / self-disable state read for the authenticated caller.

func (*Queries) GetPlayerByEmail

func (q *Queries) GetPlayerByEmail(ctx context.Context, arg GetPlayerByEmailParams) (GetPlayerByEmailRow, error)

Disabled accounts (disabled_at IS NOT NULL) are filtered out here so /v1/auth/login behaves identically to an unknown email — same dummy bcrypt + invalid_credentials response. Same for players who unlinked themselves from the project (unlinked_at): blocked until re-invited.

func (*Queries) GetPlayerByEmailProject

func (q *Queries) GetPlayerByEmailProject(ctx context.Context, arg GetPlayerByEmailProjectParams) (GetPlayerByEmailProjectRow, error)

Privileged variant of GetPlayerByEmail used by the player UI before the tenant context is set; the caller already knows the project_id from the URL and looks up tenant + verification state in one shot.

func (*Queries) GetPlayerByExternalID

func (q *Queries) GetPlayerByExternalID(ctx context.Context, arg GetPlayerByExternalIDParams) (GetPlayerByExternalIDRow, error)

func (*Queries) GetPlayerDeleteRequestedByAccount

func (q *Queries) GetPlayerDeleteRequestedByAccount(ctx context.Context, arg GetPlayerDeleteRequestedByAccountParams) (pgtype.Timestamptz, error)

Race repair for the idempotent portal request: when the guarded UPDATE matched no rows because another surface scheduled the deletion first, this reads the timestamp that request stored.

func (q *Queries) GetPlayerForAccountLink(ctx context.Context, arg GetPlayerForAccountLinkParams) (GetPlayerForAccountLinkRow, error)

Tenant-scoped: finds an existing (possibly unlinked) player by project + email so a public-join / invite can link it instead of creating a duplicate.

func (*Queries) GetPlayerForProject

func (q *Queries) GetPlayerForProject(ctx context.Context, arg GetPlayerForProjectParams) (GetPlayerForProjectRow, error)

Enriched with the linked global account: remote addresses (project admins may read them; publishable keys never) and tenant-ban status. player_accounts and tenant_player_bans are global (no RLS), so the LEFT JOINs resolve under the tenant Pool.Q used by the control panel.

func (*Queries) GetPlayerForVerify

func (q *Queries) GetPlayerForVerify(ctx context.Context, id int64) (GetPlayerForVerifyRow, error)

Lookup a player by ID for the POST /v1/server/player-sessions/verify endpoint (gameserver session-token verification). Filters deleted/disabled accounts so a forged token claiming a stale id rejects with 401. The explicit tenant_id predicate matches the project's RLS-via-GUC convention (Pool.Q sets app.tenant_id) and survives a hypothetical RLS disable; the JOINs against tenants/projects enforce the soft-delete kill-switch — a wound-down project can't continue to verify sessions.

func (*Queries) GetPlayerIDByEmail

func (q *Queries) GetPlayerIDByEmail(ctx context.Context, arg GetPlayerIDByEmailParams) (int64, error)

Resolves an invite recipient by email within the caller's project.

func (*Queries) GetPlayerInvitationByCodeHash

func (q *Queries) GetPlayerInvitationByCodeHash(ctx context.Context, codeHash []byte) (GetPlayerInvitationByCodeHashRow, error)

func (*Queries) GetPlayerLinkedAccountID

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

Tenant-scoped: the global account a player is linked to (NULL if the player is anonymous / unlinked).

func (*Queries) GetPlayerModerationState

Server-tier gate: does the named player exist in the caller's project, and may a game server act for them? The tenants/projects JOINs mirror GetPlayerForVerify so a wound-down project can't keep taking writes.

func (*Queries) GetPlayerPasswordResetState

Reset-request/confirm state read, keyed like login. Filters mirror GetPlayerByEmail: disabled/unlinked players read as unknown.

func (*Queries) GetPlayerPendingDeleteByEmail

Credential lookup for the pre-session delete-cancel endpoint: the request revoked every session and login filters disabled players, so cancel re-authenticates with email + password against the pending row directly.

func (*Queries) GetPlayerSession

func (q *Queries) GetPlayerSession(ctx context.Context, refreshHash []byte) (GetPlayerSessionRow, error)

func (*Queries) GetPlayerSessionEpoch

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

PK lookup used at token issuance to snapshot the current epoch into the JWT.

func (*Queries) GetPlayerVerificationStateByID

func (q *Queries) GetPlayerVerificationStateByID(ctx context.Context, id int64) (GetPlayerVerificationStateByIDRow, error)

func (*Queries) GetPresence

func (q *Queries) GetPresence(ctx context.Context, playerID int64) (GetPresenceRow, error)

func (*Queries) GetProfile

func (q *Queries) GetProfile(ctx context.Context, id int64) (GetProfileRow, error)

display_name lives on the linked global account; NULL for anonymous / unlinked players.

func (*Queries) GetProfileEmailState

func (q *Queries) GetProfileEmailState(ctx context.Context, id int64) (GetProfileEmailStateRow, error)

Feeds the PATCH /v1/profile email guard: is the address changing, is it already verified, and when did the last code go out (resend cooldown).

func (*Queries) GetProjectSteamAuthConfig

func (q *Queries) GetProjectSteamAuthConfig(ctx context.Context, projectID int64) (GetProjectSteamAuthConfigRow, error)

Runtime read for the Steam sign-in endpoint, tenant-scoped via RLS GUC.

func (*Queries) GetProjectSteamAuthConfigForControlPanel

Control-panel read: reports whether a key is stored, never its value.

func (*Queries) GetProjectTenant

func (q *Queries) GetProjectTenant(ctx context.Context, id int64) (GetProjectTenantRow, error)

Project → tenant lookup (privileged; used by the player UI which knows the project from the URL but has no tenant context yet).

func (*Queries) GetPublicPlayer

func (q *Queries) GetPublicPlayer(ctx context.Context, arg GetPublicPlayerParams) (GetPublicPlayerRow, error)

Public player lookup. Project-scoped: an id from a sibling project resolves to no rows (the handler 404s). Only public fields are selected — never the account email.

func (*Queries) GetPublicPlayerByFriendCode

Friend-code resolve: same public shape and project scoping as GetPublicPlayer. Disabled (including pending-delete) players and a block in either direction with the caller look the same as an unknown code.

func (*Queries) GetPublicSignupEnabled

func (q *Queries) GetPublicSignupEnabled(ctx context.Context) (bool, error)

func (*Queries) GetQueuedTicketForPlayer

func (q *Queries) GetQueuedTicketForPlayer(ctx context.Context, arg GetQueuedTicketForPlayerParams) (int64, error)

The player's current queued ticket in the project, if any. Used to surface the active ticket id in the 409 when a second create hits the one-active unique index.

func (*Queries) GetRelaySessionUsage

func (q *Queries) GetRelaySessionUsage(ctx context.Context, month pgtype.Date) (int64, error)

func (*Queries) GetRemoteConfig

func (q *Queries) GetRemoteConfig(ctx context.Context, projectID int64) ([]byte, error)

func (*Queries) GetRemoteConfigForControlPanel

func (q *Queries) GetRemoteConfigForControlPanel(ctx context.Context, arg GetRemoteConfigForControlPanelParams) ([]byte, error)

func (*Queries) GetRemoteConfigForUpdate

func (q *Queries) GetRemoteConfigForUpdate(ctx context.Context, projectID int64) ([]byte, error)

Locks the project row so concurrent writers take revision numbers in order.

func (*Queries) GetServerSecret

func (q *Queries) GetServerSecret(ctx context.Context, name string) ([]byte, error)

func (*Queries) GetSessionByRefreshHash

func (q *Queries) GetSessionByRefreshHash(ctx context.Context, arg GetSessionByRefreshHashParams) (GetSessionByRefreshHashRow, error)

Joined to project_players so refresh fails for disabled / deleted accounts even if the refresh token is still otherwise valid. revoked_reason lets the refresh handler tell a replayed *rotated* token (theft) from a logged-out one.

func (*Queries) GetSettingsRevision

func (q *Queries) GetSettingsRevision(ctx context.Context, arg GetSettingsRevisionParams) ([]byte, error)

func (*Queries) GetStorageObject

func (q *Queries) GetStorageObject(ctx context.Context, arg GetStorageObjectParams) (GetStorageObjectRow, error)

func (*Queries) GetTenantChangeRequestByID

func (q *Queries) GetTenantChangeRequestByID(ctx context.Context, id int64) (GetTenantChangeRequestByIDRow, error)

func (*Queries) GetTenantCustomTokenPublicKey

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

func (*Queries) GetTenantCustomTokenPublicKeyForControlPanel

func (q *Queries) GetTenantCustomTokenPublicKeyForControlPanel(ctx context.Context, tenantID int64) (string, error)

func (*Queries) GetTenantDisabledState

func (q *Queries) GetTenantDisabledState(ctx context.Context, id int64) (GetTenantDisabledStateRow, error)

Lean per-request probe used by the control panel's tenant-access gate: a platform-disabled tenant locks its tenant admins out.

func (*Queries) GetTenantFacts

func (q *Queries) GetTenantFacts(ctx context.Context, id int64) (GetTenantFactsRow, error)

func (*Queries) GetTenantQuotaContext

func (q *Queries) GetTenantQuotaContext(ctx context.Context) (GetTenantQuotaContextRow, error)

Lock-free snapshot of the current tenant's class, enforcement flag, registered-player count, and quota overrides (axis→limit jsonb; NULL when none). Read inside an RLS-scoped tx (app.tenant_id set) before a quota-gated growth operation. Deliberately NOT FOR UPDATE: the authoritative player gate is ReserveTenantPlayerSlot, so this read must never serialize concurrent creates on the tenant row.

func (*Queries) GetTenantQuotaContextLocked

func (q *Queries) GetTenantQuotaContextLocked(ctx context.Context) (GetTenantQuotaContextLockedRow, error)

FOR UPDATE variant for rare growth paths (project create, storage writes) whose check-then-apply exactness relies on tenant-row serialization. Never use it on the player-create path — that gate is ReserveTenantPlayerSlot, and the whole point of the split is that creates don't serialize.

func (*Queries) GetTenantSignupRequestByCodeHash

func (q *Queries) GetTenantSignupRequestByCodeHash(ctx context.Context, codeHash []byte) (GetTenantSignupRequestByCodeHashRow, error)

Acceptance lookup: only an approved request with a live code is acceptable.

func (*Queries) GetTenantSignupRequestByID

func (q *Queries) GetTenantSignupRequestByID(ctx context.Context, id int64) (GetTenantSignupRequestByIDRow, error)

func (*Queries) GetTenantStorageUsageByID

func (q *Queries) GetTenantStorageUsageByID(ctx context.Context, tenantID int64) (int64, error)

Metered storage total for a tenant by id (0 if never written). Read in a bootstrap tx by the control-panel settings page for the used/limit display.

func (*Queries) GetTenantTier

func (q *Queries) GetTenantTier(ctx context.Context, id int64) (int16, error)

The tenant's billing tier, used to show the correct compiled default on the rate-limits page (enforcement keys off the same tier via the API key).

func (*Queries) HardDeletePlayers

func (q *Queries) HardDeletePlayers(ctx context.Context, ids []int64) (int64, error)

The point of no return: FK cascades remove sessions, presence, leaderboard entries, storage objects, matchmaking tickets, invites, and hosted game sessions; audit_log rows survive with actor_user_id set NULL.

func (*Queries) IncrementControlPanelVerificationAttempts

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

func (*Queries) IncrementPlayerVerificationAttempts

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

func (*Queries) IncrementPlayerVerificationAttemptsByID

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

func (*Queries) IncrementRelaySessions

func (q *Queries) IncrementRelaySessions(ctx context.Context, arg IncrementRelaySessionsParams) (int64, error)

Counts one managed-relay credential issuance for the tenant month. The allowance check and the increment are one atomic statement: past the allowance the conflict-update WHERE fails and no row returns (refuse new issuance). A negative allowance means unmetered. Runs in tenant RLS context.

func (*Queries) InsertAllocationEvent

func (q *Queries) InsertAllocationEvent(ctx context.Context, arg InsertAllocationEventParams) error

Append an event for the watch stream. The trim trigger keeps history bounded per allocation_id; callers can fire-and-forget.

func (*Queries) InsertControlPanelTOTPBackupCodes

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

Bulk-inserts a fresh backup-code set in one round-trip (pgx COPY).

func (*Queries) InsertControlPanelUserConnection

func (q *Queries) InsertControlPanelUserConnection(ctx context.Context, arg InsertControlPanelUserConnectionParams) error

func (*Queries) InsertGameSessionSignal

func (q *Queries) InsertGameSessionSignal(ctx context.Context, arg InsertGameSessionSignalParams) (int64, error)

func (*Queries) InsertMatchmakerMatch

func (q *Queries) InsertMatchmakerMatch(ctx context.Context, arg InsertMatchmakerMatchParams) error

func (*Queries) InsertMatchmakingTicket

func (q *Queries) InsertMatchmakingTicket(ctx context.Context, arg InsertMatchmakingTicketParams) (InsertMatchmakingTicketRow, error)

func (*Queries) InsertPlayerAccountConnection

func (q *Queries) InsertPlayerAccountConnection(ctx context.Context, arg InsertPlayerAccountConnectionParams) error

func (*Queries) InsertPlayerAccountTOTPBackupCodes

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

Bulk-inserts a fresh backup-code set in one round-trip (pgx COPY).

func (*Queries) InsertServerSecret

func (q *Queries) InsertServerSecret(ctx context.Context, arg InsertServerSecretParams) (int64, error)

ON CONFLICT DO NOTHING makes first-boot generation race-safe: concurrent instances all insert, one wins, and everyone reads the winner back.

func (*Queries) InsertSettingsRevision

func (q *Queries) InsertSettingsRevision(ctx context.Context, arg InsertSettingsRevisionParams) error

func (*Queries) InvalidateControlPanelPasswordResets

func (q *Queries) InvalidateControlPanelPasswordResets(ctx context.Context, controlPanelUserID int64) error

Burns every outstanding reset link for the user. Run in the same transaction as any password change so an older emailed link cannot reset the password again afterwards.

func (*Queries) InvalidatePlayerAccountPasswordResets

func (q *Queries) InvalidatePlayerAccountPasswordResets(ctx context.Context, playerAccountID pgtype.UUID) error

Burns every outstanding reset link for the account. Run in the same transaction as any password change so an older emailed link cannot reset the password again afterwards.

func (*Queries) IsAccountBannedInTenant

func (q *Queries) IsAccountBannedInTenant(ctx context.Context, arg IsAccountBannedInTenantParams) (int64, error)

func (*Queries) IsBlockedBetweenAccounts

func (q *Queries) IsBlockedBetweenAccounts(ctx context.Context, arg IsBlockedBetweenAccountsParams) (int64, error)

Edge id if EITHER account has blocked the other. Defense-in-depth gate on every interaction path (friend request, game invite, presence).

func (*Queries) IsEmailSuppressed

func (q *Queries) IsEmailSuppressed(ctx context.Context, email string) (bool, error)

func (*Queries) IsGameSessionMember

func (q *Queries) IsGameSessionMember(ctx context.Context, arg IsGameSessionMemberParams) (bool, error)

func (*Queries) IsPlayerBannedByTenant

func (q *Queries) IsPlayerBannedByTenant(ctx context.Context, playerID int64) (int64, error)

Enforcement helper: is the given player's linked account tenant-banned in the player's own tenant? Runs in a tenant Pool.Q (project_players RLS-filtered). Returns pgx.ErrNoRows when not banned (or the player is unlinked).

func (*Queries) LatestSettingsRevision

func (q *Queries) LatestSettingsRevision(ctx context.Context, arg LatestSettingsRevisionParams) (int64, error)

func (*Queries) LeaderboardEntriesForPlayers

func (q *Queries) LeaderboardEntriesForPlayers(ctx context.Context, arg LeaderboardEntriesForPlayersParams) ([]LeaderboardEntriesForPlayersRow, error)

Friends view: current-period entries for an explicit player set, in rank order. The caller re-ranks 0-based within the returned set.

func (*Queries) LeaderboardHasEntries

func (q *Queries) LeaderboardHasEntries(ctx context.Context, leaderboardID int64) (bool, error)

Any period counts: past-period entries are ranked under the board's current sort order too, so history alone locks it.

func (*Queries) LeaderboardRangeByRank

func (q *Queries) LeaderboardRangeByRank(ctx context.Context, arg LeaderboardRangeByRankParams) ([]LeaderboardRangeByRankRow, error)

func (*Queries) LeaderboardUserRank

func (q *Queries) LeaderboardUserRank(ctx context.Context, arg LeaderboardUserRankParams) (int64, error)

func (*Queries) LinkPlayerEmailCredentials

func (q *Queries) LinkPlayerEmailCredentials(ctx context.Context, arg LinkPlayerEmailCredentialsParams) (int64, error)

POST /v1/auth/link: attach email + password sign-in to a player that has none, minting the verification challenge in the same write. The email IS NULL guard makes 0 rows mean "already has credentials"; the per-project email unique index rejects an address another player uses.

func (*Queries) LinkPlayerToAccount

func (q *Queries) LinkPlayerToAccount(ctx context.Context, arg LinkPlayerToAccountParams) error

ListPlayerAccountLinkedProjects is intentionally NOT a sqlc query: it reads the SECURITY DEFINER player_account_linked_projects(uuid) table-function, which sqlc's analyzer can't resolve column types for. It is called via raw tx.Query in internal/players (same approach as project_player_tenant). Tenant-scoped (run under Pool.Q with app.tenant_id set): attaches a per-project player to a global account. Guarded by RLS on project_players. Clears unlinked_at: a re-invite restores an unlinked player's access.

func (*Queries) ListAPIKeys

func (q *Queries) ListAPIKeys(ctx context.Context) ([]ListAPIKeysRow, error)

func (*Queries) ListAcceptedFriendAccountIDs

func (q *Queries) ListAcceptedFriendAccountIDs(ctx context.Context, me pgtype.UUID) ([]pgtype.UUID, error)

Every account the caller has an accepted friendship with, either direction. Used by views that need the full friend set at once (friends leaderboard).

func (*Queries) ListAccountIdentities

func (q *Queries) ListAccountIdentities(ctx context.Context, accountIds []pgtype.UUID) ([]ListAccountIdentitiesRow, error)

Bulk-fetch email + display_name for a set of accounts (friend-list enrich).

func (*Queries) ListActiveAllocations

func (q *Queries) ListActiveAllocations(ctx context.Context, arg ListActiveAllocationsParams) ([]ListActiveAllocationsRow, error)

func (*Queries) ListAllProjectAllowedOrigins

func (q *Queries) ListAllProjectAllowedOrigins(ctx context.Context) ([]string, error)

Runs with no tenant set; see all_project_allowed_origins().

func (*Queries) ListAllRateLimitOverridesForTenant

func (q *Queries) ListAllRateLimitOverridesForTenant(ctx context.Context, tenantID int64) ([]ListAllRateLimitOverridesForTenantRow, error)

Every override for a tenant — tenant-wide (project_id NULL) and per-project — in one query. The rate-limits page groups these in Go rather than issuing one ListRateLimitOverridesForProject per project (an N+1 over the project list).

func (*Queries) ListAllocationBackendsForTenant

func (q *Queries) ListAllocationBackendsForTenant(ctx context.Context) ([]ListAllocationBackendsForTenantRow, error)

Distinct backends seen across this tenant's recent allocations. Drives the backends-health page so operators see which backends actually serve traffic, not just the one currently configured.

func (*Queries) ListAllocationEvents

func (q *Queries) ListAllocationEvents(ctx context.Context, arg ListAllocationEventsParams) ([]ListAllocationEventsRow, error)

func (*Queries) ListAllocationsForProject

func (q *Queries) ListAllocationsForProject(ctx context.Context, arg ListAllocationsForProjectParams) ([]ListAllocationsForProjectRow, error)

Control panel fleet list: optionally include terminal rows (shutdown/failed) and paginate. include_terminal=false keeps the page focused on live allocations; the UI toggles it via a query param.

func (*Queries) ListControlPanelInvitationsForTenant

func (q *Queries) ListControlPanelInvitationsForTenant(ctx context.Context, tenantID *int64) ([]ListControlPanelInvitationsForTenantRow, error)

func (*Queries) ListControlPanelMembersForTenant

func (q *Queries) ListControlPanelMembersForTenant(ctx context.Context, tenantID int64) ([]ListControlPanelMembersForTenantRow, error)

func (*Queries) ListControlPanelTenantsForPlatformAdmin

func (q *Queries) ListControlPanelTenantsForPlatformAdmin(ctx context.Context) ([]ListControlPanelTenantsForPlatformAdminRow, error)

func (*Queries) ListControlPanelTenantsForUser

func (q *Queries) ListControlPanelTenantsForUser(ctx context.Context, controlPanelUserID int64) ([]ListControlPanelTenantsForUserRow, error)

func (*Queries) ListControlPanelUserConnections

func (q *Queries) ListControlPanelUserConnections(ctx context.Context, controlPanelUserID int64) ([]ListControlPanelUserConnectionsRow, error)

func (*Queries) ListControlPanelUsersForPlatformAdmin

Powers the /v1/control-panel/admin/users page. tenant_count is a correlated subquery so users with zero memberships still appear.

func (*Queries) ListDeletedLeaderboardsForProject

func (q *Queries) ListDeletedLeaderboardsForProject(ctx context.Context, projectID int64) ([]ListDeletedLeaderboardsForProjectRow, error)

func (*Queries) ListDueLeaderboardResets

func (q *Queries) ListDueLeaderboardResets(ctx context.Context, asOf pgtype.Timestamptz) ([]ListDueLeaderboardResetsRow, error)

Boards whose scheduled reset boundary has passed, locked for the reset transaction so two job runs can never double-archive a period. as_of is the job's clock — the same instant it computes the next boundary from, so the due filter and the new boundary can never disagree.

func (*Queries) ListEligibleRelayNodes

func (q *Queries) ListEligibleRelayNodes(ctx context.Context, maxAgeSeconds float64) ([]RelayNode, error)

Eligible: known, last probe succeeded, reported active, and probed within the freshness window.

func (*Queries) ListEnforcedTenantStorage

func (q *Queries) ListEnforcedTenantStorage(ctx context.Context) ([]ListEnforcedTenantStorageRow, error)

Name, usage, class, quota overrides, and last-notified threshold for every quota-enforced tenant. Read cross-tenant by the storage-warn River job (bootstrap tx).

func (*Queries) ListExpiredUnclaimedMatchmakerAllocations

func (q *Queries) ListExpiredUnclaimedMatchmakerAllocations(ctx context.Context) ([]ListExpiredUnclaimedMatchmakerAllocationsRow, error)

GC candidates whose allocation lease elapsed without a poll or realtime delivery. Privileged — runs without a tenant GUC.

func (*Queries) ListFleetsForProject

func (q *Queries) ListFleetsForProject(ctx context.Context, projectID int64) ([]Fleet, error)

Control panel list. Soft-deleted rows are excluded; include_deleted is reserved for a future "archive" view but not wired through the UI yet.

func (*Queries) ListFriendsByStatusForAccount

func (q *Queries) ListFriendsByStatusForAccount(ctx context.Context, arg ListFriendsByStatusForAccountParams) ([]FriendEdge, error)

Caller-aware. For 'blocked', only rows the caller initiated are returned — never rows where the caller is the blockee (which would let a blocked user learn who blocked them).

func (*Queries) ListGameSessionPeers

func (q *Queries) ListGameSessionPeers(ctx context.Context, sessionID string) ([]ListGameSessionPeersRow, error)

Returns active peers (last_seen within 30 s) with each peer's optional xuid and display name (from the linked global account, when present). RLS on game_session_peer scopes rows to the current tenant.

func (*Queries) ListGameSessionSignalsForRecipient

Recipient-scoped, cursor-ordered, unexpired signals. The to_player_id filter plus RLS ensure a player only ever reads signals addressed to them, and the id > after_id cursor makes repeat polls return only new signals.

func (*Queries) ListKnownRelayNodes

func (q *Queries) ListKnownRelayNodes(ctx context.Context) ([]RelayNode, error)

func (*Queries) ListLeaderboardPeriods

func (q *Queries) ListLeaderboardPeriods(ctx context.Context, arg ListLeaderboardPeriodsParams) ([]ListLeaderboardPeriodsRow, error)

Finished periods, newest first, keyset-paginated on the period number.

func (*Queries) ListLeaderboardsForProject

func (q *Queries) ListLeaderboardsForProject(ctx context.Context, projectID int64) ([]ListLeaderboardsForProjectRow, error)

func (*Queries) ListMCPTokensForProject

func (q *Queries) ListMCPTokensForProject(ctx context.Context, projectID int64) ([]ListMCPTokensForProjectRow, error)

Unexpired tokens, plus tokens that expired in the last 30 days so a person can see why an agent stopped. Older expired tokens leave the list, so they cannot push active tokens past the LIMIT.

func (*Queries) ListMatchmakerBucketsForProject

func (q *Queries) ListMatchmakerBucketsForProject(ctx context.Context, projectID int64) ([]ListMatchmakerBucketsForProjectRow, error)

Control panel matchmaker page: queue depth per (mode, region, game_mode) bucket for the current tenant's project, plus oldest queued ticket and the min/max count spread so operators can spot stuck buckets at a glance.

func (*Queries) ListOpenInvitationTargetsForProject

func (q *Queries) ListOpenInvitationTargetsForProject(ctx context.Context, projectID int64) ([]*int64, error)

Target player IDs of open, unexpired invitations, for the "invite pending" list badge. Expired-but-unswept invites are excluded so the badge matches what the accept flow would actually honor.

func (*Queries) ListPendingGameInvites

func (q *Queries) ListPendingGameInvites(ctx context.Context, toPlayerID int64) ([]ListPendingGameInvitesRow, error)

Returns unexpired invites for the target user, enriched with the sender's email and optional xuid for display.

func (*Queries) ListPendingTenantChangeRequests

func (q *Queries) ListPendingTenantChangeRequests(ctx context.Context) ([]ListPendingTenantChangeRequestsRow, error)

Platform-admin review queue: pending requests with tenant name + current class. Read cross-tenant (bootstrap tx).

func (*Queries) ListPendingTenantSignupRequests

func (q *Queries) ListPendingTenantSignupRequests(ctx context.Context) ([]ListPendingTenantSignupRequestsRow, error)

func (*Queries) ListPlatformAdminInvitations

func (q *Queries) ListPlatformAdminInvitations(ctx context.Context) ([]ListPlatformAdminInvitationsRow, error)

func (*Queries) ListPlatformAdmins

func (q *Queries) ListPlatformAdmins(ctx context.Context) ([]ListPlatformAdminsRow, error)

func (*Queries) ListPlayerAccountConnections

func (q *Queries) ListPlayerAccountConnections(ctx context.Context, playerAccountID pgtype.UUID) ([]ListPlayerAccountConnectionsRow, error)

func (*Queries) ListPlayerInvitationsForProject

func (q *Queries) ListPlayerInvitationsForProject(ctx context.Context, projectID int64) ([]ListPlayerInvitationsForProjectRow, error)

func (*Queries) ListPlayerSessionEpochs

func (q *Queries) ListPlayerSessionEpochs(ctx context.Context, ids []int64) ([]ListPlayerSessionEpochsRow, error)

Batched lifecycle sweep for live WebSockets: one query per tenant with open sockets per sweep interval (O(tenants), not O(sockets)). A player missing from the result (deleted) reads as revoked.

func (*Queries) ListPlayersDueForPurge

func (q *Queries) ListPlayersDueForPurge(ctx context.Context, arg ListPlayersDueForPurgeParams) ([]ListPlayersDueForPurgeRow, error)

One purge batch for the current tenant. FOR UPDATE serializes against a racing cancel: the cancel either lands first (the row drops out of the result) or blocks until the delete commits and reports "no pending deletion". deleted_at is returned so the caller only releases quota slots for rows that ever held one.

func (*Queries) ListPlayersForProject

func (q *Queries) ListPlayersForProject(ctx context.Context, arg ListPlayersForProjectParams) ([]ListPlayersForProjectRow, error)

Control-panel-side player management queries. Privileged: the control panel runs them as platform/tenant admin via BootstrapQ, so we filter by tenant_id explicitly rather than relying on RLS.

func (*Queries) ListPresenceForUsers

func (q *Queries) ListPresenceForUsers(ctx context.Context, playerIds []int64) ([]ListPresenceForUsersRow, error)

func (*Queries) ListProjectsForTenant

func (q *Queries) ListProjectsForTenant(ctx context.Context) ([]ListProjectsForTenantRow, error)

func (*Queries) ListPublicOpenGameSessions

func (q *Queries) ListPublicOpenGameSessions(ctx context.Context, arg ListPublicOpenGameSessionsParams) ([]ListPublicOpenGameSessionsRow, error)

The public session browser: open, public, unexpired sessions in the caller's project that still have room. Player counts come from the peer heartbeat window (last_seen within 30 s, matching ListGameSessionPeers), and a session with no live peer is a ghost lobby nobody can play in, so it is excluded too. Keyset-paginated on the session id.

func (*Queries) ListPublicPlayers

func (q *Queries) ListPublicPlayers(ctx context.Context, arg ListPublicPlayersParams) ([]ListPublicPlayersRow, error)

Unknown and out-of-project ids drop out of the result set silently.

func (*Queries) ListQuotaOverridesForTenant

func (q *Queries) ListQuotaOverridesForTenant(ctx context.Context, tenantID int64) ([]ListQuotaOverridesForTenantRow, error)

Per-axis overrides for one tenant, for the control-panel views and the platform-admin editor. Hot paths never call this — they get the same rows aggregated into the quota-context snapshot above.

func (*Queries) ListReadyMatchmakerBuckets

func (q *Queries) ListReadyMatchmakerBuckets(ctx context.Context) ([]ListReadyMatchmakerBucketsRow, error)

Region is a bucket dimension only for fleet_allocation (the server must be placed in a concrete region); non-fleet modes mix regions inside one bucket and the worker applies the soft-region grouping rules in Go.

func (*Queries) ListRelayNodes

func (q *Queries) ListRelayNodes(ctx context.Context, maxAgeSeconds float64) ([]ListRelayNodesRow, error)

eligible uses the same rule and clock as ListEligibleRelayNodes, so the admin list agrees with what credentials serve.

func (*Queries) ListSettingsRevisions

func (q *Queries) ListSettingsRevisions(ctx context.Context, arg ListSettingsRevisionsParams) ([]ListSettingsRevisionsRow, error)

func (*Queries) ListStorageObjects

func (q *Queries) ListStorageObjects(ctx context.Context, arg ListStorageObjectsParams) ([]ListStorageObjectsRow, error)

func (*Queries) ListTenantAdminEmails

func (q *Queries) ListTenantAdminEmails(ctx context.Context, tenantID int64) ([]string, error)

Verified emails of a tenant's owner/admin members, for operational notices (e.g. storage-quota warnings). Read cross-tenant by background jobs.

func (*Queries) ListTenantChangeRequests

func (q *Queries) ListTenantChangeRequests(ctx context.Context, tenantID int64) ([]ListTenantChangeRequestsRow, error)

The tenant's own requests (any status) for the settings page. Filters by explicit tenant_id (the table has no RLS).

func (*Queries) ListTenantCustomTokenSecrets

func (q *Queries) ListTenantCustomTokenSecrets(ctx context.Context) ([]ListTenantCustomTokenSecretsRow, error)

Boot-time backfill input: every tenant holding a custom-token secret. Cross-tenant by design (BootstrapQ).

func (*Queries) ListTenantEnabledFeatures

func (q *Queries) ListTenantEnabledFeatures(ctx context.Context) ([]string, error)

Tenant-level features the tenant already holds, to exclude from the request dropdown. Reads feature_grants in tenant RLS context.

func (*Queries) ListTenantPlayerBans

func (q *Queries) ListTenantPlayerBans(ctx context.Context, tenantID int64) ([]ListTenantPlayerBansRow, error)

Control panel list for a tenant, enriched with the banned account's email.

func (*Queries) LockControlPanelUserSignInMethods

func (q *Queries) LockControlPanelUserSignInMethods(ctx context.Context, id int64) (bool, error)

Same row lock as LockPlayerAccountSignInMethods.

func (*Queries) LockControlPanelUserVerification

func (q *Queries) LockControlPanelUserVerification(ctx context.Context, arg LockControlPanelUserVerificationParams) error

Set the lockout window on an account that just tipped over MaxLifetimeAttempts. The Go side computes the timestamp so the lockout duration stays a single source of truth.

func (*Queries) LockEnabledPlatformAdmins

func (q *Queries) LockEnabledPlatformAdmins(ctx context.Context) ([]int64, error)

Serializes last-admin checks by locking the currently enabled platform admin rows before counting them in the surrounding transaction.

func (*Queries) LockLiveProject

func (q *Queries) LockLiveProject(ctx context.Context, projectID int64) (int64, error)

Serializes creates that check a per-project limit.

func (*Queries) LockPlayerAccountSignInMethods

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

Row lock for the last-sign-in-method rule: two concurrent unlink requests serialize here, so they cannot both pass the count and remove the last two methods.

func (*Queries) LockPlayerAccountVerification

func (q *Queries) LockPlayerAccountVerification(ctx context.Context, arg LockPlayerAccountVerificationParams) error

func (*Queries) LockPlayerForFleetAllocation

func (q *Queries) LockPlayerForFleetAllocation(ctx context.Context, playerID int64) error

Transaction-scoped advisory lock serializing the per-player fleet-allocation cap. The enqueue check and the worker's match insert are separate transactions, so without it a ticket enqueued while an earlier one is still allocating counts a stale total and both commit. Released on commit/rollback.

func (*Queries) LockPlayerPasswordReset

func (q *Queries) LockPlayerPasswordReset(ctx context.Context, arg LockPlayerPasswordResetParams) error

func (*Queries) LockPlayerVerification

func (q *Queries) LockPlayerVerification(ctx context.Context, arg LockPlayerVerificationParams) error

func (*Queries) LockProjectForGameSessionCreate

func (q *Queries) LockProjectForGameSessionCreate(ctx context.Context, projectID int64) error

Transaction-scoped advisory lock serializing session creation per project so the open-session cap can't be raced past. Released on commit/rollback.

func (*Queries) LockSignalRate

func (q *Queries) LockSignalRate(ctx context.Context, fromPlayerID int64) error

Serializes a player's concurrent signal sends within the transaction so the per-minute count+insert below can't be raced past the cap under READ COMMITTED. player_id (project_players.id) is globally unique, so the lock key never collides across tenants. Released on commit/rollback.

func (*Queries) LockStorageObjectForWrite

func (q *Queries) LockStorageObjectForWrite(ctx context.Context, arg LockStorageObjectForWriteParams) error

Transaction-scoped advisory lock serializing concurrent writes (put/delete) to a single storage object so the read-modify-write of the tenant byte counter can't be raced past. Released on commit/rollback.

func (*Queries) MarkAllocationFailed

func (q *Queries) MarkAllocationFailed(ctx context.Context, id int64) error

A released row stays 'shutdown'. A 'ready' row can still fail, because the commit of MarkAllocationReady can succeed and report an error.

func (*Queries) MarkAllocationReady

func (q *Queries) MarkAllocationReady(ctx context.Context, arg MarkAllocationReadyParams) (int64, error)

0 rows = the row left 'pending' during the backend call, so the caller must free the server that the call created.

func (*Queries) MarkControlPanelInvitationAccepted

func (q *Queries) MarkControlPanelInvitationAccepted(ctx context.Context, id int64) (int64, error)

func (*Queries) MarkControlPanelUserVerified

func (q *Queries) MarkControlPanelUserVerified(ctx context.Context, id int64) error

func (*Queries) MarkPlayerAccountVerified

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

func (*Queries) MarkPlayerInvitationAccepted

func (q *Queries) MarkPlayerInvitationAccepted(ctx context.Context, id int64) (int64, error)

func (*Queries) MarkPlayerVerified

func (q *Queries) MarkPlayerVerified(ctx context.Context, id int64) error

A proven verification also restarts the lifetime budget and drops any lockout, mirroring CompletePlayerPasswordReset.

func (*Queries) MarkPlayerVerifiedByID

func (q *Queries) MarkPlayerVerifiedByID(ctx context.Context, id int64) error

func (*Queries) MarkRelayUsageWarned80

func (q *Queries) MarkRelayUsageWarned80(ctx context.Context, month pgtype.Date) (int64, error)

Claims the right to send the single 80% warning email for this month (0 rows = another request already sent it).

func (*Queries) MarkRelayUsageWarned100

func (q *Queries) MarkRelayUsageWarned100(ctx context.Context, month pgtype.Date) (int64, error)

Claims the right to send the single 100% warning email for this month.

func (*Queries) MarkTenantSignupAccepted

func (q *Queries) MarkTenantSignupAccepted(ctx context.Context, arg MarkTenantSignupAcceptedParams) (int64, error)

Clears the code hash so the magic link can't be replayed after acceptance.

func (*Queries) MatchmakerQueueStats

func (q *Queries) MatchmakerQueueStats(ctx context.Context) ([]MatchmakerQueueStatsRow, error)

Cross-tenant queue-depth + oldest-queued-ticket age, sampled by the observability collector for the queue gauges. Privileged: runs over the bootstrap role (no tenant GUC), mirroring the sweeper's scan. Region is a bucket dimension only for fleet_allocation; blanked for other modes so the gauge label set matches the worker's buckets. Deliberately does NOT group by game_mode: that column is developer-supplied free text, so labelling the Prometheus gauges with it would make the series count unbounded.

func (*Queries) PeekControlPanelPasswordReset

func (q *Queries) PeekControlPanelPasswordReset(ctx context.Context, tokenHash []byte) (int64, error)

Read-only validity probe for the GET form page; ConsumeControlPanelPasswordReset is the single-use gate on the actual POST.

func (*Queries) PeekPlayerAccountPasswordReset

func (q *Queries) PeekPlayerAccountPasswordReset(ctx context.Context, tokenHash []byte) (pgtype.UUID, error)

Read-only validity probe for the GET form page; ConsumePlayerAccountPasswordReset is the single-use gate on the actual POST.

func (*Queries) PlayerInviteLookup

func (q *Queries) PlayerInviteLookup(ctx context.Context, codeHash []byte) (PlayerInviteLookupRow, error)

Privileged (SECURITY DEFINER) lookup used by the player invite-accept page. Returns the tenant_id so the caller can SET app.tenant_id and continue under normal RLS enforcement.

The per-column casts give sqlc concrete types: it cannot introspect SECURITY DEFINER table functions, so it would otherwise fall back to interface{} for every column.

func (*Queries) PlayerLinkTargetExists

func (q *Queries) PlayerLinkTargetExists(ctx context.Context, id int64) (bool, error)

Tenant-scoped existence probe used by the link-player accept path to tell a vanished/soft-deleted target row (the invite is dead) apart from a genuine conflict when BindPlayerLinkedEmail affects 0 rows.

func (*Queries) ProjectIsLive

func (q *Queries) ProjectIsLive(ctx context.Context, projectID int64) (bool, error)

func (*Queries) PromoteControlPanelUserToPlatformAdmin

func (q *Queries) PromoteControlPanelUserToPlatformAdmin(ctx context.Context, id int64) error

func (*Queries) PruneSettingsRevisions

func (q *Queries) PruneSettingsRevisions(ctx context.Context, arg PruneSettingsRevisionsParams) error

func (*Queries) PruneStaleGameSessionPeers

func (q *Queries) PruneStaleGameSessionPeers(ctx context.Context, sessionID string) (int64, error)

func (*Queries) PutStorageObject

func (q *Queries) PutStorageObject(ctx context.Context, arg PutStorageObjectParams) (PutStorageObjectRow, error)

Upsert; bumps version. Caller may pass If-Match via expected_version param.

func (*Queries) PutStorageObjectIfMatch

func (q *Queries) PutStorageObjectIfMatch(ctx context.Context, arg PutStorageObjectIfMatchParams) (PutStorageObjectIfMatchRow, error)

Optimistic concurrency variant — only updates if the row's current version matches expected. RETURNING NULL row on mismatch.

func (*Queries) RecordControlPanelLoginSuccess

func (q *Queries) RecordControlPanelLoginSuccess(ctx context.Context, id int64) error

func (*Queries) RecordRelayNodeProbe

func (q *Queries) RecordRelayNodeProbe(ctx context.Context, arg RecordRelayNodeProbeParams) (RecordRelayNodeProbeRow, error)

Stores what the probe read; a probe that read nothing clears the lifecycle columns. It returns the previous probe result, read under a row lock, so concurrent probers each see the result the other wrote and a change is logged once. No row when the node was retired since it was listed.

func (*Queries) RedeemRealtimeTicket

func (q *Queries) RedeemRealtimeTicket(ctx context.Context, ticketHash []byte) (RedeemRealtimeTicketRow, error)

Single use: the row is deleted as it is read. Runs with no tenant set.

func (*Queries) ReleaseAllocation

func (q *Queries) ReleaseAllocation(ctx context.Context, id int64) error

func (*Queries) ReleaseMatchmakerTickets

func (q *Queries) ReleaseMatchmakerTickets(ctx context.Context, arg ReleaseMatchmakerTicketsParams) (int64, error)

Worker-driven release of one failed group: the resolver (allocator, session creator) failed. Bump allocation_attempts; flip to 'failed' on the Nth attempt, stamping the structured reason. Returns how many tickets flipped to 'failed' this call so the caller can meter the attempts_exhausted failure counter without re-reading the rows.

func (*Queries) ReleaseTenantPlayerSlots

func (q *Queries) ReleaseTenantPlayerSlots(ctx context.Context, n int64) error

Counter mirror of ReserveTenantPlayerSlot for the delete-purge path: the caller passes how many non-soft-deleted players it hard-deleted in the same transaction (soft-deleted rows never held a slot). GREATEST guards against drift from out-of-band writes ever pushing the counter negative.

func (*Queries) ReplacePlayerExternalID

func (q *Queries) ReplacePlayerExternalID(ctx context.Context, arg ReplacePlayerExternalIDParams) (int64, error)

Steam linking: swap a generated identity for the platform identity. Compare-and-swap on the old value so a concurrent change loses cleanly; the per-project external_id unique index rejects an identity another player already holds.

func (*Queries) RequestFriendByAccount

func (q *Queries) RequestFriendByAccount(ctx context.Context, arg RequestFriendByAccountParams) (RequestFriendByAccountRow, error)

Friend edges between GLOBAL player_accounts. friend_edges has no tenant_id and no RLS, so these run in either a tenant Pool.Q or a BootstrapQ transaction. Account ids are UUIDs. One current row per directed pair. Re-requests after rejection update in place; pending/accepted are idempotent (WHERE filters them, DO UPDATE no-ops); blocked is terminal (WHERE omits it).

func (*Queries) RequestPlayerDeleteByAccount

func (q *Queries) RequestPlayerDeleteByAccount(ctx context.Context, arg RequestPlayerDeleteByAccountParams) (pgtype.Timestamptz, error)

Per-project player deletion: account-portal request/cancel plus the purge sweep. The portal queries run under BootstrapQ with app.tenant_id set for the link's tenant (same pattern as UnlinkPlayerFromAccount); the sweep runs per tenant under Pool.Q. The account guard stops one account from deleting another account's player. Portal-side delete request: disables the player (keeping an earlier suspension timestamp intact) and stamps delete_requested_at with the same now() so cancel can tell the two apart. 0 rows = not this account's player or already pending.

func (*Queries) RequestPlayerDeleteInProject

func (q *Queries) RequestPlayerDeleteInProject(ctx context.Context, arg RequestPlayerDeleteInProjectParams) (pgtype.Timestamptz, error)

Admin-side delete request: disables the player (keeping an earlier suspension timestamp intact) and stamps delete_requested_at with the same now() so cancel can tell the two apart. Marks the request as the admin's, so the player cannot cancel it. A pending player request becomes the admin's and keeps its time stamp, so the purge time does not move. 0 rows = gone or already the admin's.

func (*Queries) RequestPlayerDeleteSelf

func (q *Queries) RequestPlayerDeleteSelf(ctx context.Context, id int64) (pgtype.Timestamptz, error)

Self-service delete request: disables the player (keeping an earlier suspension timestamp intact) and stamps delete_requested_at with the same now() so cancel can tell the two apart. The purge sweep hard-deletes the row once the grace window passes. 0 rows = gone or already pending.

func (*Queries) ReserveControlPanelTOTPAttempt

Atomic check-and-bump, same shape as ReserveControlPanelVerifyAttempt: the cap lives in the WHERE so parallel wrong codes cannot overshoot it. Returns 0 rows when already at cap (caller treats as locked).

func (*Queries) ReserveControlPanelVerifyAttempt

Atomic check-and-bump used in place of the previous fetch-then-increment pattern: two parallel wrong codes used to both pass the cap check before either incremented, so the lockout could be overshot. The WHERE clause now folds the bound into the same statement that mutates the counter. Returns 0 rows when already at cap (caller treats as errVerifyLocked).

func (*Queries) ReservePlayerAccountVerifyAttempt

Atomic check-and-bump; returns 0 rows when already at the per-code cap.

func (*Queries) ReservePlayerPasswordResetAttempt

Atomic check-and-bump, the ReservePlayerVerifyAttempt twin for resets.

func (*Queries) ReservePlayerVerifyAttempt

Atomic check-and-bump (see ReserveControlPanelVerifyAttempt for the TOCTOU explanation). Returns 0 rows when already at cap.

func (*Queries) ReserveTenantPlayerSlot

func (q *Queries) ReserveTenantPlayerSlot(ctx context.Context, playerLimit int64) (int64, error)

Authoritative player-quota gate: atomically claims one registered-player slot by bumping player_count, refusing at the class cap (0 rows affected). Run it as the LAST statement before commit so the tenant-row lock is held for a single round trip instead of across the whole create transaction. player_limit is quota.Limits.Players; -1 is quota.Unlimited. The NOT enforce_quotas arm admits unenforced tenants while still counting them, so player_count stays exact for every tenant and flipping enforce_quotas on later needs no recompute. Out-of-band player writes (bulk seeds, imports) must maintain the counter themselves.

func (*Queries) ResetControlPanelTOTPAttempts

func (q *Queries) ResetControlPanelTOTPAttempts(ctx context.Context, controlPanelUserID int64) error

func (*Queries) ResetPlayerAccountTOTPAttempts

func (q *Queries) ResetPlayerAccountTOTPAttempts(ctx context.Context, playerAccountID pgtype.UUID) error

func (*Queries) ResolvePendingFriendEdge

func (q *Queries) ResolvePendingFriendEdge(ctx context.Context, arg ResolvePendingFriendEdgeParams) (int64, error)

Accept or reject. Only a pending edge can move, so a block or an unfriend that commits first wins: the row lock makes this re-check status, and it returns 0.

func (*Queries) ResolvePlayersForAccountsInProject

Tenant-scoped: maps a set of accounts back to their player in a specific project, for presence sharing and JSON-API user_id mapping.

func (*Queries) RestoreControlPanelUserVerificationCode

func (q *Queries) RestoreControlPanelUserVerificationCode(ctx context.Context, arg RestoreControlPanelUserVerificationCodeParams) error

Undo a code reservation only when it is still the code whose delivery failed. A concurrent request that installed a newer code must win.

func (*Queries) RestoreLeaderboard

func (q *Queries) RestoreLeaderboard(ctx context.Context, arg RestoreLeaderboardParams) (int64, error)

func (*Queries) RestorePlayerAccountVerificationCode

func (q *Queries) RestorePlayerAccountVerificationCode(ctx context.Context, arg RestorePlayerAccountVerificationCodeParams) error

Undo a code reservation only when it is still the code whose delivery failed. A concurrent request that installed a newer code must win.

func (*Queries) RetireRelayNode

func (q *Queries) RetireRelayNode(ctx context.Context, id int64) (RelayNode, error)

Retiring is idempotent and keeps the row. A retired node is never probed or advertised again.

func (*Queries) ReturnMatchmakerClaim

func (q *Queries) ReturnMatchmakerClaim(ctx context.Context, claimID pgtype.UUID) (int64, error)

Un-claim whatever the claim still holds without penalty: tickets that didn't fit a group this pass simply go back to waiting.

func (*Queries) ReturnMatchmakerTicketsByID

func (q *Queries) ReturnMatchmakerTicketsByID(ctx context.Context, arg ReturnMatchmakerTicketsByIDParams) (int64, error)

Penalty-free un-claim of specific still-queued tickets holding this claim: the survivors of a short commit go back to waiting without an attempt bump. Drifted tickets (cancelled/failed) are no longer 'queued' and are skipped.

func (*Queries) RevokeAPIKey

func (q *Queries) RevokeAPIKey(ctx context.Context, id int64) error

func (*Queries) RevokeActivePlayerSessions

func (q *Queries) RevokeActivePlayerSessions(ctx context.Context, arg RevokeActivePlayerSessionsParams) (int64, error)

Reuse-detection response: nuke every live session for the player in this project. Paired with BumpPlayerSessionEpoch so outstanding access tokens die at the epoch gate immediately, not just at TTL.

func (*Queries) RevokeAllControlPanelSessionsForUser

func (q *Queries) RevokeAllControlPanelSessionsForUser(ctx context.Context, controlPanelUserID int64) error

func (*Queries) RevokeAllPlayerAccountSessions

func (q *Queries) RevokeAllPlayerAccountSessions(ctx context.Context, playerAccountID pgtype.UUID) error

func (*Queries) RevokeControlPanelInvitation

func (q *Queries) RevokeControlPanelInvitation(ctx context.Context, arg RevokeControlPanelInvitationParams) error

Runs under the RLS-bypassing bootstrap role, so scope to the tenant in SQL rather than relying solely on the caller's precheck.

func (*Queries) RevokeControlPanelSession

func (q *Queries) RevokeControlPanelSession(ctx context.Context, id int64) error

func (*Queries) RevokeMCPToken

func (q *Queries) RevokeMCPToken(ctx context.Context, arg RevokeMCPTokenParams) (int64, error)

func (*Queries) RevokeOpenInvitationsByInviter

func (q *Queries) RevokeOpenInvitationsByInviter(ctx context.Context, invitedByUserID int64) error

Bulk-revoke the outgoing invitations a (now-disabled) user created. Re-enabling does NOT un-revoke these; the platform admin can re-issue.

func (*Queries) RevokeOtherControlPanelSessionsForUser

func (q *Queries) RevokeOtherControlPanelSessionsForUser(ctx context.Context, arg RevokeOtherControlPanelSessionsForUserParams) error

2FA enable/disable revokes every session except the one doing the change; the RevokeAll variant would log the acting user out mid-flow.

func (*Queries) RevokeOtherPlayerAccountSessions

func (q *Queries) RevokeOtherPlayerAccountSessions(ctx context.Context, arg RevokeOtherPlayerAccountSessionsParams) error

func (*Queries) RevokePlayerAccountSession

func (q *Queries) RevokePlayerAccountSession(ctx context.Context, refreshHash []byte) error

func (*Queries) RevokePlayerInvitation

func (q *Queries) RevokePlayerInvitation(ctx context.Context, id int64) error

func (*Queries) RevokePlayerSession

func (q *Queries) RevokePlayerSession(ctx context.Context, refreshHash []byte) error

func (*Queries) RevokeSession

func (q *Queries) RevokeSession(ctx context.Context, id int64) (int64, error)

Rotation path: the token is being superseded by a freshly-issued one, so a later replay of this hash is a reuse (theft) signal.

func (*Queries) RevokeSessionByRefreshHash

func (q *Queries) RevokeSessionByRefreshHash(ctx context.Context, refreshHash []byte) (int64, error)

Logout path: a later replay of this hash is a benign stale-client retry, not reuse, so it must NOT trip the family kill.

func (*Queries) RevokeSupersededPlayerInvitations

func (q *Queries) RevokeSupersededPlayerInvitations(ctx context.Context, arg RevokeSupersededPlayerInvitationsParams) error

Link-player resend path: clear any open invite that would collide with the fresh one before it is inserted — either a prior invite for the same target row, or any open invite (targeted or plain) to the same (project_id, email). The open-invite unique index is keyed on (project_id, email) alone, so a pre-existing plain invite to the same address must be superseded too or the insert 409s.

func (*Queries) SealTenantCustomTokenSecret

func (q *Queries) SealTenantCustomTokenSecret(ctx context.Context, arg SealTenantCustomTokenSecretParams) (int64, error)

Compare-and-swap so the backfill never clobbers a concurrent update.

func (*Queries) SearchPlayerAccounts

func (q *Queries) SearchPlayerAccounts(ctx context.Context, arg SearchPlayerAccountsParams) ([]SearchPlayerAccountsRow, error)

Platform-admin search by email prefix. Bounded LIMIT keeps the scan cheap.

func (*Queries) SetAPIKeyScopes

func (q *Queries) SetAPIKeyScopes(ctx context.Context, arg SetAPIKeyScopesParams) error

func (*Queries) SetAllocationStatus

func (q *Queries) SetAllocationStatus(ctx context.Context, arg SetAllocationStatusParams) error

func (*Queries) SetAllowedOrigins

func (q *Queries) SetAllowedOrigins(ctx context.Context, arg SetAllowedOriginsParams) error

func (*Queries) SetControlPanelTOTPLastUsedStep

func (q *Queries) SetControlPanelTOTPLastUsedStep(ctx context.Context, arg SetControlPanelTOTPLastUsedStepParams) (int64, error)

The monotonic guard in the WHERE makes replay detection atomic: 0 rows means another request already consumed this timestep.

func (*Queries) SetControlPanelUserDisabled

func (q *Queries) SetControlPanelUserDisabled(ctx context.Context, arg SetControlPanelUserDisabledParams) error

Nullable timestamptz so the same query handles disable (now()) and enable (NULL).

func (*Queries) SetControlPanelUserVerificationCode

func (q *Queries) SetControlPanelUserVerificationCode(ctx context.Context, arg SetControlPanelUserVerificationCodeParams) error

func (*Queries) SetPlayerAccountDisabled

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

Platform-level disable. Bumps session_epoch to kill live sessions.

func (*Queries) SetPlayerAccountDisplayName

func (q *Queries) SetPlayerAccountDisplayName(ctx context.Context, arg SetPlayerAccountDisplayNameParams) error

Player-set display name (PATCH /v1/profile). NULL clears it.

func (*Queries) SetPlayerAccountEnabled

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

func (*Queries) SetPlayerAccountPassword

func (q *Queries) SetPlayerAccountPassword(ctx context.Context, arg SetPlayerAccountPasswordParams) error

Password change bumps session_epoch so every outstanding account session is invalidated on its next request.

func (*Queries) SetPlayerAccountRemoteAddrs

func (q *Queries) SetPlayerAccountRemoteAddrs(ctx context.Context, arg SetPlayerAccountRemoteAddrsParams) error

func (*Queries) SetPlayerAccountTOTPLastUsedStep

func (q *Queries) SetPlayerAccountTOTPLastUsedStep(ctx context.Context, arg SetPlayerAccountTOTPLastUsedStepParams) (int64, error)

func (*Queries) SetPlayerAccountVerificationCode

func (q *Queries) SetPlayerAccountVerificationCode(ctx context.Context, arg SetPlayerAccountVerificationCodeParams) error

func (*Queries) SetPlayerDisabled

func (q *Queries) SetPlayerDisabled(ctx context.Context, arg SetPlayerDisabledParams) error

func (*Queries) SetPlayerDisabledInProject

func (q *Queries) SetPlayerDisabledInProject(ctx context.Context, arg SetPlayerDisabledInProjectParams) (int64, error)

Project-level disable (NOT tenant-wide — a tenant-wide ban lives in tenant_player_bans). Bumps session_epoch so live JWTs are rejected at server-verify immediately. A pending delete request owns the disabled state: 0 rows on an existing player means "cancel the deletion first".

func (*Queries) SetPlayerDisabledSelf

func (q *Queries) SetPlayerDisabledSelf(ctx context.Context, id int64) (int64, error)

Self-service disable: the epoch bump revokes live access tokens through the middleware gate. 0 rows = already disabled or gone.

func (*Queries) SetPlayerFriendCode

func (q *Queries) SetPlayerFriendCode(ctx context.Context, arg SetPlayerFriendCodeParams) (int64, error)

Regenerate: overwrites unconditionally, invalidating the old code. 0 rows = soft-deleted or missing caller.

func (*Queries) SetPlayerFriendCodeIfAbsent

func (q *Queries) SetPlayerFriendCodeIfAbsent(ctx context.Context, arg SetPlayerFriendCodeIfAbsentParams) (int64, error)

Lazy first-read initialization: 0 rows means a concurrent reader won the race (re-read) or the caller already has a code.

func (*Queries) SetPlayerPasswordResetChallenge

func (q *Queries) SetPlayerPasswordResetChallenge(ctx context.Context, arg SetPlayerPasswordResetChallengeParams) error

Mints a fresh reset code: per-code attempts restart, lifetime attempts and the lockout survive so re-requesting codes never grants extra guesses.

func (*Queries) SetPlayerVerificationCode

func (q *Queries) SetPlayerVerificationCode(ctx context.Context, arg SetPlayerVerificationCodeParams) error

func (*Queries) SetPlayerVerificationCodeByID

func (q *Queries) SetPlayerVerificationCodeByID(ctx context.Context, arg SetPlayerVerificationCodeByIDParams) error

func (*Queries) SetProjectPublicJoining

func (q *Queries) SetProjectPublicJoining(ctx context.Context, arg SetProjectPublicJoiningParams) error

func (*Queries) SetPublicSignupEnabled

func (q *Queries) SetPublicSignupEnabled(ctx context.Context, arg SetPublicSignupEnabledParams) error

func (*Queries) SetTenantEnforceQuotas

func (q *Queries) SetTenantEnforceQuotas(ctx context.Context, arg SetTenantEnforceQuotasParams) error

Flip the per-tenant enforcement flag. Used by provisioning when the operator has enabled quota enforcement for new tenants. player_count is maintained for unenforced tenants too, so flipping this on later is safe as long as players were only ever created through the app's create paths.

func (*Queries) SetTenantPublicJoining

func (q *Queries) SetTenantPublicJoining(ctx context.Context, enabled bool) error

func (*Queries) SetTenantStorageNotifiedThreshold

func (q *Queries) SetTenantStorageNotifiedThreshold(ctx context.Context, arg SetTenantStorageNotifiedThresholdParams) error

func (*Queries) SetTenantTierByID

func (q *Queries) SetTenantTierByID(ctx context.Context, arg SetTenantTierByIDParams) (SetTenantTierByIDRow, error)

Platform-admin direct tier changes may move in either direction. Capture the prior tier under the same row lock so the audit record cannot race another administrator's update.

func (*Queries) SetTenantTierExact

func (q *Queries) SetTenantTierExact(ctx context.Context, tier int16) (int64, error)

Declarative entitlement apply: converge on an exact class in either direction (downgrades rely on the existing grace path). 0 rows = no-op. Runs in tenant RLS context.

func (*Queries) SetTenantTierIfUpgrade

func (q *Queries) SetTenantTierIfUpgrade(ctx context.Context, tier int16) (int64, error)

Auto-applied on tier-upgrade approval. The direction check and write are one atomic operation so a stale request can never lower the current tier.

func (*Queries) SoftDeleteFleet

func (q *Queries) SoftDeleteFleet(ctx context.Context, id int64) error

func (*Queries) SoftDeleteLeaderboard

func (q *Queries) SoftDeleteLeaderboard(ctx context.Context, arg SoftDeleteLeaderboardParams) (int64, error)

func (*Queries) SoftDeleteStorageObject

func (q *Queries) SoftDeleteStorageObject(ctx context.Context, arg SoftDeleteStorageObjectParams) (int64, error)

Soft-deletes and returns the freed byte count (octet_length(value::text)) so the caller can decrement the tenant storage counter in the same tx. Returns no rows when the object is already absent (delete is idempotent).

func (*Queries) StorageUsageForWrite

func (q *Queries) StorageUsageForWrite(ctx context.Context, arg StorageUsageForWriteParams) (StorageUsageForWriteRow, error)

One-shot inputs for the pre-write storage-quota check: the tenant's current metered total, the existing object's size (0 if new), and the incoming value's size — all measured as octet_length(value::text) so they match the counter maintained by ApplyTenantStorageDelta. Runs in the write tx (app.tenant_id set), serialized per object by LockStorageObjectForWrite.

func (*Queries) SubmitScore

func (q *Queries) SubmitScore(ctx context.Context, arg SubmitScoreParams) (int64, error)

Operator-aware upsert. 'best' keeps the better score by sort order, 'set' replaces, 'incr' adds. clamp_min/clamp_max bound the ACCUMULATED 'incr' total (the request-level bounds check only sees the delta, so without this a client could stack in-bounds deltas past score_max); callers pass NULL to leave the total unclamped. Metadata follows the standing score on 'best' (a worse run must not overwrite the record run's metadata) and the latest submission otherwise. Zero rows means the attempt cap blocked the write — the arbiter matched but the DO UPDATE WHERE refused it.

func (*Queries) SuppressEmail

func (q *Queries) SuppressEmail(ctx context.Context, email string) error

Idempotent: repeated unsubscribes are a no-op.

func (*Queries) SweepStaleMatchmakerClaims

func (q *Queries) SweepStaleMatchmakerClaims(ctx context.Context, maxAttempts int32) (SweepStaleMatchmakerClaimsRow, error)

Release every claim whose lease has expired. Same accounting as ReleaseMatchmakerClaim (bump attempts, fail at the cap). Runs out of a detached context so it isn't tied to any request lifetime. Returns the number of claims released and, of those, how many flipped to 'failed' at the cap so the caller can meter the attempts_exhausted failure counter.

func (*Queries) TenantNameTaken

func (q *Queries) TenantNameTaken(ctx context.Context, arg TenantNameTakenParams) (bool, error)

A name is taken if an active tenant has it, or another live (pending/approved) signup request claims it. exclude_request_id lets the approve re-check ignore the request being approved; pass 0 at submit time.

func (*Queries) TopN

func (q *Queries) TopN(ctx context.Context, arg TopNParams) ([]TopNRow, error)

display_name rides along from the entry's linked global account (NULL for anonymous players); joining pp/a cannot fan out because pp.id is unique.

func (*Queries) TouchControlPanelSession

func (q *Queries) TouchControlPanelSession(ctx context.Context, arg TouchControlPanelSessionParams) error

func (*Queries) TouchControlPanelUserConnection

func (q *Queries) TouchControlPanelUserConnection(ctx context.Context, arg TouchControlPanelUserConnectionParams) error

func (*Queries) TouchGameSessionPeer

func (q *Queries) TouchGameSessionPeer(ctx context.Context, arg TouchGameSessionPeerParams) (int64, error)

Returns rows affected (0 when the caller isn't a member of the session) so the heartbeat handler can reject non-members instead of leaking the roster.

func (*Queries) TouchMCPTokenLastUsed

func (q *Queries) TouchMCPTokenLastUsed(ctx context.Context, id int64) error

At most one write per minute for each token.

func (*Queries) TouchPlayerAccountConnection

func (q *Queries) TouchPlayerAccountConnection(ctx context.Context, arg TouchPlayerAccountConnectionParams) error

func (*Queries) UnlinkPlayerFromAccount

func (q *Queries) UnlinkPlayerFromAccount(ctx context.Context, arg UnlinkPlayerFromAccountParams) (int64, error)

Player-initiated, non-destructive unlink. The row and its game data stay; the account link goes inactive and player-credential auth is blocked (unlinked_at filters on the auth queries). The epoch bump kills live access tokens immediately; the caller also revokes the player's sessions. The account guard stops one account from unlinking another account's player. A pending deletion blocks the unlink: severing the link would remove the portal's only cancellation path while the purge stays scheduled.

func (*Queries) UpdateAPIKeyLabel

func (q *Queries) UpdateAPIKeyLabel(ctx context.Context, arg UpdateAPIKeyLabelParams) error

func (*Queries) UpdateControlPanelPassword

func (q *Queries) UpdateControlPanelPassword(ctx context.Context, arg UpdateControlPanelPasswordParams) error

func (*Queries) UpdateFleet

func (q *Queries) UpdateFleet(ctx context.Context, arg UpdateFleetParams) error

func (*Queries) UpdateGameSessionState

func (q *Queries) UpdateGameSessionState(ctx context.Context, arg UpdateGameSessionStateParams) error

func (*Queries) UpdateLeaderboard

func (q *Queries) UpdateLeaderboard(ctx context.Context, arg UpdateLeaderboardParams) (int64, error)

score_operator and current_period are deliberately absent: the operator is fixed at creation and the period only moves via AdvanceLeaderboardPeriod.

func (*Queries) UpdatePlayerPassword

func (q *Queries) UpdatePlayerPassword(ctx context.Context, arg UpdatePlayerPasswordParams) error

func (*Queries) UpdateProfileEmail

func (q *Queries) UpdateProfileEmail(ctx context.Context, arg UpdateProfileEmailParams) error

Profile updates are deliberately narrow — only fields explicitly enumerated server-side may change. PATCHing email re-triggers the verify flow (handler clears email_verified_at).

func (*Queries) UpdateProfileXuid

func (q *Queries) UpdateProfileXuid(ctx context.Context, arg UpdateProfileXuidParams) error

Self-set secondary identifier. NULL clears it. The unique partial index on (project_id, xuid) rejects collisions with a constraint violation.

func (*Queries) UpdateProjectSteamAuthConfig

func (q *Queries) UpdateProjectSteamAuthConfig(ctx context.Context, arg UpdateProjectSteamAuthConfigParams) (int64, error)

A NULL key keeps the stored one, so the settings form can update the app id without re-entering the secret (replace-on-write).

func (*Queries) UpdateRemoteConfig

func (q *Queries) UpdateRemoteConfig(ctx context.Context, arg UpdateRemoteConfigParams) (int64, error)

func (*Queries) UpdateTenantCustomTokenPublicKey

func (q *Queries) UpdateTenantCustomTokenPublicKey(ctx context.Context, arg UpdateTenantCustomTokenPublicKeyParams) (int64, error)

func (*Queries) UpsertConnectionLimitOverride

func (q *Queries) UpsertConnectionLimitOverride(ctx context.Context, arg UpsertConnectionLimitOverrideParams) error

func (*Queries) UpsertControlPanelTOTPPending

func (q *Queries) UpsertControlPanelTOTPPending(ctx context.Context, arg UpsertControlPanelTOTPPendingParams) (int64, error)

Starts (or restarts) enrollment. The WHERE guard makes this a no-op for a confirmed credential — zero rows means "already enabled", so a stray setup POST can never silently replace a live secret.

func (*Queries) UpsertFriendEdgeStatusByAccount

func (q *Queries) UpsertFriendEdgeStatusByAccount(ctx context.Context, arg UpsertFriendEdgeStatusByAccountParams) error

Used for block: create-or-overwrite the directed edge to a terminal status regardless of the prior state (blocking a stranger, a pending, or a friend).

func (*Queries) UpsertGameSessionPeer

func (q *Queries) UpsertGameSessionPeer(ctx context.Context, arg UpsertGameSessionPeerParams) error

func (*Queries) UpsertPlayerAccountTOTPPending

func (q *Queries) UpsertPlayerAccountTOTPPending(ctx context.Context, arg UpsertPlayerAccountTOTPPendingParams) (pgtype.UUID, error)

Player-account mirrors of control_panel_totp.sql; see the comments there for the atomicity rationale on each statement.

func (*Queries) UpsertPlayerByExternalID

func (q *Queries) UpsertPlayerByExternalID(ctx context.Context, arg UpsertPlayerByExternalIDParams) (int64, error)

Custom-token flow: find existing player with this external_id under (tenant, project) or create one. Idempotent across repeated calls.

func (*Queries) UpsertPresence

func (q *Queries) UpsertPresence(ctx context.Context, arg UpsertPresenceParams) error

func (*Queries) UpsertQuotaOverride

func (q *Queries) UpsertQuotaOverride(ctx context.Context, arg UpsertQuotaOverrideParams) error

Write one axis override. Platform-admin only (directly or via an approved change request); the axis CHECK constraint rejects unknown axes.

func (*Queries) UpsertRateLimitOverride

func (q *Queries) UpsertRateLimitOverride(ctx context.Context, arg UpsertRateLimitOverrideParams) error

func (*Queries) UpsertTenantFeatureGrant

func (q *Queries) UpsertTenantFeatureGrant(ctx context.Context, arg UpsertTenantFeatureGrantParams) error

Auto-applied on feature-request approval. Tenant-level grant (project_id NULL); runs in tenant RLS context.

func (*Queries) WithTx

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

func (*Queries) WriteAudit

func (q *Queries) WriteAudit(ctx context.Context, arg WriteAuditParams) error

func (*Queries) WritePlatformAudit

func (q *Queries) WritePlatformAudit(ctx context.Context, arg WritePlatformAuditParams) error

type RateLimitOverride

type RateLimitOverride struct {
	ID        int64
	TenantID  int64
	ProjectID *int64
	Kind      string
	Rate      float64
	Burst     float64
	UpdatedBy *int64
	UpdatedAt pgtype.Timestamptz
}

type RealtimeConnectionCapState

type RealtimeConnectionCapState struct {
	TenantID         int64
	Region           string
	Sustained        int64
	Ceiling          int64
	BurstRemainingNs int64
	LastAssessedAt   pgtype.Timestamptz
	UpdatedAt        pgtype.Timestamptz
}

type RealtimeConnectionGrant

type RealtimeConnectionGrant struct {
	TenantID  int64
	Region    string
	HolderID  string
	Allocated int64
	Used      int64
	ExpiresAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
}

type RealtimeTicket

type RealtimeTicket struct {
	ID           int64
	TenantID     int64
	TicketHash   []byte
	ApiKeyHash   []byte
	PlayerID     int64
	ProjectID    int64
	SessionEpoch int64
	ExpiresAt    pgtype.Timestamptz
}

type RecordRelayNodeProbeParams

type RecordRelayNodeProbeParams struct {
	Ok                bool
	ProbeError        *string
	LifecycleState    *string
	ActiveAllocations *int64
	NodeID            int64
}

type RecordRelayNodeProbeRow

type RecordRelayNodeProbeRow struct {
	PrevProbeAt    pgtype.Timestamptz
	PrevProbeOk    bool
	PrevProbeError *string
}

type RedeemRealtimeTicketRow

type RedeemRealtimeTicketRow struct {
	TenantID     int64
	ApiKeyHash   []byte
	PlayerID     int64
	ProjectID    int64
	SessionEpoch int64
}

type RelayNode

type RelayNode struct {
	ID                    int64
	Region                string
	TurnUrls              []string
	LifecycleUrl          string
	State                 string
	LastProbeAt           pgtype.Timestamptz
	LastProbeOk           bool
	LastProbeError        *string
	LastLifecycleState    *string
	LastActiveAllocations *int64
	CreatedAt             pgtype.Timestamptz
	UpdatedAt             pgtype.Timestamptz
}

type RelaySessionUsage

type RelaySessionUsage struct {
	TenantID    int64
	Month       pgtype.Date
	Sessions    int64
	Warned80At  pgtype.Timestamptz
	Warned100At pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
}

type ReleaseMatchmakerTicketsParams

type ReleaseMatchmakerTicketsParams struct {
	MaxAttempts int32
	ClaimID     pgtype.UUID
	TicketIds   []int64
}

type ReplacePlayerExternalIDParams

type ReplacePlayerExternalIDParams struct {
	NewExternalID string
	ID            int64
	OldExternalID string
}

type RequestFriendByAccountParams

type RequestFriendByAccountParams struct {
	FromAccountID pgtype.UUID
	ToAccountID   pgtype.UUID
}

type RequestFriendByAccountRow

type RequestFriendByAccountRow struct {
	ID     int64
	Status string
}

type RequestPlayerDeleteByAccountParams

type RequestPlayerDeleteByAccountParams struct {
	ID              int64
	PlayerAccountID pgtype.UUID
}

type RequestPlayerDeleteInProjectParams

type RequestPlayerDeleteInProjectParams struct {
	ID        int64
	ProjectID int64
	TenantID  int64
}

type ReserveControlPanelTOTPAttemptParams

type ReserveControlPanelTOTPAttemptParams struct {
	MaxAttempts        int32
	LockoutUntil       pgtype.Timestamptz
	ControlPanelUserID int64
}

type ReserveControlPanelTOTPAttemptRow

type ReserveControlPanelTOTPAttemptRow struct {
	Attempts    int32
	LockedUntil pgtype.Timestamptz
}

type ReserveControlPanelVerifyAttemptParams

type ReserveControlPanelVerifyAttemptParams struct {
	ID          int64
	MaxAttempts int32
}

type ReserveControlPanelVerifyAttemptRow

type ReserveControlPanelVerifyAttemptRow struct {
	EmailVerificationAttempts         int32
	EmailVerificationLifetimeAttempts int32
}

type ReservePlayerAccountTOTPAttemptParams

type ReservePlayerAccountTOTPAttemptParams struct {
	MaxAttempts     int32
	LockoutUntil    pgtype.Timestamptz
	PlayerAccountID pgtype.UUID
}

type ReservePlayerAccountTOTPAttemptRow

type ReservePlayerAccountTOTPAttemptRow struct {
	Attempts    int32
	LockedUntil pgtype.Timestamptz
}

type ReservePlayerAccountVerifyAttemptParams

type ReservePlayerAccountVerifyAttemptParams struct {
	ID          pgtype.UUID
	MaxAttempts int32
}

type ReservePlayerAccountVerifyAttemptRow

type ReservePlayerAccountVerifyAttemptRow struct {
	EmailVerificationAttempts         int32
	EmailVerificationLifetimeAttempts int32
}

type ReservePlayerPasswordResetAttemptParams

type ReservePlayerPasswordResetAttemptParams struct {
	ID          int64
	MaxAttempts int32
}

type ReservePlayerPasswordResetAttemptRow

type ReservePlayerPasswordResetAttemptRow struct {
	PasswordResetAttempts         int32
	PasswordResetLifetimeAttempts int32
}

type ReservePlayerVerifyAttemptParams

type ReservePlayerVerifyAttemptParams struct {
	ID          int64
	MaxAttempts int32
}

type ReservePlayerVerifyAttemptRow

type ReservePlayerVerifyAttemptRow struct {
	EmailVerificationAttempts         int32
	EmailVerificationLifetimeAttempts int32
}

type ResolvePendingFriendEdgeParams

type ResolvePendingFriendEdgeParams struct {
	Status        string
	FromAccountID pgtype.UUID
	ToAccountID   pgtype.UUID
}

type ResolvePlayersForAccountsInProjectParams

type ResolvePlayersForAccountsInProjectParams struct {
	ProjectID  int64
	AccountIds []pgtype.UUID
}

type ResolvePlayersForAccountsInProjectRow

type ResolvePlayersForAccountsInProjectRow struct {
	PlayerID        int64
	PlayerAccountID pgtype.UUID
}

type RestoreControlPanelUserVerificationCodeParams

type RestoreControlPanelUserVerificationCodeParams struct {
	PreviousCodeHash   []byte
	PreviousCodeSalt   []byte
	PreviousExpiresAt  pgtype.Timestamptz
	PreviousAttempts   int32
	PreviousLastSentAt pgtype.Timestamptz
	ID                 int64
	ExpectedCodeHash   []byte
}

type RestoreLeaderboardParams

type RestoreLeaderboardParams struct {
	ProjectID int64
	ID        int64
}

type RestorePlayerAccountVerificationCodeParams

type RestorePlayerAccountVerificationCodeParams struct {
	PreviousCodeHash   []byte
	PreviousCodeSalt   []byte
	PreviousExpiresAt  pgtype.Timestamptz
	PreviousAttempts   int32
	PreviousLastSentAt pgtype.Timestamptz
	ID                 pgtype.UUID
	ExpectedCodeHash   []byte
}

type ReturnMatchmakerTicketsByIDParams

type ReturnMatchmakerTicketsByIDParams struct {
	ClaimID   pgtype.UUID
	TicketIds []int64
}

type RevokeActivePlayerSessionsParams

type RevokeActivePlayerSessionsParams struct {
	ProjectID int64
	PlayerID  int64
}

type RevokeControlPanelInvitationParams

type RevokeControlPanelInvitationParams struct {
	ID       int64
	TenantID *int64
}

type RevokeMCPTokenParams

type RevokeMCPTokenParams struct {
	ProjectID int64
	ID        int64
}

type RevokeOtherControlPanelSessionsForUserParams

type RevokeOtherControlPanelSessionsForUserParams struct {
	ControlPanelUserID int64
	KeepSessionID      int64
}

type RevokeOtherPlayerAccountSessionsParams

type RevokeOtherPlayerAccountSessionsParams struct {
	PlayerAccountID pgtype.UUID
	KeepRefreshHash []byte
}

type RevokeSupersededPlayerInvitationsParams

type RevokeSupersededPlayerInvitationsParams struct {
	ProjectID       int64
	ProjectPlayerID *int64
	Email           string
}

type RiverClient

type RiverClient struct {
	ID        string
	CreatedAt pgtype.Timestamptz
	Metadata  []byte
	PausedAt  pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
}

type RiverClientQueue

type RiverClientQueue struct {
	RiverClientID    string
	Name             string
	CreatedAt        pgtype.Timestamptz
	MaxWorkers       int64
	Metadata         []byte
	NumJobsCompleted int64
	NumJobsRunning   int64
	UpdatedAt        pgtype.Timestamptz
}

type RiverJob

type RiverJob struct {
	ID           int64
	State        RiverJobState
	Attempt      int16
	MaxAttempts  int16
	AttemptedAt  pgtype.Timestamptz
	CreatedAt    pgtype.Timestamptz
	FinalizedAt  pgtype.Timestamptz
	ScheduledAt  pgtype.Timestamptz
	Priority     int16
	Args         []byte
	AttemptedBy  []string
	Errors       [][]byte
	Kind         string
	Metadata     []byte
	Queue        string
	Tags         []string
	UniqueKey    []byte
	UniqueStates pgtype.Bits
}

type RiverJobState

type RiverJobState string
const (
	RiverJobStateAvailable RiverJobState = "available"
	RiverJobStateCancelled RiverJobState = "cancelled"
	RiverJobStateCompleted RiverJobState = "completed"
	RiverJobStateDiscarded RiverJobState = "discarded"
	RiverJobStatePending   RiverJobState = "pending"
	RiverJobStateRetryable RiverJobState = "retryable"
	RiverJobStateRunning   RiverJobState = "running"
	RiverJobStateScheduled RiverJobState = "scheduled"
)

func (*RiverJobState) Scan

func (e *RiverJobState) Scan(src interface{}) error

type RiverLeader

type RiverLeader struct {
	ElectedAt pgtype.Timestamptz
	ExpiresAt pgtype.Timestamptz
	LeaderID  string
	Name      string
}

type RiverQueue

type RiverQueue struct {
	Name      string
	CreatedAt pgtype.Timestamptz
	Metadata  []byte
	PausedAt  pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
}

type SealTenantCustomTokenSecretParams

type SealTenantCustomTokenSecretParams struct {
	Sealed   []byte
	ID       int64
	Previous []byte
}

type SearchPlayerAccountsParams

type SearchPlayerAccountsParams struct {
	Query    string
	RowLimit int32
}

type SearchPlayerAccountsRow

type SearchPlayerAccountsRow struct {
	ID              pgtype.UUID
	Email           string
	DisplayName     *string
	EmailVerifiedAt pgtype.Timestamptz
	DisabledAt      pgtype.Timestamptz
	CreatedAt       pgtype.Timestamptz
}

type ServerSecret

type ServerSecret struct {
	Name      string
	Value     []byte
	CreatedAt pgtype.Timestamptz
}

type Session

type Session struct {
	ID            int64
	TenantID      int64
	PlayerID      int64
	RefreshHash   []byte
	ExpiresAt     pgtype.Timestamptz
	RevokedAt     pgtype.Timestamptz
	CreatedAt     pgtype.Timestamptz
	ProjectID     int64
	RevokedReason *string
}

type SetAPIKeyScopesParams

type SetAPIKeyScopesParams struct {
	Scopes []string
	ID     int64
}

type SetAllocationStatusParams

type SetAllocationStatusParams struct {
	ID     int64
	Status AllocationStatus
}

type SetAllowedOriginsParams

type SetAllowedOriginsParams struct {
	Origins   []string
	ProjectID int64
}

type SetControlPanelTOTPLastUsedStepParams

type SetControlPanelTOTPLastUsedStepParams struct {
	LastUsedStep       int64
	ControlPanelUserID int64
}

type SetControlPanelUserDisabledParams

type SetControlPanelUserDisabledParams struct {
	DisabledAt pgtype.Timestamptz
	ID         int64
}

type SetControlPanelUserVerificationCodeParams

type SetControlPanelUserVerificationCodeParams struct {
	CodeHash  []byte
	CodeSalt  []byte
	ExpiresAt pgtype.Timestamptz
	ID        int64
}

type SetPlayerAccountDisplayNameParams

type SetPlayerAccountDisplayNameParams struct {
	DisplayName *string
	ID          pgtype.UUID
}

type SetPlayerAccountPasswordParams

type SetPlayerAccountPasswordParams struct {
	PasswordHash []byte
	ID           pgtype.UUID
}

type SetPlayerAccountRemoteAddrsParams

type SetPlayerAccountRemoteAddrsParams struct {
	RemoteAddrIpLan    *string
	RemoteAddrIpPublic *string
	RemoteAddrDns      *string
	RemoteAddrIroh     *string
	ID                 pgtype.UUID
}

type SetPlayerAccountTOTPLastUsedStepParams

type SetPlayerAccountTOTPLastUsedStepParams struct {
	LastUsedStep    int64
	PlayerAccountID pgtype.UUID
}

type SetPlayerAccountVerificationCodeParams

type SetPlayerAccountVerificationCodeParams struct {
	CodeHash  []byte
	CodeSalt  []byte
	ExpiresAt pgtype.Timestamptz
	ID        pgtype.UUID
}

type SetPlayerDisabledInProjectParams

type SetPlayerDisabledInProjectParams struct {
	DisabledAt pgtype.Timestamptz
	ID         int64
	ProjectID  int64
	TenantID   int64
}

type SetPlayerDisabledParams

type SetPlayerDisabledParams struct {
	ID         int64
	DisabledAt pgtype.Timestamptz
}

type SetPlayerFriendCodeIfAbsentParams

type SetPlayerFriendCodeIfAbsentParams struct {
	FriendCode *string
	ID         int64
}

type SetPlayerFriendCodeParams

type SetPlayerFriendCodeParams struct {
	FriendCode *string
	ID         int64
}

type SetPlayerPasswordResetChallengeParams

type SetPlayerPasswordResetChallengeParams struct {
	CodeHash  []byte
	Salt      []byte
	ExpiresAt pgtype.Timestamptz
	ID        int64
}

type SetPlayerVerificationCodeByIDParams

type SetPlayerVerificationCodeByIDParams struct {
	CodeHash  []byte
	CodeSalt  []byte
	ExpiresAt pgtype.Timestamptz
	ID        int64
}

type SetPlayerVerificationCodeParams

type SetPlayerVerificationCodeParams struct {
	ProjectID                  int64
	ID                         int64
	EmailVerificationCodeHash  []byte
	EmailVerificationSalt      []byte
	EmailVerificationExpiresAt pgtype.Timestamptz
}

type SetProjectPublicJoiningParams

type SetProjectPublicJoiningParams struct {
	Enabled   bool
	ProjectID int64
}

type SetPublicSignupEnabledParams

type SetPublicSignupEnabledParams struct {
	Enabled   bool
	UpdatedBy *int64
}

type SetTenantEnforceQuotasParams

type SetTenantEnforceQuotasParams struct {
	EnforceQuotas bool
	TenantID      int64
}

type SetTenantStorageNotifiedThresholdParams

type SetTenantStorageNotifiedThresholdParams struct {
	Threshold int16
	TenantID  int64
}

type SetTenantTierByIDParams

type SetTenantTierByIDParams struct {
	TenantID int64
	Tier     int16
}

type SetTenantTierByIDRow

type SetTenantTierByIDRow struct {
	OldTier int16
	NewTier int16
}

type SettingsRevision

type SettingsRevision struct {
	ID           int64
	TenantID     int64
	ProjectID    int64
	ResourceKind string
	ResourceID   int64
	Revision     int64
	Snapshot     []byte
	ActorUserID  *int64
	McpTokenID   *int64
	Source       string
	CreatedAt    pgtype.Timestamptz
}

type SoftDeleteLeaderboardParams

type SoftDeleteLeaderboardParams struct {
	ProjectID int64
	ID        int64
}

type SoftDeleteStorageObjectParams

type SoftDeleteStorageObjectParams struct {
	ProjectID   int64
	OwnerUserID int64
	Key         string
}

type StorageLimit

type StorageLimit struct {
	ID            int64
	TenantID      int64
	ProjectID     *int64
	MaxValueBytes int64
	UpdatedBy     *int64
	UpdatedAt     pgtype.Timestamptz
}

type StorageObject

type StorageObject struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	OwnerUserID int64
	Key         string
	Value       []byte
	Version     int64
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
	DeletedAt   pgtype.Timestamptz
}

type StorageUsageForWriteParams

type StorageUsageForWriteParams struct {
	ProjectID   int64
	OwnerUserID int64
	Key         string
	NewValue    []byte
}

type StorageUsageForWriteRow

type StorageUsageForWriteRow struct {
	TotalBytes int64
	OldBytes   int64
	NewBytes   int64
}

type SubmitScoreParams

type SubmitScoreParams struct {
	LeaderboardID int64
	PlayerID      int64
	Period        int32
	Score         int64
	Metadata      []byte
	ScoreOperator string
	ClampMin      *int64
	ClampMax      *int64
	SortOrder     string
	AttemptCap    *int32
}

type SweepStaleMatchmakerClaimsRow

type SweepStaleMatchmakerClaimsRow struct {
	Released int64
	Failed   int64
}

type Tenant

type Tenant struct {
	ID                   int64
	Name                 string
	CreatedAt            pgtype.Timestamptz
	DeletedAt            pgtype.Timestamptz
	PublicJoiningEnabled bool
	Tier                 int16
	EnforceQuotas        bool
	PlayerCount          int64
	DisabledAt           pgtype.Timestamptz
	DisabledBy           *string
	CustomTokenPublicKey string
}

type TenantChangeRequest

type TenantChangeRequest struct {
	ID                int64
	TenantID          int64
	RequestedByUserID *int64
	Kind              string
	RequestedTier     *int16
	Feature           *string
	Note              string
	Status            string
	ReviewedByUserID  *int64
	ReviewedAt        pgtype.Timestamptz
	ReviewReason      *string
	CreatedAt         pgtype.Timestamptz
	RequestedLimit    *int64
}

type TenantNameTakenParams

type TenantNameTakenParams struct {
	Name             string
	ExcludeRequestID int64
}

type TenantPlayerBan

type TenantPlayerBan struct {
	ID              int64
	TenantID        int64
	PlayerAccountID pgtype.UUID
	Reason          *string
	CreatedBy       *int64
	CreatedAt       pgtype.Timestamptz
}

type TenantQuotaOverride

type TenantQuotaOverride struct {
	TenantID  int64
	Axis      string
	Limit     int64
	UpdatedBy *int64
	UpdatedAt pgtype.Timestamptz
}

type TenantSignupRequest

type TenantSignupRequest struct {
	ID                  int64
	Email               string
	RequestedTenantName string
	FinalTenantName     *string
	ProjectDescription  string
	StudioName          *string
	Status              string
	CodeHash            []byte
	CodeExpiresAt       pgtype.Timestamptz
	ReviewedByUserID    *int64
	ReviewedAt          pgtype.Timestamptz
	ReviewReason        *string
	TenantID            *int64
	AcceptedAt          pgtype.Timestamptz
	CreatedAt           pgtype.Timestamptz
}

type TenantStorageUsage

type TenantStorageUsage struct {
	TenantID              int64
	TotalBytes            int64
	LastNotifiedThreshold int16
	UpdatedAt             pgtype.Timestamptz
}

type TicketStatus

type TicketStatus string
const (
	TicketStatusQueued    TicketStatus = "queued"
	TicketStatusMatched   TicketStatus = "matched"
	TicketStatusCancelled TicketStatus = "cancelled"
	TicketStatusFailed    TicketStatus = "failed"
)

func (*TicketStatus) Scan

func (e *TicketStatus) Scan(src interface{}) error

type TopNParams

type TopNParams struct {
	LeaderboardID int64
	Period        int32
	ProjectID     int64
	RowLimit      int32
}

type TopNRow

type TopNRow struct {
	PlayerID    int64
	Score       int64
	Metadata    []byte
	DisplayName *string
}

type TouchControlPanelSessionParams

type TouchControlPanelSessionParams struct {
	ExpiresAt pgtype.Timestamptz
	ID        int64
}

type TouchControlPanelUserConnectionParams

type TouchControlPanelUserConnectionParams struct {
	Provider string
	Subject  string
}

type TouchGameSessionPeerParams

type TouchGameSessionPeerParams struct {
	Qos       []byte
	SessionID string
	PlayerID  int64
}

type TouchPlayerAccountConnectionParams

type TouchPlayerAccountConnectionParams struct {
	Provider string
	Subject  string
}

type UnlinkPlayerFromAccountParams

type UnlinkPlayerFromAccountParams struct {
	ID              int64
	PlayerAccountID pgtype.UUID
}

type UpdateAPIKeyLabelParams

type UpdateAPIKeyLabelParams struct {
	Label string
	ID    int64
}

type UpdateControlPanelPasswordParams

type UpdateControlPanelPasswordParams struct {
	PasswordHash []byte
	ID           int64
}

type UpdateFleetParams

type UpdateFleetParams struct {
	Name    string
	Backend string
	Config  []byte
	ID      int64
}

type UpdateGameSessionStateParams

type UpdateGameSessionStateParams struct {
	State     string
	ProjectID int64
	ID        string
}

type UpdateLeaderboardParams

type UpdateLeaderboardParams struct {
	Name              string
	SortOrder         string
	Metadata          []byte
	ClientSubmissions bool
	ScoreMin          *int64
	ScoreMax          *int64
	ResetSchedule     string
	AttemptCap        *int32
	PeriodStartedAt   pgtype.Timestamptz
	NextResetAt       pgtype.Timestamptz
	ProjectID         int64
	ID                int64
}

type UpdatePlayerPasswordParams

type UpdatePlayerPasswordParams struct {
	PasswordHash []byte
	ID           int64
}

type UpdateProfileEmailParams

type UpdateProfileEmailParams struct {
	ID                         int64
	Email                      *string
	EmailVerificationCodeHash  []byte
	EmailVerificationSalt      []byte
	EmailVerificationExpiresAt pgtype.Timestamptz
}

type UpdateProfileXuidParams

type UpdateProfileXuidParams struct {
	Xuid *string
	ID   int64
}

type UpdateProjectSteamAuthConfigParams

type UpdateProjectSteamAuthConfigParams struct {
	SteamAppID     string
	SteamWebAPIKey []byte
	ProjectID      int64
}

type UpdateRemoteConfigParams

type UpdateRemoteConfigParams struct {
	RemoteConfig []byte
	ProjectID    int64
}

type UpdateTenantCustomTokenPublicKeyParams

type UpdateTenantCustomTokenPublicKeyParams struct {
	PublicKey string
	TenantID  int64
}

type UpsertConnectionLimitOverrideParams

type UpsertConnectionLimitOverrideParams struct {
	TenantID  int64
	Sustained int64
	Ceiling   int64
	UpdatedBy *int64
}

type UpsertControlPanelTOTPPendingParams

type UpsertControlPanelTOTPPendingParams struct {
	ControlPanelUserID int64
	SecretEnc          []byte
}

type UpsertFriendEdgeStatusByAccountParams

type UpsertFriendEdgeStatusByAccountParams struct {
	FromAccountID pgtype.UUID
	ToAccountID   pgtype.UUID
	Status        string
}

type UpsertGameSessionPeerParams

type UpsertGameSessionPeerParams struct {
	SessionID string
	PlayerID  int64
	Ip        *string
	Port      *int32
	Qos       []byte
}

type UpsertPlayerAccountTOTPPendingParams

type UpsertPlayerAccountTOTPPendingParams struct {
	PlayerAccountID pgtype.UUID
	SecretEnc       []byte
}

type UpsertPlayerByExternalIDParams

type UpsertPlayerByExternalIDParams struct {
	ProjectID  int64
	ExternalID string
}

type UpsertPresenceParams

type UpsertPresenceParams struct {
	PlayerID  int64
	Status    string
	SessionID *string
}

type UpsertQuotaOverrideParams

type UpsertQuotaOverrideParams struct {
	TenantID   int64
	Axis       string
	LimitValue int64
	UpdatedBy  *int64
}

type UpsertRateLimitOverrideParams

type UpsertRateLimitOverrideParams struct {
	TenantID  int64
	Kind      string
	Rate      float64
	Burst     float64
	ProjectID *int64
	UpdatedBy *int64
}

type UpsertTenantFeatureGrantParams

type UpsertTenantFeatureGrantParams struct {
	Feature    string
	ApprovedBy *int64
	Reason     *string
}

type UsageSample

type UsageSample struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type UsageSamples202607

type UsageSamples202607 struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type UsageSamples202608

type UsageSamples202608 struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type UsageSamples202609

type UsageSamples202609 struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type UsageSamples202610

type UsageSamples202610 struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type UsageSamples202611

type UsageSamples202611 struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type UsageSamples202612

type UsageSamples202612 struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type UsageSamples202701

type UsageSamples202701 struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type UsageSamples202702

type UsageSamples202702 struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type UsageSamples202703

type UsageSamples202703 struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type UsageSamples202704

type UsageSamples202704 struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type UsageSamples202705

type UsageSamples202705 struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type UsageSamples202706

type UsageSamples202706 struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type UsageSamplesDefault

type UsageSamplesDefault struct {
	ID          int64
	TenantID    int64
	ProjectID   int64
	Ts          pgtype.Timestamptz
	Ccu         int32
	Requests    int64
	BytesEgress int64
}

type WriteAuditParams

type WriteAuditParams struct {
	ActorUserID  *int64
	Action       string
	Target       *string
	Payload      []byte
	ActorService *string
}

type WritePlatformAuditParams

type WritePlatformAuditParams struct {
	ActorUserID  *int64
	Action       string
	Target       *string
	Payload      []byte
	ActorService *string
}

Jump to

Keyboard shortcuts

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