db

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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
}

type DelegatedUserTouchParams

type DelegatedUserTouchParams struct {
	TenantID string
	Issuer   string
	Subject  string
}

type DelegatedUserTouchRow

type DelegatedUserTouchRow struct {
	ID         string
	Issuer     string
	Subject    string
	CreatedAt  time.Time
	LastSeenAt time.Time
}

type GlobalRoleUpsertParams

type GlobalRoleUpsertParams struct {
	Name        string
	Slug        string
	Description *string
}

type GlobalUserHasActiveRoleParams

type GlobalUserHasActiveRoleParams struct {
	UserID string
	Slug   string
}

type GlobalUserRoleDeleteBySlugParams

type GlobalUserRoleDeleteBySlugParams struct {
	UserID string
	Slug   string
}

type GlobalUserRoleDeleteParams

type GlobalUserRoleDeleteParams struct {
	UserID string
	RoleID string
}

type GlobalUserRoleExistsParams

type GlobalUserRoleExistsParams struct {
	UserID string
	RoleID string
}

type GlobalUserRoleInsertParams

type GlobalUserRoleInsertParams struct {
	ID     string
	UserID string
	RoleID string
}

type IdentityUpdateUserEmailParams

type IdentityUpdateUserEmailParams struct {
	ID    string
	Email *string
}

type IdentityUpdateUserUsernameParams

type IdentityUpdateUserUsernameParams struct {
	ID       string
	Username *string
}

type IdentityUserByIDRow

type IdentityUserByIDRow struct {
	ID            string
	Email         *string
	Username      *string
	EmailVerified bool
}

type IdentityUsersByIDsRow

type IdentityUsersByIDsRow struct {
	ID       string
	Username *string
	Email    *string
}

type NamespaceTenantBySlugRow

type NamespaceTenantBySlugRow struct {
	ID          string
	Slug        string
	IsPersonal  bool
	OwnerUserID string
	Deleted     bool
	StateRaw    string
	Reserved    bool
}

type NamespaceTenantRenameBySlugRow

type NamespaceTenantRenameBySlugRow struct {
	ID          string
	Slug        string
	IsPersonal  bool
	OwnerUserID string
	Deleted     bool
	RenamedAt   time.Time
}

type NamespaceUserBySlugRow

type NamespaceUserBySlugRow struct {
	ID       string
	Username string
	Deleted  bool
	Reserved bool
}

type NamespaceUserRenameBySlugRow

type NamespaceUserRenameBySlugRow struct {
	ID        string
	Username  string
	Deleted   bool
	RenamedAt time.Time
}

type OwnerSlugConflictExistsParams

type OwnerSlugConflictExistsParams struct {
	Slug        string
	ReuseCutoff time.Time
}

type OwnerSlugTenantExistsParams

type OwnerSlugTenantExistsParams struct {
	Slug            string
	ExcludeTenantID string
}

type OwnerSlugTenantRenameHeldParams

type OwnerSlugTenantRenameHeldParams struct {
	Slug            string
	ReuseCutoff     time.Time
	ExcludeTenantID string
}

type OwnerSlugUserExistsParams

type OwnerSlugUserExistsParams struct {
	Slug          string
	ExcludeUserID string
}

type OwnerSlugUserRenameHeldParams

type OwnerSlugUserRenameHeldParams struct {
	Slug          string
	ReuseCutoff   time.Time
	ExcludeUserID string
}

type PersonalTenantByOwnerRow

type PersonalTenantByOwnerRow struct {
	ID          string
	Slug        string
	IsPersonal  bool
	OwnerUserID string
}

type PersonalTenantIDSlugByOwnerRow

type PersonalTenantIDSlugByOwnerRow struct {
	ID   string
	Slug string
}

type PersonalTenantIDSlugReservedByOwnerRow

type PersonalTenantIDSlugReservedByOwnerRow struct {
	ID       string
	Slug     string
	Reserved bool
}

type PersonalTenantInsertBasicParams

type PersonalTenantInsertBasicParams struct {
	ID          string
	Slug        string
	OwnerUserID string
}

type PersonalTenantUpsertParams

type PersonalTenantUpsertParams struct {
	ID          string
	Slug        string
	OwnerUserID string
}

type ProfilesDelegatedUser

type ProfilesDelegatedUser struct {
	ID         string
	TenantID   string
	Issuer     string
	Subject    string
	CreatedAt  time.Time
	LastSeenAt time.Time
}

type ProfilesGlobalRole

type ProfilesGlobalRole struct {
	ID          string
	Name        string
	Slug        string
	Description *string
	CreatedAt   time.Time
	UpdatedAt   time.Time
	DeletedAt   *time.Time
}

type ProfilesGlobalUserRole

type ProfilesGlobalUserRole struct {
	ID        string
	UserID    string
	RoleID    string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type ProfilesOwnerReservedName

type ProfilesOwnerReservedName struct {
	Slug      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type ProfilesRefreshSession

type ProfilesRefreshSession struct {
	ID                  string
	UserID              string
	Issuer              string
	FamilyID            string
	CurrentTokenHash    []byte
	PreviousTokenHash   []byte
	CreatedAt           time.Time
	LastAuthenticatedAt *time.Time
	LastUsedAt          time.Time
	ExpiresAt           *time.Time
	RevokedAt           *time.Time
	UserAgent           *string
	IpAddr              *string
}

type ProfilesServiceToken

type ProfilesServiceToken struct {
	ID         string
	TenantID   string
	KeyID      string
	SecretHash []byte
	Name       string
	CreatedBy  *string
	CreatedAt  time.Time
	LastUsedAt *time.Time
	ExpiresAt  *time.Time
	RevokedAt  *time.Time
}

type ProfilesServiceTokenPermission

type ProfilesServiceTokenPermission struct {
	ServiceTokenID string
	Permission     string
	CreatedAt      time.Time
}

type ProfilesServiceTokenResource

type ProfilesServiceTokenResource struct {
	TokenID    string
	Kind       string
	ResourceID string
	CreatedAt  time.Time
}

type ProfilesTenant

type ProfilesTenant struct {
	ID          string
	Slug        string
	IsPersonal  bool
	OwnerUserID *string
	// Arbitrary tenant metadata (internal/admin flags such as reserved)
	Metadata  []byte
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

type ProfilesTenantInvite

type ProfilesTenantInvite struct {
	ID        string
	TenantID  string
	UserID    string
	InvitedBy string
	Role      string
	Status    string
	ExpiresAt *time.Time
	ActedAt   *time.Time
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

type ProfilesTenantIssuer

type ProfilesTenantIssuer struct {
	ID        string
	TenantID  string
	Issuer    string
	JwksUri   string
	Audiences []string
	Enabled   bool
	CreatedAt time.Time
	UpdatedAt time.Time
	// Trust source: jwks (fetch from jwks_uri) XOR static (human-managed public_keys list).
	Mode string
	// static mode only: JSON array of {kid, public_key_pem} entries, edited by humans like an authorized_keys file.
	PublicKeys []byte
}

Registry of trusted tenant-owned OIDC issuers for delegated access tokens.

type ProfilesTenantMembership

type ProfilesTenantMembership struct {
	TenantID  string
	UserID    string
	Role      string
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

type ProfilesTenantRename

type ProfilesTenantRename struct {
	ID        int64
	TenantID  string
	FromSlug  string
	RenamedAt time.Time
}

type ProfilesTenantRole

type ProfilesTenantRole struct {
	TenantID  string
	Role      string
	CreatedAt time.Time
}

type ProfilesTenantRolePermission

type ProfilesTenantRolePermission struct {
	TenantID   string
	Role       string
	Permission string
	CreatedAt  time.Time
}

type ProfilesTwoFactorSetting

type ProfilesTwoFactorSetting struct {
	UserID  string
	Enabled bool
	// Preferred 2FA method: email or sms
	Method      string
	PhoneNumber *string
	// Hashed backup codes for account recovery (10 codes)
	BackupCodes []string
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

Two-factor authentication settings per user (admin accounts)

type ProfilesUser

type ProfilesUser struct {
	ID              string
	Email           *string
	Username        *string
	DiscordUsername *string
	EmailVerified   bool
	// E.164 format phone number (e.g., +14155551234)
	PhoneNumber *string
	// Whether the phone number has been verified via SMS code
	PhoneVerified *bool
	// When the user was banned
	BannedAt *time.Time
	// When a temporary ban expires (NULL for permanent)
	BannedUntil *time.Time
	// Reason for ban
	BanReason *string
	// User ID of admin who imposed ban
	BannedBy  *string
	DeletedAt *time.Time
	Biography *string
	// Arbitrary user metadata (internal/admin flags such as reserved)
	Metadata  []byte
	CreatedAt time.Time
	UpdatedAt time.Time
	LastLogin *time.Time
	// User communication/auth locale, e.g. en, es, de, ko, zh-CN
	PreferredLocale *string
	// Source of preferred_locale, e.g. registration or explicit
	PreferredLocaleSource *string
	// When preferred_locale was last set
	PreferredLocaleUpdatedAt *time.Time
}

type ProfilesUserPassword

type ProfilesUserPassword struct {
	UserID            string
	PasswordHash      string
	HashAlgo          string
	HashParams        []byte
	PasswordUpdatedAt time.Time
}

type ProfilesUserProvider

type ProfilesUserProvider struct {
	ID              string
	UserID          string
	Issuer          string
	ProviderSlug    *string
	Subject         string
	EmailAtProvider *string
	Profile         []byte
	CreatedAt       time.Time
}

type ProfilesUserRename

type ProfilesUserRename struct {
	ID        int64
	UserID    string
	FromSlug  string
	RenamedAt time.Time
}

type ProviderLinkByIssuerParams

type ProviderLinkByIssuerParams struct {
	Issuer  string
	Subject string
}

type ProviderLinkByIssuerRow

type ProviderLinkByIssuerRow struct {
	UserID          string
	EmailAtProvider *string
}

type ProviderLinkBySlugParams

type ProviderLinkBySlugParams struct {
	ProviderSlug *string
	Subject      string
}

type ProviderLinkBySlugRow

type ProviderLinkBySlugRow struct {
	UserID          string
	EmailAtProvider *string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) DelegatedUserTouch

func (q *Queries) DelegatedUserTouch(ctx context.Context, arg DelegatedUserTouchParams) (DelegatedUserTouchRow, error)

func (*Queries) GlobalActiveAdminCount

func (q *Queries) GlobalActiveAdminCount(ctx context.Context, roleID string) (int64, error)

func (*Queries) GlobalAdminRoleIDForUpdate

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

func (*Queries) GlobalRoleIDBySlug

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

func (*Queries) GlobalRoleSlugsByUser

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

Global (platform) role queries (core/service.go).

func (*Queries) GlobalRoleUpsert

func (q *Queries) GlobalRoleUpsert(ctx context.Context, arg GlobalRoleUpsertParams) error

func (*Queries) GlobalUserHasActiveRole

func (q *Queries) GlobalUserHasActiveRole(ctx context.Context, arg GlobalUserHasActiveRoleParams) (bool, error)

func (*Queries) GlobalUserRoleDelete

func (q *Queries) GlobalUserRoleDelete(ctx context.Context, arg GlobalUserRoleDeleteParams) (int64, error)

func (*Queries) GlobalUserRoleDeleteBySlug

func (q *Queries) GlobalUserRoleDeleteBySlug(ctx context.Context, arg GlobalUserRoleDeleteBySlugParams) (int64, error)

func (*Queries) GlobalUserRoleExists

func (q *Queries) GlobalUserRoleExists(ctx context.Context, arg GlobalUserRoleExistsParams) (bool, error)

func (*Queries) GlobalUserRoleInsert

func (q *Queries) GlobalUserRoleInsert(ctx context.Context, arg GlobalUserRoleInsertParams) error

func (*Queries) IdentityCurrentTenantSlug

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

Rename-history forwarding (identity/renames.go).

func (*Queries) IdentityCurrentUsername

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

func (*Queries) IdentityForwardTenantSlug

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

func (*Queries) IdentityForwardUsername

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

func (*Queries) IdentityUpdateUserEmail

func (q *Queries) IdentityUpdateUserEmail(ctx context.Context, arg IdentityUpdateUserEmailParams) error

func (*Queries) IdentityUpdateUserUsername

func (q *Queries) IdentityUpdateUserUsername(ctx context.Context, arg IdentityUpdateUserUsernameParams) error

func (*Queries) IdentityUserByID

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

func (*Queries) IdentityUserIDByUsername

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

func (*Queries) IdentityUsersByIDs

func (q *Queries) IdentityUsersByIDs(ctx context.Context, ids []string) ([]IdentityUsersByIDsRow, error)

Identity store queries (identity package).

func (*Queries) NamespaceTenantBySlug

func (q *Queries) NamespaceTenantBySlug(ctx context.Context, slug string) (NamespaceTenantBySlugRow, error)

func (*Queries) NamespaceTenantRenameBySlug

func (q *Queries) NamespaceTenantRenameBySlug(ctx context.Context, fromSlug string) (NamespaceTenantRenameBySlugRow, error)

func (*Queries) NamespaceUserBySlug

func (q *Queries) NamespaceUserBySlug(ctx context.Context, username *string) (NamespaceUserBySlugRow, error)

Namespace lookup probes (core/owner_namespace_lookup.go). These read soft- deleted rows on purpose (deleted_at IS NOT NULL surfaces as a flag).

func (*Queries) NamespaceUserRenameBySlug

func (q *Queries) NamespaceUserRenameBySlug(ctx context.Context, fromSlug string) (NamespaceUserRenameBySlugRow, error)

func (*Queries) OwnerReservedNameDelete

func (q *Queries) OwnerReservedNameDelete(ctx context.Context, slug string) (int64, error)

func (*Queries) OwnerReservedNameExists

func (q *Queries) OwnerReservedNameExists(ctx context.Context, slug string) (bool, error)

Owner-namespace queries (core/service_owner_namespace*.go, core/owner_namespace_lookup.go).

func (*Queries) OwnerReservedNameUpsert

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

func (*Queries) OwnerSlugConflictExists

func (q *Queries) OwnerSlugConflictExists(ctx context.Context, arg OwnerSlugConflictExistsParams) (bool, error)

Recent rename history blocks reuse without a separate hold table. Joins to owner rows without filtering soft deletes: soft deletion keeps the namespace held, while hard deletion removes/cascades the owner row and allows eventual reuse.

func (*Queries) OwnerSlugTenantExists

func (q *Queries) OwnerSlugTenantExists(ctx context.Context, arg OwnerSlugTenantExistsParams) (bool, error)

func (*Queries) OwnerSlugTenantRenameHeld

func (q *Queries) OwnerSlugTenantRenameHeld(ctx context.Context, arg OwnerSlugTenantRenameHeldParams) (bool, error)

func (*Queries) OwnerSlugUserExists

func (q *Queries) OwnerSlugUserExists(ctx context.Context, arg OwnerSlugUserExistsParams) (bool, error)

Slug-availability probes (core/service_owner_namespace.go ownerSlugAvailable).

func (*Queries) OwnerSlugUserRenameHeld

func (q *Queries) OwnerSlugUserRenameHeld(ctx context.Context, arg OwnerSlugUserRenameHeldParams) (bool, error)

func (*Queries) PersonalTenantByOwner

func (q *Queries) PersonalTenantByOwner(ctx context.Context, ownerUserID string) (PersonalTenantByOwnerRow, error)

func (*Queries) PersonalTenantIDSlugByOwner

func (q *Queries) PersonalTenantIDSlugByOwner(ctx context.Context, ownerUserID string) (PersonalTenantIDSlugByOwnerRow, error)

func (*Queries) PersonalTenantIDSlugReservedByOwner

func (q *Queries) PersonalTenantIDSlugReservedByOwner(ctx context.Context, ownerUserID string) (PersonalTenantIDSlugReservedByOwnerRow, error)

func (*Queries) PersonalTenantInsertBasic

func (q *Queries) PersonalTenantInsertBasic(ctx context.Context, arg PersonalTenantInsertBasicParams) error

func (*Queries) PersonalTenantUpsert

func (q *Queries) PersonalTenantUpsert(ctx context.Context, arg PersonalTenantUpsertParams) (string, error)

func (*Queries) ProviderLinkByIssuer

func (q *Queries) ProviderLinkByIssuer(ctx context.Context, arg ProviderLinkByIssuerParams) (ProviderLinkByIssuerRow, error)

func (*Queries) ProviderLinkBySlug

func (q *Queries) ProviderLinkBySlug(ctx context.Context, arg ProviderLinkBySlugParams) (ProviderLinkBySlugRow, error)

func (*Queries) ServiceTokenByKeyID

func (q *Queries) ServiceTokenByKeyID(ctx context.Context, keyID string) (ServiceTokenByKeyIDRow, error)

func (*Queries) ServiceTokenInsert

func (q *Queries) ServiceTokenInsert(ctx context.Context, arg ServiceTokenInsertParams) (ServiceTokenInsertRow, error)

Service token queries (core/service_tokens.go).

func (*Queries) ServiceTokenPermissionInsert

func (q *Queries) ServiceTokenPermissionInsert(ctx context.Context, arg ServiceTokenPermissionInsertParams) error

func (*Queries) ServiceTokenPermissionsByTokenID

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

func (*Queries) ServiceTokenPermissionsByTokenIDs

func (q *Queries) ServiceTokenPermissionsByTokenIDs(ctx context.Context, ids []string) ([]ServiceTokenPermissionsByTokenIDsRow, error)

func (*Queries) ServiceTokenResourceInsert

func (q *Queries) ServiceTokenResourceInsert(ctx context.Context, arg ServiceTokenResourceInsertParams) error

func (*Queries) ServiceTokenResourcesByTokenID

func (q *Queries) ServiceTokenResourcesByTokenID(ctx context.Context, tokenID string) ([]ServiceTokenResourcesByTokenIDRow, error)

func (*Queries) ServiceTokenResourcesByTokenIDs

func (q *Queries) ServiceTokenResourcesByTokenIDs(ctx context.Context, ids []string) ([]ServiceTokenResourcesByTokenIDsRow, error)

func (*Queries) ServiceTokenRevoke

func (q *Queries) ServiceTokenRevoke(ctx context.Context, arg ServiceTokenRevokeParams) (int64, error)

func (*Queries) ServiceTokenTouchLastUsed

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

func (*Queries) ServiceTokensByTenant

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

func (*Queries) SessionFreshSince

func (q *Queries) SessionFreshSince(ctx context.Context, arg SessionFreshSinceParams) (time.Time, error)

func (*Queries) SessionIDByCurrentTokenHash

func (q *Queries) SessionIDByCurrentTokenHash(ctx context.Context, arg SessionIDByCurrentTokenHashParams) (string, error)

func (*Queries) SessionInsert

func (q *Queries) SessionInsert(ctx context.Context, arg SessionInsertParams) (SessionInsertRow, error)

Refresh-session queries (core/service_sessions.go).

func (*Queries) SessionMarkAuthenticated

func (q *Queries) SessionMarkAuthenticated(ctx context.Context, arg SessionMarkAuthenticatedParams) (int64, error)

func (*Queries) SessionRevokeByID

func (q *Queries) SessionRevokeByID(ctx context.Context, arg SessionRevokeByIDParams) (string, error)

func (*Queries) SessionRevokeByIDForUser

func (q *Queries) SessionRevokeByIDForUser(ctx context.Context, arg SessionRevokeByIDForUserParams) (string, error)

func (*Queries) SessionRotate

func (q *Queries) SessionRotate(ctx context.Context, arg SessionRotateParams) error

func (*Queries) SessionsCountActive

func (q *Queries) SessionsCountActive(ctx context.Context, arg SessionsCountActiveParams) (int64, error)

func (*Queries) SessionsDeleteRevokedOrExpired

func (q *Queries) SessionsDeleteRevokedOrExpired(ctx context.Context) error

func (*Queries) SessionsEvictOldest

func (q *Queries) SessionsEvictOldest(ctx context.Context, arg SessionsEvictOldestParams) ([]string, error)

func (*Queries) SessionsListByUser

func (q *Queries) SessionsListByUser(ctx context.Context, arg SessionsListByUserParams) ([]SessionsListByUserRow, error)

func (*Queries) SessionsRevokeAll

func (q *Queries) SessionsRevokeAll(ctx context.Context, arg SessionsRevokeAllParams) ([]string, error)

func (*Queries) SessionsRevokeAllExcept

func (q *Queries) SessionsRevokeAllExcept(ctx context.Context, arg SessionsRevokeAllExceptParams) ([]string, error)

func (*Queries) SessionsRevokeAllQuiet

func (q *Queries) SessionsRevokeAllQuiet(ctx context.Context, arg SessionsRevokeAllQuietParams) error

SessionsRevokeAllQuiet is AdminDeleteUser's pre-delete sweep; unlike SessionsRevokeAll it returns nothing (no per-session revoke logging).

func (*Queries) SessionsRevokeFamily

func (q *Queries) SessionsRevokeFamily(ctx context.Context, familyID string) ([]SessionsRevokeFamilyRow, error)

func (*Queries) TenantAliases

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

func (*Queries) TenantBySlug

func (q *Queries) TenantBySlug(ctx context.Context, slug string) (TenantBySlugRow, error)

Tenant + membership + role queries (core/service_tenants.go).

func (*Queries) TenantBySlugViaRename

func (q *Queries) TenantBySlugViaRename(ctx context.Context, fromSlug string) (TenantBySlugViaRenameRow, error)

TenantBySlugViaRename resolves a historical slug (issue #58). The tenant_renames row's tenant_id always points at the live owner, so any historical slug resolves to the tenant currently holding it; most recent row wins (hard-delete + reuse).

func (*Queries) TenantDefinedRoles

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

func (*Queries) TenantIDPersonalBySlug

func (q *Queries) TenantIDPersonalBySlug(ctx context.Context, slug string) (TenantIDPersonalBySlugRow, error)

func (*Queries) TenantIDReservedBySlug

func (q *Queries) TenantIDReservedBySlug(ctx context.Context, slug string) (TenantIDReservedBySlugRow, error)

func (*Queries) TenantInsert

func (q *Queries) TenantInsert(ctx context.Context, arg TenantInsertParams) (TenantInsertRow, error)

func (*Queries) TenantInsertWithState

func (q *Queries) TenantInsertWithState(ctx context.Context, arg TenantInsertWithStateParams) (string, error)

func (*Queries) TenantInviteForUpdate

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

func (*Queries) TenantInviteInsert

func (q *Queries) TenantInviteInsert(ctx context.Context, arg TenantInviteInsertParams) (TenantInviteInsertRow, error)

Tenant invite queries (core/service_tenant_invites.go).

func (*Queries) TenantInviteMarkExpired

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

func (*Queries) TenantInviteRevoke

func (q *Queries) TenantInviteRevoke(ctx context.Context, arg TenantInviteRevokeParams) (int64, error)

func (*Queries) TenantInviteSetStatus

func (q *Queries) TenantInviteSetStatus(ctx context.Context, arg TenantInviteSetStatusParams) error

func (*Queries) TenantInvitesByTenant

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

func (*Queries) TenantInvitesByUser

func (q *Queries) TenantInvitesByUser(ctx context.Context, userID string) ([]TenantInvitesByUserRow, error)

func (*Queries) TenantInvitesByUserStatus

func (q *Queries) TenantInvitesByUserStatus(ctx context.Context, arg TenantInvitesByUserStatusParams) ([]TenantInvitesByUserStatusRow, error)

func (*Queries) TenantIssuerByIssuer

func (q *Queries) TenantIssuerByIssuer(ctx context.Context, issuer string) (TenantIssuerByIssuerRow, error)

func (*Queries) TenantIssuerDelete

func (q *Queries) TenantIssuerDelete(ctx context.Context, issuer string) (int64, error)

func (*Queries) TenantIssuerUpsert

func (q *Queries) TenantIssuerUpsert(ctx context.Context, arg TenantIssuerUpsertParams) (TenantIssuerUpsertRow, error)

Tenant issuer registry (core/service_tenant_issuers.go).

func (*Queries) TenantIssuersAll

func (q *Queries) TenantIssuersAll(ctx context.Context) ([]TenantIssuersAllRow, error)

func (*Queries) TenantIssuersEnabled

func (q *Queries) TenantIssuersEnabled(ctx context.Context) ([]TenantIssuersEnabledRow, error)

func (*Queries) TenantLastRenamedAt

func (q *Queries) TenantLastRenamedAt(ctx context.Context, tenantID string) (time.Time, error)

func (*Queries) TenantMemberAdd

func (q *Queries) TenantMemberAdd(ctx context.Context, arg TenantMemberAddParams) error

TenantMemberAdd intentionally does NOT change role on conflict (re-adding an existing member only revives a soft-deleted row).

func (*Queries) TenantMemberHasRole

func (q *Queries) TenantMemberHasRole(ctx context.Context, arg TenantMemberHasRoleParams) (bool, error)

func (*Queries) TenantMemberIDs

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

func (*Queries) TenantMemberRole

func (q *Queries) TenantMemberRole(ctx context.Context, arg TenantMemberRoleParams) (string, error)

func (*Queries) TenantMemberSoftDelete

func (q *Queries) TenantMemberSoftDelete(ctx context.Context, arg TenantMemberSoftDeleteParams) error

func (*Queries) TenantMembershipExists

func (q *Queries) TenantMembershipExists(ctx context.Context, arg TenantMembershipExistsParams) (bool, error)

func (*Queries) TenantMembershipResetRole

func (q *Queries) TenantMembershipResetRole(ctx context.Context, arg TenantMembershipResetRoleParams) error

func (*Queries) TenantMembershipSetRole

func (q *Queries) TenantMembershipSetRole(ctx context.Context, arg TenantMembershipSetRoleParams) error

func (*Queries) TenantMembershipUpsertRole

func (q *Queries) TenantMembershipUpsertRole(ctx context.Context, arg TenantMembershipUpsertRoleParams) error

func (*Queries) TenantMetadata

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

func (*Queries) TenantMetadataPatch

func (q *Queries) TenantMetadataPatch(ctx context.Context, arg TenantMetadataPatchParams) (int64, error)

func (*Queries) TenantNamespaceStateByID

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

func (*Queries) TenantRenameInsert

func (q *Queries) TenantRenameInsert(ctx context.Context, arg TenantRenameInsertParams) error

func (*Queries) TenantRoleDefine

func (q *Queries) TenantRoleDefine(ctx context.Context, arg TenantRoleDefineParams) error

func (*Queries) TenantRoleDelete

func (q *Queries) TenantRoleDelete(ctx context.Context, arg TenantRoleDeleteParams) error

func (*Queries) TenantRoleExists

func (q *Queries) TenantRoleExists(ctx context.Context, arg TenantRoleExistsParams) (bool, error)

func (*Queries) TenantRoleHasPermissions

func (q *Queries) TenantRoleHasPermissions(ctx context.Context, arg TenantRoleHasPermissionsParams) (bool, error)

func (*Queries) TenantRoleMemberCount

func (q *Queries) TenantRoleMemberCount(ctx context.Context, arg TenantRoleMemberCountParams) (int64, error)

func (*Queries) TenantRolePermissionInsert

func (q *Queries) TenantRolePermissionInsert(ctx context.Context, arg TenantRolePermissionInsertParams) error

func (*Queries) TenantRolePermissions

func (q *Queries) TenantRolePermissions(ctx context.Context, arg TenantRolePermissionsParams) ([]string, error)

Tenant RBAC role-permission queries (core/tenant_role_permissions.go).

func (*Queries) TenantRolePermissionsDelete

func (q *Queries) TenantRolePermissionsDelete(ctx context.Context, arg TenantRolePermissionsDeleteParams) error

func (*Queries) TenantRolesSeedOwnerMember

func (q *Queries) TenantRolesSeedOwnerMember(ctx context.Context, arg TenantRolesSeedOwnerMemberParams) error

func (*Queries) TenantSetNamespaceState

func (q *Queries) TenantSetNamespaceState(ctx context.Context, arg TenantSetNamespaceStateParams) (int64, error)

func (*Queries) TenantSetReserved

func (q *Queries) TenantSetReserved(ctx context.Context, arg TenantSetReservedParams) error

func (*Queries) TenantSlugAndPersonalByID

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

func (*Queries) TenantSlugsByUser

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

func (*Queries) TenantUpdateSlug

func (q *Queries) TenantUpdateSlug(ctx context.Context, arg TenantUpdateSlugParams) error

func (*Queries) TenantUpdateSlugUnconditional

func (q *Queries) TenantUpdateSlugUnconditional(ctx context.Context, arg TenantUpdateSlugUnconditionalParams) error

TenantUpdateSlugUnconditional intentionally has no deleted_at filter — it rides the user-rename transaction in updateUsernameImpl.

func (*Queries) TwoFactorDisable

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

func (*Queries) TwoFactorEnable

func (q *Queries) TwoFactorEnable(ctx context.Context, arg TwoFactorEnableParams) error

Two-factor settings queries (core/service.go).

func (*Queries) TwoFactorSetBackupCodes

func (q *Queries) TwoFactorSetBackupCodes(ctx context.Context, arg TwoFactorSetBackupCodesParams) error

func (*Queries) TwoFactorSettingsByUser

func (q *Queries) TwoFactorSettingsByUser(ctx context.Context, userID string) (ProfilesTwoFactorSetting, error)

func (*Queries) UserApplyEmailChange

func (q *Queries) UserApplyEmailChange(ctx context.Context, arg UserApplyEmailChangeParams) error

func (*Queries) UserApplyPhoneChange

func (q *Queries) UserApplyPhoneChange(ctx context.Context, arg UserApplyPhoneChangeParams) error

func (*Queries) UserBan

func (q *Queries) UserBan(ctx context.Context, arg UserBanParams) error

func (*Queries) UserByEmail

func (q *Queries) UserByEmail(ctx context.Context, email string) (UserByEmailRow, error)

func (*Queries) UserByID

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

func (*Queries) UserByPhone

func (q *Queries) UserByPhone(ctx context.Context, phoneNumber *string) (UserByPhoneRow, error)

func (*Queries) UserBySlug

func (q *Queries) UserBySlug(ctx context.Context, username *string) (UserBySlugRow, error)

func (*Queries) UserBySlugViaRename

func (q *Queries) UserBySlugViaRename(ctx context.Context, fromSlug string) (UserBySlugViaRenameRow, error)

Fallback to renames table (issue #58). Most-recent rename wins when a slug has been used by multiple users at different times (only possible after hard-delete + reuse).

func (*Queries) UserByUsername

func (q *Queries) UserByUsername(ctx context.Context, username *string) (UserByUsernameRow, error)

func (*Queries) UserClearBan

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

func (*Queries) UserClearLoginIdentifiers

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

func (*Queries) UserDeleteHard

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

func (*Queries) UserDiscordUsername

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

func (*Queries) UserEmailByID

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

User-row queries (core/service.go).

func (*Queries) UserEmailOrUsernameExists

func (q *Queries) UserEmailOrUsernameExists(ctx context.Context, arg UserEmailOrUsernameExistsParams) (bool, error)

func (*Queries) UserEmailOrUsernameTaken

func (*Queries) UserHasPassword

func (q *Queries) UserHasPassword(ctx context.Context, userID string) (bool, error)

func (*Queries) UserIDReservedByUsername

func (q *Queries) UserIDReservedByUsername(ctx context.Context, username *string) (UserIDReservedByUsernameRow, error)

func (*Queries) UserImportInsert

func (q *Queries) UserImportInsert(ctx context.Context, arg UserImportInsertParams) error

func (*Queries) UserImportUpdate

func (q *Queries) UserImportUpdate(ctx context.Context, arg UserImportUpdateParams) (string, error)

func (*Queries) UserInsert

func (q *Queries) UserInsert(ctx context.Context, arg UserInsertParams) (UserInsertRow, error)

func (*Queries) UserIsReserved

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

func (*Queries) UserLastRenamedAt

func (q *Queries) UserLastRenamedAt(ctx context.Context, userID string) (time.Time, error)

func (*Queries) UserMetadata

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

func (*Queries) UserMetadataPatch

func (q *Queries) UserMetadataPatch(ctx context.Context, arg UserMetadataPatchParams) (int64, error)

func (*Queries) UserPasswordDelete

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

func (*Queries) UserPasswordInsert

func (q *Queries) UserPasswordInsert(ctx context.Context, arg UserPasswordInsertParams) error

func (*Queries) UserPasswordRow

func (q *Queries) UserPasswordRow(ctx context.Context, userID string) (UserPasswordRowRow, error)

func (*Queries) UserPasswordUpsert

func (q *Queries) UserPasswordUpsert(ctx context.Context, arg UserPasswordUpsertParams) error

func (*Queries) UserPhoneOrUsernameExists

func (q *Queries) UserPhoneOrUsernameExists(ctx context.Context, arg UserPhoneOrUsernameExistsParams) (bool, error)

func (*Queries) UserPhoneOrUsernameTaken

func (*Queries) UserPreferredLocale

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

func (*Queries) UserProviderDeleteBySlug

func (q *Queries) UserProviderDeleteBySlug(ctx context.Context, arg UserProviderDeleteBySlugParams) error

func (*Queries) UserProviderDeleteOtherSubjects

func (q *Queries) UserProviderDeleteOtherSubjects(ctx context.Context, arg UserProviderDeleteOtherSubjectsParams) error

func (*Queries) UserProviderInsertSimple

func (q *Queries) UserProviderInsertSimple(ctx context.Context, arg UserProviderInsertSimpleParams) error

func (*Queries) UserProviderLinkExists

func (q *Queries) UserProviderLinkExists(ctx context.Context, arg UserProviderLinkExistsParams) (bool, error)

HTTP-layer provider lookups (http/reauth.go, http/user_me_get.go).

func (*Queries) UserProviderMergeProfile

func (q *Queries) UserProviderMergeProfile(ctx context.Context, arg UserProviderMergeProfileParams) error

func (*Queries) UserProviderSetUsername

func (q *Queries) UserProviderSetUsername(ctx context.Context, arg UserProviderSetUsernameParams) error

func (*Queries) UserProviderSlugs

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

func (*Queries) UserProviderSlugsDistinct

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

func (*Queries) UserProviderSubjectByIssuer

func (q *Queries) UserProviderSubjectByIssuer(ctx context.Context, arg UserProviderSubjectByIssuerParams) (string, error)

func (*Queries) UserProviderUpsertByIssuer

func (q *Queries) UserProviderUpsertByIssuer(ctx context.Context, arg UserProviderUpsertByIssuerParams) error

func (*Queries) UserProviderUsername

func (q *Queries) UserProviderUsername(ctx context.Context, arg UserProviderUsernameParams) (*string, error)

func (*Queries) UserProvidersCount

func (q *Queries) UserProvidersCount(ctx context.Context, userID string) (int64, error)

Provider-link queries (core/service.go).

func (*Queries) UserProvidersDeleteByUser

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

func (*Queries) UserRenameInsert

func (q *Queries) UserRenameInsert(ctx context.Context, arg UserRenameInsertParams) error

func (*Queries) UserRestore

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

func (*Queries) UserSetBiography

func (q *Queries) UserSetBiography(ctx context.Context, arg UserSetBiographyParams) error

func (*Queries) UserSetEmailAndUnverify

func (q *Queries) UserSetEmailAndUnverify(ctx context.Context, arg UserSetEmailAndUnverifyParams) error

func (*Queries) UserSetEmailVerified

func (q *Queries) UserSetEmailVerified(ctx context.Context, arg UserSetEmailVerifiedParams) error

func (*Queries) UserSetLastLogin

func (q *Queries) UserSetLastLogin(ctx context.Context, arg UserSetLastLoginParams) error

func (*Queries) UserSetPhoneAndVerified

func (q *Queries) UserSetPhoneAndVerified(ctx context.Context, arg UserSetPhoneAndVerifiedParams) error

func (*Queries) UserSetPhoneVerifiedByID

func (q *Queries) UserSetPhoneVerifiedByID(ctx context.Context, arg UserSetPhoneVerifiedByIDParams) error

func (*Queries) UserSetPhoneVerifiedByIDAndPhone

func (q *Queries) UserSetPhoneVerifiedByIDAndPhone(ctx context.Context, arg UserSetPhoneVerifiedByIDAndPhoneParams) error

func (*Queries) UserSetPreferredLocale

func (q *Queries) UserSetPreferredLocale(ctx context.Context, arg UserSetPreferredLocaleParams) error

func (*Queries) UserSetReserved

func (q *Queries) UserSetReserved(ctx context.Context, arg UserSetReservedParams) error

Reserved-account + metadata queries (core/service_reserved_accounts.go).

func (*Queries) UserSetUsername

func (q *Queries) UserSetUsername(ctx context.Context, arg UserSetUsernameParams) error

func (*Queries) UserSlugAliases

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

func (*Queries) UserSoftDelete

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

func (*Queries) UserUsernameByID

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

func (*Queries) UserUsernameExists

func (q *Queries) UserUsernameExists(ctx context.Context, username *string) (bool, error)

func (*Queries) UsersPurgeCandidates

func (q *Queries) UsersPurgeCandidates(ctx context.Context, arg UsersPurgeCandidatesParams) ([]string, error)

func (*Queries) WithTx

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

type ServiceTokenByKeyIDRow

type ServiceTokenByKeyIDRow struct {
	ID              string
	SecretHash      []byte
	ExpiresAt       *time.Time
	RevokedAt       *time.Time
	Slug            string
	TenantDeletedAt *time.Time
}

type ServiceTokenInsertParams

type ServiceTokenInsertParams struct {
	TenantID   string
	KeyID      string
	SecretHash []byte
	Name       string
	CreatedBy  *string
	ExpiresAt  *time.Time
}

type ServiceTokenInsertRow

type ServiceTokenInsertRow struct {
	ID        string
	CreatedAt time.Time
}

type ServiceTokenPermissionInsertParams

type ServiceTokenPermissionInsertParams struct {
	ServiceTokenID string
	Permission     string
}

type ServiceTokenPermissionsByTokenIDsRow

type ServiceTokenPermissionsByTokenIDsRow struct {
	ServiceTokenID string
	Permission     string
}

type ServiceTokenResourceInsertParams

type ServiceTokenResourceInsertParams struct {
	TokenID    string
	Kind       string
	ResourceID string
}

type ServiceTokenResourcesByTokenIDRow

type ServiceTokenResourcesByTokenIDRow struct {
	Kind       string
	ResourceID string
}

type ServiceTokenResourcesByTokenIDsRow

type ServiceTokenResourcesByTokenIDsRow struct {
	TokenID    string
	Kind       string
	ResourceID string
}

type ServiceTokenRevokeParams

type ServiceTokenRevokeParams struct {
	ID       string
	TenantID string
}

type ServiceTokensByTenantRow

type ServiceTokensByTenantRow struct {
	ID         string
	KeyID      string
	Name       string
	CreatedBy  string
	CreatedAt  time.Time
	LastUsedAt *time.Time
	ExpiresAt  *time.Time
	RevokedAt  *time.Time
}

type SessionByCurrentTokenHashParams

type SessionByCurrentTokenHashParams struct {
	CurrentTokenHash []byte
	Issuer           string
}

type SessionByCurrentTokenHashRow

type SessionByCurrentTokenHashRow struct {
	ID       string
	UserID   string
	FamilyID string
}

type SessionByPreviousTokenHashParams

type SessionByPreviousTokenHashParams struct {
	PreviousTokenHash []byte
	Issuer            string
}

type SessionByPreviousTokenHashRow

type SessionByPreviousTokenHashRow struct {
	ID       string
	UserID   string
	FamilyID string
}

type SessionFreshSinceParams

type SessionFreshSinceParams struct {
	SessionID string
	UserID    string
	Issuer    string
}

type SessionIDByCurrentTokenHashParams

type SessionIDByCurrentTokenHashParams struct {
	CurrentTokenHash []byte
	Issuer           string
}

type SessionInsertParams

type SessionInsertParams struct {
	ID               string
	FamilyID         string
	UserID           string
	Issuer           string
	CurrentTokenHash []byte
	ExpiresAt        *time.Time
	UserAgent        *string
	IpAddr           *string
}

type SessionInsertRow

type SessionInsertRow struct {
	ID       string
	FamilyID string
}

type SessionMarkAuthenticatedParams

type SessionMarkAuthenticatedParams struct {
	SessionID string
	UserID    string
	Issuer    string
}

type SessionRevokeByIDForUserParams

type SessionRevokeByIDForUserParams struct {
	ID     string
	UserID string
	Issuer string
}

type SessionRevokeByIDParams

type SessionRevokeByIDParams struct {
	ID     string
	Issuer string
}

type SessionRotateParams

type SessionRotateParams struct {
	CurrentTokenHash []byte
	UserAgent        *string
	IpAddr           *string
	ID               string
}

type SessionsCountActiveParams

type SessionsCountActiveParams struct {
	UserID string
	Issuer string
}

type SessionsEvictOldestParams

type SessionsEvictOldestParams struct {
	UserID     string
	Issuer     string
	EvictCount int64
}

type SessionsListByUserParams

type SessionsListByUserParams struct {
	UserID string
	Issuer string
}

type SessionsListByUserRow

type SessionsListByUserRow struct {
	ID                  string
	FamilyID            string
	CreatedAt           time.Time
	LastAuthenticatedAt *time.Time
	LastUsedAt          time.Time
	ExpiresAt           *time.Time
	RevokedAt           *time.Time
	UserAgent           *string
	IpAddr              *string
}

type SessionsRevokeAllExceptParams

type SessionsRevokeAllExceptParams struct {
	UserID string
	Issuer string
	ID     string
}

type SessionsRevokeAllParams

type SessionsRevokeAllParams struct {
	UserID string
	Issuer string
}

type SessionsRevokeAllQuietParams

type SessionsRevokeAllQuietParams struct {
	UserID string
	Issuer string
}

type SessionsRevokeFamilyRow

type SessionsRevokeFamilyRow struct {
	ID     string
	UserID string
}

type TenantBySlugRow

type TenantBySlugRow struct {
	ID          string
	Slug        string
	IsPersonal  bool
	OwnerUserID string
}

type TenantBySlugViaRenameRow

type TenantBySlugViaRenameRow struct {
	ID          string
	Slug        string
	IsPersonal  bool
	OwnerUserID string
}

type TenantIDPersonalBySlugRow

type TenantIDPersonalBySlugRow struct {
	ID         string
	IsPersonal bool
}

type TenantIDReservedBySlugRow

type TenantIDReservedBySlugRow struct {
	ID       string
	Reserved bool
}

type TenantInsertParams

type TenantInsertParams struct {
	ID   string
	Slug string
}

type TenantInsertRow

type TenantInsertRow struct {
	ID   string
	Slug string
}

type TenantInsertWithStateParams

type TenantInsertWithStateParams struct {
	ID    string
	Slug  string
	State string
}

type TenantInviteForUpdateRow

type TenantInviteForUpdateRow struct {
	TenantID  string
	UserID    string
	Role      string
	Status    string
	ExpiresAt *time.Time
}

type TenantInviteInsertParams

type TenantInviteInsertParams struct {
	ID        string
	TenantID  string
	UserID    string
	InvitedBy string
	Role      string
	ExpiresAt *time.Time
}

type TenantInviteInsertRow

type TenantInviteInsertRow struct {
	ID        string
	UserID    string
	InvitedBy string
	Role      string
	Status    string
	ExpiresAt *time.Time
	ActedAt   *time.Time
	CreatedAt time.Time
}

type TenantInviteRevokeParams

type TenantInviteRevokeParams struct {
	ID       string
	TenantID string
}

type TenantInviteSetStatusParams

type TenantInviteSetStatusParams struct {
	Status string
	ID     string
}

type TenantInvitesByTenantRow

type TenantInvitesByTenantRow struct {
	ID        string
	UserID    string
	InvitedBy string
	Role      string
	Status    string
	ExpiresAt *time.Time
	ActedAt   *time.Time
	CreatedAt time.Time
}

type TenantInvitesByTenantStatusParams

type TenantInvitesByTenantStatusParams struct {
	TenantID string
	Status   string
}

type TenantInvitesByTenantStatusRow

type TenantInvitesByTenantStatusRow struct {
	ID        string
	UserID    string
	InvitedBy string
	Role      string
	Status    string
	ExpiresAt *time.Time
	ActedAt   *time.Time
	CreatedAt time.Time
}

type TenantInvitesByUserRow

type TenantInvitesByUserRow struct {
	ID        string
	Slug      string
	UserID    string
	InvitedBy string
	Role      string
	Status    string
	ExpiresAt *time.Time
	ActedAt   *time.Time
	CreatedAt time.Time
}

type TenantInvitesByUserStatusParams

type TenantInvitesByUserStatusParams struct {
	UserID string
	Status string
}

type TenantInvitesByUserStatusRow

type TenantInvitesByUserStatusRow struct {
	ID        string
	Slug      string
	UserID    string
	InvitedBy string
	Role      string
	Status    string
	ExpiresAt *time.Time
	ActedAt   *time.Time
	CreatedAt time.Time
}

type TenantIssuerByIssuerRow

type TenantIssuerByIssuerRow struct {
	ID         string
	Slug       string
	Issuer     string
	JwksUri    string
	Audiences  []string
	Enabled    bool
	Mode       string
	PublicKeys []byte
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type TenantIssuerUpsertParams

type TenantIssuerUpsertParams struct {
	TenantID   string
	Issuer     string
	JwksUri    string
	Audiences  []string
	Enabled    bool
	Mode       string
	PublicKeys []byte
}

type TenantIssuerUpsertRow

type TenantIssuerUpsertRow struct {
	ID         string
	Issuer     string
	JwksUri    string
	Audiences  []string
	Enabled    bool
	Mode       string
	PublicKeys []byte
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type TenantIssuersAllRow

type TenantIssuersAllRow struct {
	ID         string
	Slug       string
	Issuer     string
	JwksUri    string
	Audiences  []string
	Enabled    bool
	Mode       string
	PublicKeys []byte
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type TenantIssuersEnabledRow

type TenantIssuersEnabledRow struct {
	ID         string
	Slug       string
	Issuer     string
	JwksUri    string
	Audiences  []string
	Enabled    bool
	Mode       string
	PublicKeys []byte
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type TenantMemberAddParams

type TenantMemberAddParams struct {
	TenantID string
	UserID   string
}

type TenantMemberHasRoleParams

type TenantMemberHasRoleParams struct {
	TenantID string
	UserID   string
	Role     string
}

type TenantMemberRoleParams

type TenantMemberRoleParams struct {
	TenantID string
	UserID   string
}

type TenantMemberSoftDeleteParams

type TenantMemberSoftDeleteParams struct {
	TenantID string
	UserID   string
}

type TenantMembershipExistsParams

type TenantMembershipExistsParams struct {
	TenantID string
	UserID   string
}

type TenantMembershipResetRoleParams

type TenantMembershipResetRoleParams struct {
	TenantID string
	UserID   string
	Role     string
}

type TenantMembershipSetRoleParams

type TenantMembershipSetRoleParams struct {
	Role     string
	TenantID string
	UserID   string
}

type TenantMembershipUpsertRoleParams

type TenantMembershipUpsertRoleParams struct {
	TenantID string
	UserID   string
	Role     string
}

type TenantMetadataPatchParams

type TenantMetadataPatchParams struct {
	Patch []byte
	ID    string
}

type TenantNamespaceStateByIDRow

type TenantNamespaceStateByIDRow struct {
	StateRaw string
	Reserved bool
}

type TenantRenameInsertParams

type TenantRenameInsertParams struct {
	TenantID string
	FromSlug string
}

type TenantRoleDefineParams

type TenantRoleDefineParams struct {
	TenantID string
	Role     string
}

type TenantRoleDeleteParams

type TenantRoleDeleteParams struct {
	TenantID string
	Role     string
}

type TenantRoleExistsParams

type TenantRoleExistsParams struct {
	TenantID string
	Role     string
}

type TenantRoleHasPermissionsParams

type TenantRoleHasPermissionsParams struct {
	TenantID string
	Role     string
}

type TenantRoleMemberCountParams

type TenantRoleMemberCountParams struct {
	TenantID string
	Role     string
}

type TenantRolePermissionInsertParams

type TenantRolePermissionInsertParams struct {
	TenantID   string
	Role       string
	Permission string
}

type TenantRolePermissionsDeleteParams

type TenantRolePermissionsDeleteParams struct {
	TenantID string
	Role     string
}

type TenantRolePermissionsParams

type TenantRolePermissionsParams struct {
	TenantID string
	Role     string
}

type TenantRolesSeedOwnerMemberParams

type TenantRolesSeedOwnerMemberParams struct {
	TenantID   string
	OwnerRole  string
	MemberRole string
}

type TenantSetNamespaceStateParams

type TenantSetNamespaceStateParams struct {
	State    string
	Reserved bool
	ID       string
}

type TenantSetReservedParams

type TenantSetReservedParams struct {
	Reserved bool
	ID       string
}

type TenantSlugAndPersonalByIDRow

type TenantSlugAndPersonalByIDRow struct {
	Slug       string
	IsPersonal bool
}

type TenantUpdateSlugParams

type TenantUpdateSlugParams struct {
	Slug string
	ID   string
}

type TenantUpdateSlugUnconditionalParams

type TenantUpdateSlugUnconditionalParams struct {
	Slug string
	ID   string
}

type TwoFactorEnableParams

type TwoFactorEnableParams struct {
	UserID      string
	Method      string
	PhoneNumber *string
	BackupCodes []string
}

type TwoFactorSetBackupCodesParams

type TwoFactorSetBackupCodesParams struct {
	BackupCodes []string
	UserID      string
}

type UserApplyEmailChangeParams

type UserApplyEmailChangeParams struct {
	ID    string
	Email string
}

type UserApplyPhoneChangeParams

type UserApplyPhoneChangeParams struct {
	ID          string
	PhoneNumber *string
}

type UserBanParams

type UserBanParams struct {
	BannedAt    *time.Time
	BannedUntil *time.Time
	BanReason   *string
	BannedBy    *string
	ID          string
}

type UserByEmailRow

type UserByEmailRow struct {
	ID              string
	Email           *string
	PhoneNumber     *string
	Username        *string
	DiscordUsername *string
	EmailVerified   bool
	PhoneVerified   bool
	BannedAt        *time.Time
	BannedUntil     *time.Time
	BanReason       *string
	BannedBy        *string
	DeletedAt       *time.Time
	Biography       *string
	CreatedAt       time.Time
	UpdatedAt       time.Time
	LastLogin       *time.Time
}

type UserByIDRow

type UserByIDRow struct {
	ID              string
	Email           *string
	PhoneNumber     *string
	Username        *string
	DiscordUsername *string
	EmailVerified   bool
	PhoneVerified   bool
	BannedAt        *time.Time
	BannedUntil     *time.Time
	BanReason       *string
	BannedBy        *string
	DeletedAt       *time.Time
	Biography       *string
	CreatedAt       time.Time
	UpdatedAt       time.Time
	LastLogin       *time.Time
}

type UserByPhoneRow

type UserByPhoneRow struct {
	ID              string
	Email           *string
	PhoneNumber     *string
	Username        *string
	DiscordUsername *string
	EmailVerified   bool
	PhoneVerified   bool
	BannedAt        *time.Time
	BannedUntil     *time.Time
	BanReason       *string
	BannedBy        *string
	DeletedAt       *time.Time
	Biography       *string
	CreatedAt       time.Time
	UpdatedAt       time.Time
	LastLogin       *time.Time
}

type UserBySlugRow

type UserBySlugRow struct {
	ID       string
	Username string
}

type UserBySlugViaRenameRow

type UserBySlugViaRenameRow struct {
	ID       string
	Username string
}

type UserByUsernameRow

type UserByUsernameRow struct {
	ID              string
	Email           *string
	PhoneNumber     *string
	Username        *string
	DiscordUsername *string
	EmailVerified   bool
	PhoneVerified   bool
	BannedAt        *time.Time
	BannedUntil     *time.Time
	BanReason       *string
	BannedBy        *string
	DeletedAt       *time.Time
	Biography       *string
	CreatedAt       time.Time
	UpdatedAt       time.Time
	LastLogin       *time.Time
}

type UserEmailOrUsernameExistsParams

type UserEmailOrUsernameExistsParams struct {
	Email    string
	Username string
}

type UserEmailOrUsernameTakenParams

type UserEmailOrUsernameTakenParams struct {
	Email    string
	Username string
}

type UserEmailOrUsernameTakenRow

type UserEmailOrUsernameTakenRow struct {
	EmailTaken    bool
	UsernameTaken bool
}

type UserIDReservedByUsernameRow

type UserIDReservedByUsernameRow struct {
	ID       string
	Reserved bool
}

type UserImportInsertParams

type UserImportInsertParams struct {
	ID            string
	Email         *string
	PhoneNumber   *string
	Username      *string
	EmailVerified bool
	PhoneVerified *bool
	BannedAt      *time.Time
	BannedUntil   *time.Time
	BanReason     *string
	BannedBy      *string
	Metadata      []byte
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

type UserImportUpdateParams

type UserImportUpdateParams struct {
	Email         *string
	PhoneNumber   *string
	Username      *string
	EmailVerified bool
	PhoneVerified *bool
	BannedAt      *time.Time
	BannedUntil   *time.Time
	BanReason     *string
	BannedBy      *string
	Metadata      []byte
	CreatedAt     time.Time
	UpdatedAt     time.Time
	ID            string
}

type UserInsertParams

type UserInsertParams struct {
	ID       string
	Email    string
	Username *string
}

type UserInsertRow

type UserInsertRow struct {
	ID            string
	Email         *string
	Username      *string
	EmailVerified bool
	BannedAt      *time.Time
	DeletedAt     *time.Time
}

type UserMetadataPatchParams

type UserMetadataPatchParams struct {
	Patch []byte
	ID    string
}

type UserPasswordInsertParams

type UserPasswordInsertParams struct {
	UserID       string
	PasswordHash string
}

type UserPasswordRowRow

type UserPasswordRowRow struct {
	PasswordHash string
	HashAlgo     string
	HashParams   []byte
}

type UserPasswordUpsertParams

type UserPasswordUpsertParams struct {
	UserID       string
	PasswordHash string
	HashAlgo     string
	HashParams   []byte
}

type UserPhoneOrUsernameExistsParams

type UserPhoneOrUsernameExistsParams struct {
	Phone    string
	Username string
}

type UserPhoneOrUsernameTakenParams

type UserPhoneOrUsernameTakenParams struct {
	Phone    string
	Username string
}

type UserPhoneOrUsernameTakenRow

type UserPhoneOrUsernameTakenRow struct {
	PhoneTaken    bool
	UsernameTaken bool
}

type UserPreferredLocaleRow

type UserPreferredLocaleRow struct {
	Locale                   string
	Source                   string
	PreferredLocaleUpdatedAt *time.Time
}

type UserProviderDeleteBySlugParams

type UserProviderDeleteBySlugParams struct {
	UserID       string
	ProviderSlug *string
}

type UserProviderDeleteOtherSubjectsParams

type UserProviderDeleteOtherSubjectsParams struct {
	UserID  string
	Issuer  string
	Subject string
}

type UserProviderInsertSimpleParams

type UserProviderInsertSimpleParams struct {
	ID              string
	UserID          string
	Issuer          string
	Subject         string
	EmailAtProvider *string
}

type UserProviderLinkExistsParams

type UserProviderLinkExistsParams struct {
	UserID       string
	Issuer       string
	ProviderSlug *string
}

type UserProviderMergeProfileParams

type UserProviderMergeProfileParams struct {
	UserID  string
	Issuer  string
	Subject string
	Patch   []byte
}

type UserProviderSetUsernameParams

type UserProviderSetUsernameParams struct {
	UserID   string
	Issuer   string
	Subject  string
	Username string
}

type UserProviderSubjectByIssuerParams

type UserProviderSubjectByIssuerParams struct {
	UserID string
	Issuer string
}

type UserProviderSubjectProfileByIssuerParams

type UserProviderSubjectProfileByIssuerParams struct {
	UserID string
	Issuer string
}

type UserProviderSubjectProfileByIssuerRow

type UserProviderSubjectProfileByIssuerRow struct {
	Subject   string
	CreatedAt time.Time
	Profile   string
}

type UserProviderUpsertByIssuerParams

type UserProviderUpsertByIssuerParams struct {
	ID              string
	UserID          string
	Issuer          string
	ProviderSlug    *string
	Subject         string
	EmailAtProvider *string
}

type UserProviderUsernameParams

type UserProviderUsernameParams struct {
	UserID       string
	ProviderSlug *string
}

type UserRenameInsertParams

type UserRenameInsertParams struct {
	UserID   string
	FromSlug string
}

type UserSetBiographyParams

type UserSetBiographyParams struct {
	ID        string
	Biography *string
}

type UserSetEmailAndUnverifyParams

type UserSetEmailAndUnverifyParams struct {
	ID    string
	Email string
}

type UserSetEmailVerifiedParams

type UserSetEmailVerifiedParams struct {
	ID            string
	EmailVerified bool
}

type UserSetLastLoginParams

type UserSetLastLoginParams struct {
	ID        string
	LastLogin *time.Time
}

type UserSetPhoneAndVerifiedParams

type UserSetPhoneAndVerifiedParams struct {
	ID            string
	PhoneNumber   *string
	PhoneVerified *bool
}

type UserSetPhoneVerifiedByIDAndPhoneParams

type UserSetPhoneVerifiedByIDAndPhoneParams struct {
	ID          string
	PhoneNumber *string
}

type UserSetPhoneVerifiedByIDParams

type UserSetPhoneVerifiedByIDParams struct {
	ID            string
	PhoneVerified *bool
}

type UserSetPreferredLocaleParams

type UserSetPreferredLocaleParams struct {
	ID                    string
	PreferredLocale       *string
	PreferredLocaleSource *string
}

type UserSetReservedParams

type UserSetReservedParams struct {
	Reserved bool
	ID       string
}

type UserSetUsernameParams

type UserSetUsernameParams struct {
	ID       string
	Username *string
}

type UsersPurgeCandidatesParams

type UsersPurgeCandidatesParams struct {
	Cutoff  *time.Time
	MaxRows int64
}

Jump to

Keyboard shortcuts

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