db

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Schema indirection (authkit issue 69).

Every SQL statement in authkit — the sqlc-generated constants in this package and the few raw statements in core — is schema-qualified with the literal prefix "profiles.". Hosts embed authkit with a pgx pool that is SHARED with their own queries, so pointing authkit at a different schema via search_path on the pool is ruled out (it would leak into host queries). Instead the qualifier stays in the SQL text and becomes a variable: ForSchema wraps a DBTX so the "profiles." prefix is rewritten to "<schema>." on every statement at execution time. This is a deliberate, documented string substitution: schema names are validated against a strict identifier grammar (ValidSchemaName) at configuration time, every authkit table/function reference is written as `profiles.<name>` (guarded by a test in this package), and the rewrite is the identity (no wrapper at all) for the default schema, so existing embedders see zero change.

Index

Constants

View Source
const DefaultSchema = "profiles"

DefaultSchema is the historical hard-coded schema name. All SQL in this package is written against it; ForSchema rewrites it when a host configures a different schema.

Variables

This section is empty.

Functions

func RewriteSQL added in v0.26.0

func RewriteSQL(sql, schema string) string

RewriteSQL returns sql with every literal "profiles." qualifier replaced by schema+".". Callers must have validated schema via ValidSchemaName.

func ValidSchemaName added in v0.26.0

func ValidSchemaName(s string) bool

ValidSchemaName reports whether s is acceptable as a configured schema name: lowercase snake_case identifier, at most 63 bytes (the Postgres identifier limit, so the name is never silently truncated server-side).

Types

type APIKeyByKeyIDRow added in v0.41.0

type APIKeyByKeyIDRow struct {
	ID           string
	SecretHash   []byte
	Role         string
	ExpiresAt    *time.Time
	RevokedAt    *time.Time
	OrgID        string
	Slug         string
	OrgDeletedAt *time.Time
}

type APIKeyInsertParams added in v0.41.0

type APIKeyInsertParams struct {
	OrgID      string
	KeyID      string
	SecretHash []byte
	Name       string
	Role       string
	CreatedBy  *string
	ExpiresAt  *time.Time
}

type APIKeyInsertRow added in v0.41.0

type APIKeyInsertRow struct {
	ID        string
	CreatedAt time.Time
}

type APIKeyResourceInsertParams added in v0.41.0

type APIKeyResourceInsertParams struct {
	ApiKeyID   string
	Kind       string
	ResourceID string
}

type APIKeyResourcesByAPIKeyIDRow added in v0.41.0

type APIKeyResourcesByAPIKeyIDRow struct {
	Kind       string
	ResourceID string
}

type APIKeyResourcesByAPIKeyIDsRow added in v0.41.0

type APIKeyResourcesByAPIKeyIDsRow struct {
	ApiKeyID   string
	Kind       string
	ResourceID string
}

type APIKeyRevokeParams added in v0.41.0

type APIKeyRevokeParams struct {
	ID    string
	OrgID string
}

type APIKeysByOrgRow added in v0.41.0

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

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
}

func ForSchema added in v0.26.0

func ForSchema(d DBTX, schema string) DBTX

ForSchema wraps d so every statement executed through it has its "profiles." qualifiers rewritten to the given schema. For the default schema (or empty, meaning default) it returns d unchanged, so the default path has zero overhead. The per-call strings.ReplaceAll is negligible next to the network round trip and keeps the wrapper stateless, which matters because transaction-scoped wrappers are created per transaction.

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 NamespaceOrgBySlugRow added in v0.30.0

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

type NamespaceOrgRenameBySlugRow added in v0.30.0

type NamespaceOrgRenameBySlugRow 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 OrgBySlugRow added in v0.30.0

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

type OrgBySlugViaRenameRow added in v0.30.0

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

type OrgDemoteAllOwnersParams added in v0.43.0

type OrgDemoteAllOwnersParams struct {
	MemberRole string
	OrgID      string
	OwnerRole  string
}

type OrgIDPersonalBySlugRow added in v0.30.0

type OrgIDPersonalBySlugRow struct {
	ID         string
	IsPersonal bool
}

type OrgIDReservedBySlugRow added in v0.30.0

type OrgIDReservedBySlugRow struct {
	ID       string
	Reserved bool
}

type OrgInsertParams added in v0.30.0

type OrgInsertParams struct {
	ID   string
	Slug string
}

type OrgInsertRow added in v0.30.0

type OrgInsertRow struct {
	ID   string
	Slug string
}

type OrgInsertWithStateParams added in v0.30.0

type OrgInsertWithStateParams struct {
	ID    string
	Slug  string
	State string
}

type OrgInviteForUpdateRow added in v0.30.0

type OrgInviteForUpdateRow struct {
	OrgID     string
	UserID    string
	Role      string
	Status    string
	ExpiresAt *time.Time
}

type OrgInviteInsertParams added in v0.30.0

type OrgInviteInsertParams struct {
	ID        string
	OrgID     string
	UserID    string
	InvitedBy string
	Role      string
	ExpiresAt *time.Time
}

type OrgInviteInsertRow added in v0.30.0

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

type OrgInviteRevokeParams added in v0.30.0

type OrgInviteRevokeParams struct {
	ID    string
	OrgID string
}

type OrgInviteSetStatusParams added in v0.30.0

type OrgInviteSetStatusParams struct {
	Status string
	ID     string
}

type OrgInvitesByOrgRow added in v0.30.0

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

type OrgInvitesByOrgStatusParams added in v0.30.0

type OrgInvitesByOrgStatusParams struct {
	OrgID  string
	Status string
}

type OrgInvitesByOrgStatusRow added in v0.30.0

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

type OrgInvitesByUserRow added in v0.30.0

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

type OrgInvitesByUserStatusParams added in v0.30.0

type OrgInvitesByUserStatusParams struct {
	UserID string
	Status string
}

type OrgInvitesByUserStatusRow added in v0.30.0

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

type OrgMemberAddParams added in v0.30.0

type OrgMemberAddParams struct {
	OrgID  string
	UserID string
}

type OrgMemberHasRoleParams added in v0.30.0

type OrgMemberHasRoleParams struct {
	OrgID  string
	UserID string
	Role   string
}

type OrgMemberRoleParams added in v0.30.0

type OrgMemberRoleParams struct {
	OrgID  string
	UserID string
}

type OrgMemberRolePrincipalParams added in v0.30.0

type OrgMemberRolePrincipalParams struct {
	OrgID      string
	MemberID   string
	MemberKind string
}

type OrgMemberSoftDeleteParams added in v0.30.0

type OrgMemberSoftDeleteParams struct {
	OrgID  string
	UserID string
}

type OrgMemberSoftDeletePrincipalParams added in v0.30.0

type OrgMemberSoftDeletePrincipalParams struct {
	OrgID      string
	MemberID   string
	MemberKind string
}

type OrgMembershipExistsParams added in v0.30.0

type OrgMembershipExistsParams struct {
	OrgID  string
	UserID string
}

type OrgMembershipResetRoleParams added in v0.30.0

type OrgMembershipResetRoleParams struct {
	OrgID  string
	UserID string
	Role   string
}

type OrgMembershipSetRoleParams added in v0.30.0

type OrgMembershipSetRoleParams struct {
	Role   string
	OrgID  string
	UserID string
}

type OrgMembershipUpsertRoleParams added in v0.30.0

type OrgMembershipUpsertRoleParams struct {
	OrgID  string
	UserID string
	Role   string
}

type OrgMembershipUpsertRolePrincipalParams added in v0.30.0

type OrgMembershipUpsertRolePrincipalParams struct {
	OrgID      string
	MemberID   string
	MemberKind string
	Role       string
}

type OrgMetadataPatchParams added in v0.30.0

type OrgMetadataPatchParams struct {
	Patch []byte
	ID    string
}

type OrgNamespaceStateByIDRow added in v0.30.0

type OrgNamespaceStateByIDRow struct {
	StateRaw string
	Reserved bool
}

type OrgRenameInsertParams added in v0.30.0

type OrgRenameInsertParams struct {
	OrgID    string
	FromSlug string
}

type OrgRoleDefineParams added in v0.30.0

type OrgRoleDefineParams struct {
	OrgID string
	Role  string
}

type OrgRoleDeleteParams added in v0.30.0

type OrgRoleDeleteParams struct {
	OrgID string
	Role  string
}

type OrgRoleExistsParams added in v0.30.0

type OrgRoleExistsParams struct {
	OrgID string
	Role  string
}

type OrgRoleHasPermissionsParams added in v0.30.0

type OrgRoleHasPermissionsParams struct {
	OrgID string
	Role  string
}

type OrgRoleMemberCountParams added in v0.30.0

type OrgRoleMemberCountParams struct {
	OrgID string
	Role  string
}

type OrgRolePermissionInsertParams added in v0.30.0

type OrgRolePermissionInsertParams struct {
	OrgID      string
	Role       string
	Permission string
}

type OrgRolePermissionsDeleteParams added in v0.30.0

type OrgRolePermissionsDeleteParams struct {
	OrgID string
	Role  string
}

type OrgRolePermissionsParams added in v0.30.0

type OrgRolePermissionsParams struct {
	OrgID string
	Role  string
}

type OrgRolesForPrincipalParams added in v0.30.0

type OrgRolesForPrincipalParams struct {
	MemberID   string
	MemberKind string
}

type OrgRolesForPrincipalRow added in v0.30.0

type OrgRolesForPrincipalRow struct {
	Slug string
	Role string
}

type OrgRolesSeedOwnerMemberParams added in v0.30.0

type OrgRolesSeedOwnerMemberParams struct {
	OrgID      string
	OwnerRole  string
	MemberRole string
}

type OrgSetNamespaceStateParams added in v0.30.0

type OrgSetNamespaceStateParams struct {
	State    string
	Reserved bool
	ID       string
}

type OrgSetReservedParams added in v0.30.0

type OrgSetReservedParams struct {
	Reserved bool
	ID       string
}

type OrgSlugAndPersonalByIDRow added in v0.30.0

type OrgSlugAndPersonalByIDRow struct {
	Slug       string
	IsPersonal bool
}

type OrgUpdateSlugParams added in v0.30.0

type OrgUpdateSlugParams struct {
	Slug string
	ID   string
}

type OrgUpdateSlugUnconditionalParams added in v0.30.0

type OrgUpdateSlugUnconditionalParams struct {
	Slug string
	ID   string
}

type OrgUserHasPermissionTokenParams added in v0.42.0

type OrgUserHasPermissionTokenParams struct {
	UserID      string
	Permissions []string
	OrgSlug     string
}

type OrgUserPermissionsParams added in v0.43.0

type OrgUserPermissionsParams struct {
	UserID  string
	OrgSlug string
}

type OrgsAdminListParams added in v0.42.0

type OrgsAdminListParams struct {
	Search         *string
	IncludeDeleted bool
	PageOffset     int32
	PageLimit      int32
}

type OrgsAdminListRow added in v0.42.0

type OrgsAdminListRow struct {
	ID          string
	Slug        string
	IsPersonal  bool
	OwnerUserID string
	CreatedAt   time.Time
	DeletedAt   *time.Time
}

type OwnerSlugConflictExistsParams

type OwnerSlugConflictExistsParams struct {
	Slug        string
	ReuseCutoff time.Time
}

type OwnerSlugOrgExistsParams added in v0.30.0

type OwnerSlugOrgExistsParams struct {
	Slug         string
	ExcludeOrgID string
}

type OwnerSlugOrgRenameHeldParams added in v0.30.0

type OwnerSlugOrgRenameHeldParams struct {
	Slug         string
	ReuseCutoff  time.Time
	ExcludeOrgID string
}

type OwnerSlugUserExistsParams

type OwnerSlugUserExistsParams struct {
	Slug          string
	ExcludeUserID string
}

type OwnerSlugUserRenameHeldParams

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

type PersonalOrgByOwnerRow added in v0.30.0

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

type PersonalOrgIDSlugByOwnerRow added in v0.30.0

type PersonalOrgIDSlugByOwnerRow struct {
	ID   string
	Slug string
}

type PersonalOrgIDSlugReservedByOwnerRow added in v0.30.0

type PersonalOrgIDSlugReservedByOwnerRow struct {
	ID       string
	Slug     string
	Reserved bool
}

type PersonalOrgInsertBasicParams added in v0.30.0

type PersonalOrgInsertBasicParams struct {
	ID          string
	Slug        string
	OwnerUserID string
}

type PersonalOrgUpsertParams added in v0.30.0

type PersonalOrgUpsertParams struct {
	ID          string
	Slug        string
	OwnerUserID string
}

type PlatformRolePermissionInsertParams added in v0.42.0

type PlatformRolePermissionInsertParams struct {
	Role       string
	Permission string
}

type PlatformUserHasPermissionTokenParams added in v0.42.0

type PlatformUserHasPermissionTokenParams struct {
	Permissions []string
	UserID      string
}

type PlatformUserRoleDeleteParams added in v0.42.0

type PlatformUserRoleDeleteParams struct {
	UserID string
	Role   string
}

type PlatformUserRoleInsertParams added in v0.42.0

type PlatformUserRoleInsertParams struct {
	UserID string
	Role   string
}

type ProfilesOrg added in v0.30.0

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

type ProfilesOrgInvite added in v0.30.0

type ProfilesOrgInvite struct {
	ID        string
	OrgID     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 ProfilesOrgMembership added in v0.30.0

type ProfilesOrgMembership struct {
	OrgID string
	// Principal id; referent table named by member_kind.
	MemberID  string
	Role      string
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
	// Principal kind: user | remote_application. One membership system serves both.
	MemberKind string
}

type ProfilesOrgRename added in v0.30.0

type ProfilesOrgRename struct {
	ID        int64
	OrgID     string
	FromSlug  string
	RenamedAt time.Time
}

type ProfilesOrgRole added in v0.30.0

type ProfilesOrgRole struct {
	OrgID     string
	Role      string
	CreatedAt time.Time
}

type ProfilesOrgRolePermission added in v0.30.0

type ProfilesOrgRolePermission struct {
	OrgID      string
	Role       string
	Permission string
	CreatedAt  time.Time
}

type ProfilesOwnerReservedName

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

type ProfilesPlatformRole added in v0.42.0

type ProfilesPlatformRole struct {
	Role      string
	CreatedAt time.Time
}

Layer-2 platform RBAC (#95): named platform roles, assigned to users directly, granting ONLY platform: perms. The disjoint ClusterRole plane — never reaches inside an org.

type ProfilesPlatformRolePermission added in v0.42.0

type ProfilesPlatformRolePermission struct {
	Role       string
	Permission string
	CreatedAt  time.Time
}

type ProfilesPlatformUserRole added in v0.42.0

type ProfilesPlatformUserRole struct {
	UserID    string
	Role      string
	CreatedAt 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 ProfilesRemoteApplication added in v0.27.0

type ProfilesRemoteApplication struct {
	ID         string
	Slug       string
	Issuer     string
	JwksUri    string
	Mode       string
	PublicKeys []byte
	Audiences  []string
	Enabled    bool
	Metadata   []byte
	CreatedAt  time.Time
	UpdatedAt  time.Time
	DeletedAt  *time.Time
	// REQUIRED controlling org (#95): remote-apps are org-nested like api-keys. No org-less/operator-managed issuer — every issuer is org-bound and maps to one merchant via its owning org.
	OrgID          string
	AllowedOrigins []string
}

Federation principals: external systems that authenticate by signing JWTs verified against their JWKS/public keys. Members of orgs with roles via polymorphic org_memberships.

type ProfilesRemoteApplicationAttributeDef added in v0.27.0

type ProfilesRemoteApplicationAttributeDef struct {
	RemoteApplicationID string
	Key                 string
	Version             int32
	Definition          []byte
	CreatedAt           time.Time
	UpdatedAt           time.Time
}

REFERENCE-mode attribute definitions: (remote_application_id, key, version) -> opaque definition jsonb. AuthKit transports + serves, never interprets (#75).

type ProfilesServiceToken

type ProfilesServiceToken struct {
	ID         string
	OrgID      string
	KeyID      string
	SecretHash []byte
	Name       string
	CreatedBy  *string
	CreatedAt  time.Time
	LastUsedAt *time.Time
	ExpiresAt  *time.Time
	RevokedAt  *time.Time
	// The single org role this API key holds. Effective permissions are resolved from the role (org_role_permissions) at use time — edit the role to change every key that holds it. Resource-scope is a separate binding (service_token_resources).
	Role string
}

type ProfilesServiceTokenResource

type ProfilesServiceTokenResource struct {
	TokenID    string
	Kind       string
	ResourceID 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) APIKeyByKeyID added in v0.41.0

func (q *Queries) APIKeyByKeyID(ctx context.Context, keyID string) (APIKeyByKeyIDRow, error)

func (*Queries) APIKeyInsert added in v0.41.0

func (q *Queries) APIKeyInsert(ctx context.Context, arg APIKeyInsertParams) (APIKeyInsertRow, error)

API key queries (core/api_keys.go).

An API key holds exactly ONE org role (#95). Its effective permissions are resolved FROM that role (profiles.org_role_permissions) at use time, so the queries here only ever carry the role NAME — never a per-key permission list. There is no service_token_permissions table.

func (*Queries) APIKeyResourceInsert added in v0.41.0

func (q *Queries) APIKeyResourceInsert(ctx context.Context, arg APIKeyResourceInsertParams) error

func (*Queries) APIKeyResourcesByAPIKeyID added in v0.41.0

func (q *Queries) APIKeyResourcesByAPIKeyID(ctx context.Context, apiKeyID string) ([]APIKeyResourcesByAPIKeyIDRow, error)

func (*Queries) APIKeyResourcesByAPIKeyIDs added in v0.41.0

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

func (*Queries) APIKeyRevoke added in v0.41.0

func (q *Queries) APIKeyRevoke(ctx context.Context, arg APIKeyRevokeParams) (int64, error)

func (*Queries) APIKeyRevokeAllByOrg added in v0.42.0

func (q *Queries) APIKeyRevokeAllByOrg(ctx context.Context, orgID string) (int64, error)

Org-admin (Layer-2 `platform:orgs:*`) queries — the /admin/orgs/* surface + the anti-takeover `recover` reset. core/org_admin.go.

func (*Queries) APIKeyTouchLastUsed added in v0.41.0

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

func (*Queries) APIKeysByOrg added in v0.41.0

func (q *Queries) APIKeysByOrg(ctx context.Context, orgID string) ([]APIKeysByOrgRow, error)

func (*Queries) IdentityCurrentOrgSlug added in v0.30.0

func (q *Queries) IdentityCurrentOrgSlug(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) IdentityForwardOrgSlug added in v0.30.0

func (q *Queries) IdentityForwardOrgSlug(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) NamespaceOrgBySlug added in v0.30.0

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

func (*Queries) NamespaceOrgRenameBySlug added in v0.30.0

func (q *Queries) NamespaceOrgRenameBySlug(ctx context.Context, fromSlug string) (NamespaceOrgRenameBySlugRow, 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) OrgAliases added in v0.30.0

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

func (*Queries) OrgBySlug added in v0.30.0

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

Org + membership + role queries (core/service_orgs.go).

func (*Queries) OrgBySlugViaRename added in v0.30.0

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

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

func (*Queries) OrgDefinedRoles added in v0.30.0

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

func (*Queries) OrgDemoteAllOwners added in v0.43.0

func (q *Queries) OrgDemoteAllOwners(ctx context.Context, arg OrgDemoteAllOwnersParams) (int64, error)

OrgDemoteAllOwners demotes every current owner-role member to the member role. Used by transfer-owner to strip the prior owner(s) before assigning the new one. Reports how many rows changed.

func (*Queries) OrgIDPersonalBySlug added in v0.30.0

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

func (*Queries) OrgIDReservedBySlug added in v0.30.0

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

func (*Queries) OrgInsert added in v0.30.0

func (q *Queries) OrgInsert(ctx context.Context, arg OrgInsertParams) (OrgInsertRow, error)

func (*Queries) OrgInsertWithState added in v0.30.0

func (q *Queries) OrgInsertWithState(ctx context.Context, arg OrgInsertWithStateParams) (string, error)

func (*Queries) OrgInviteForUpdate added in v0.30.0

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

func (*Queries) OrgInviteInsert added in v0.30.0

func (q *Queries) OrgInviteInsert(ctx context.Context, arg OrgInviteInsertParams) (OrgInviteInsertRow, error)

Org invite queries (core/service_org_invites.go).

func (*Queries) OrgInviteMarkExpired added in v0.30.0

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

func (*Queries) OrgInviteRevoke added in v0.30.0

func (q *Queries) OrgInviteRevoke(ctx context.Context, arg OrgInviteRevokeParams) (int64, error)

func (*Queries) OrgInviteSetStatus added in v0.30.0

func (q *Queries) OrgInviteSetStatus(ctx context.Context, arg OrgInviteSetStatusParams) error

func (*Queries) OrgInvitesByOrg added in v0.30.0

func (q *Queries) OrgInvitesByOrg(ctx context.Context, orgID string) ([]OrgInvitesByOrgRow, error)

func (*Queries) OrgInvitesByOrgStatus added in v0.30.0

func (q *Queries) OrgInvitesByOrgStatus(ctx context.Context, arg OrgInvitesByOrgStatusParams) ([]OrgInvitesByOrgStatusRow, error)

func (*Queries) OrgInvitesByUser added in v0.30.0

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

func (*Queries) OrgInvitesByUserStatus added in v0.30.0

func (q *Queries) OrgInvitesByUserStatus(ctx context.Context, arg OrgInvitesByUserStatusParams) ([]OrgInvitesByUserStatusRow, error)

func (*Queries) OrgLastRenamedAt added in v0.30.0

func (q *Queries) OrgLastRenamedAt(ctx context.Context, orgID string) (time.Time, error)

func (*Queries) OrgMemberAdd added in v0.30.0

func (q *Queries) OrgMemberAdd(ctx context.Context, arg OrgMemberAddParams) error

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

func (*Queries) OrgMemberCountByOrg added in v0.42.0

func (q *Queries) OrgMemberCountByOrg(ctx context.Context, orgID string) (int64, error)

func (*Queries) OrgMemberHasRole added in v0.30.0

func (q *Queries) OrgMemberHasRole(ctx context.Context, arg OrgMemberHasRoleParams) (bool, error)

func (*Queries) OrgMemberIDs added in v0.30.0

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

func (*Queries) OrgMemberRole added in v0.30.0

func (q *Queries) OrgMemberRole(ctx context.Context, arg OrgMemberRoleParams) (string, error)

func (*Queries) OrgMemberRolePrincipal added in v0.30.0

func (q *Queries) OrgMemberRolePrincipal(ctx context.Context, arg OrgMemberRolePrincipalParams) (string, error)

func (*Queries) OrgMemberSoftDelete added in v0.30.0

func (q *Queries) OrgMemberSoftDelete(ctx context.Context, arg OrgMemberSoftDeleteParams) error

func (*Queries) OrgMemberSoftDeletePrincipal added in v0.30.0

func (q *Queries) OrgMemberSoftDeletePrincipal(ctx context.Context, arg OrgMemberSoftDeletePrincipalParams) error

func (*Queries) OrgMembershipExists added in v0.30.0

func (q *Queries) OrgMembershipExists(ctx context.Context, arg OrgMembershipExistsParams) (bool, error)

func (*Queries) OrgMembershipResetRole added in v0.30.0

func (q *Queries) OrgMembershipResetRole(ctx context.Context, arg OrgMembershipResetRoleParams) error

func (*Queries) OrgMembershipSetRole added in v0.30.0

func (q *Queries) OrgMembershipSetRole(ctx context.Context, arg OrgMembershipSetRoleParams) error

func (*Queries) OrgMembershipUpsertRole added in v0.30.0

func (q *Queries) OrgMembershipUpsertRole(ctx context.Context, arg OrgMembershipUpsertRoleParams) error

func (*Queries) OrgMembershipUpsertRolePrincipal added in v0.30.0

func (q *Queries) OrgMembershipUpsertRolePrincipal(ctx context.Context, arg OrgMembershipUpsertRolePrincipalParams) error

Polymorphic remote_application memberships: a remote_app holds org roles via the SAME org_memberships/org_roles machinery as users (#74).

func (*Queries) OrgMembershipsSoftDeleteAllByOrg added in v0.42.0

func (q *Queries) OrgMembershipsSoftDeleteAllByOrg(ctx context.Context, orgID string) (int64, error)

func (*Queries) OrgMetadata added in v0.30.0

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

func (*Queries) OrgMetadataPatch added in v0.30.0

func (q *Queries) OrgMetadataPatch(ctx context.Context, arg OrgMetadataPatchParams) (int64, error)

func (*Queries) OrgNamespaceStateByID added in v0.30.0

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

func (*Queries) OrgRenameInsert added in v0.30.0

func (q *Queries) OrgRenameInsert(ctx context.Context, arg OrgRenameInsertParams) error

func (*Queries) OrgRestore added in v0.42.0

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

func (*Queries) OrgRoleDefine added in v0.30.0

func (q *Queries) OrgRoleDefine(ctx context.Context, arg OrgRoleDefineParams) error

func (*Queries) OrgRoleDelete added in v0.30.0

func (q *Queries) OrgRoleDelete(ctx context.Context, arg OrgRoleDeleteParams) error

func (*Queries) OrgRoleExists added in v0.30.0

func (q *Queries) OrgRoleExists(ctx context.Context, arg OrgRoleExistsParams) (bool, error)

func (*Queries) OrgRoleHasPermissions added in v0.30.0

func (q *Queries) OrgRoleHasPermissions(ctx context.Context, arg OrgRoleHasPermissionsParams) (bool, error)

func (*Queries) OrgRoleMemberCount added in v0.30.0

func (q *Queries) OrgRoleMemberCount(ctx context.Context, arg OrgRoleMemberCountParams) (int64, error)

func (*Queries) OrgRolePermissionInsert added in v0.30.0

func (q *Queries) OrgRolePermissionInsert(ctx context.Context, arg OrgRolePermissionInsertParams) error

func (*Queries) OrgRolePermissions added in v0.30.0

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

Org RBAC role-permission queries (core/org_role_permissions.go).

func (*Queries) OrgRolePermissionsDelete added in v0.30.0

func (q *Queries) OrgRolePermissionsDelete(ctx context.Context, arg OrgRolePermissionsDeleteParams) error

func (*Queries) OrgRolesForPrincipal added in v0.30.0

func (q *Queries) OrgRolesForPrincipal(ctx context.Context, arg OrgRolesForPrincipalParams) ([]OrgRolesForPrincipalRow, error)

func (*Queries) OrgRolesSeedOwnerMember added in v0.30.0

func (q *Queries) OrgRolesSeedOwnerMember(ctx context.Context, arg OrgRolesSeedOwnerMemberParams) error

func (*Queries) OrgSetNamespaceState added in v0.30.0

func (q *Queries) OrgSetNamespaceState(ctx context.Context, arg OrgSetNamespaceStateParams) (int64, error)

func (*Queries) OrgSetReserved added in v0.30.0

func (q *Queries) OrgSetReserved(ctx context.Context, arg OrgSetReservedParams) error

func (*Queries) OrgSlugAndPersonalByID added in v0.30.0

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

func (*Queries) OrgSlugsByUser added in v0.30.0

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

func (*Queries) OrgSoftDelete added in v0.42.0

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

func (*Queries) OrgUpdateSlug added in v0.30.0

func (q *Queries) OrgUpdateSlug(ctx context.Context, arg OrgUpdateSlugParams) error

func (*Queries) OrgUpdateSlugUnconditional added in v0.30.0

func (q *Queries) OrgUpdateSlugUnconditional(ctx context.Context, arg OrgUpdateSlugUnconditionalParams) error

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

func (*Queries) OrgUserHasPermissionToken added in v0.42.0

func (q *Queries) OrgUserHasPermissionToken(ctx context.Context, arg OrgUserHasPermissionTokenParams) (bool, error)

Hot authz path: one indexed query from org slug + user + candidate grant tokens to "allowed?". Handles direct slug and historical rename resolution.

func (*Queries) OrgUserPermissions added in v0.43.0

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

Single indexed-JOIN per-request resolution (#95 memoization): every RAW grant token a user holds in an org across their role, resolving direct + historical (renamed) slugs in ONE round trip. Mirrors OrgUserHasPermissionToken but materializes the token set so a request that checks N perms resolves the org layer ONCE (the gate then matches the cached tokens in-memory). A non-member yields 0 rows. Globs (`org:*`) stay ONE row — never enumerated.

func (*Queries) OrgsAdminList added in v0.42.0

func (q *Queries) OrgsAdminList(ctx context.Context, arg OrgsAdminListParams) ([]OrgsAdminListRow, 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) OwnerSlugOrgExists added in v0.30.0

func (q *Queries) OwnerSlugOrgExists(ctx context.Context, arg OwnerSlugOrgExistsParams) (bool, error)

func (*Queries) OwnerSlugOrgRenameHeld added in v0.30.0

func (q *Queries) OwnerSlugOrgRenameHeld(ctx context.Context, arg OwnerSlugOrgRenameHeldParams) (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) PersonalOrgByOwner added in v0.30.0

func (q *Queries) PersonalOrgByOwner(ctx context.Context, ownerUserID string) (PersonalOrgByOwnerRow, error)

func (*Queries) PersonalOrgIDSlugByOwner added in v0.30.0

func (q *Queries) PersonalOrgIDSlugByOwner(ctx context.Context, ownerUserID string) (PersonalOrgIDSlugByOwnerRow, error)

func (*Queries) PersonalOrgIDSlugReservedByOwner added in v0.30.0

func (q *Queries) PersonalOrgIDSlugReservedByOwner(ctx context.Context, ownerUserID string) (PersonalOrgIDSlugReservedByOwnerRow, error)

func (*Queries) PersonalOrgInsertBasic added in v0.30.0

func (q *Queries) PersonalOrgInsertBasic(ctx context.Context, arg PersonalOrgInsertBasicParams) error

func (*Queries) PersonalOrgUpsert added in v0.30.0

func (q *Queries) PersonalOrgUpsert(ctx context.Context, arg PersonalOrgUpsertParams) (string, error)

func (*Queries) PlatformRoleDelete added in v0.42.0

func (q *Queries) PlatformRoleDelete(ctx context.Context, role string) (int64, error)

func (*Queries) PlatformRoleExists added in v0.42.0

func (q *Queries) PlatformRoleExists(ctx context.Context, role string) (bool, error)

func (*Queries) PlatformRolePermissionInsert added in v0.42.0

func (q *Queries) PlatformRolePermissionInsert(ctx context.Context, arg PlatformRolePermissionInsertParams) error

func (*Queries) PlatformRolePermissions added in v0.42.0

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

func (*Queries) PlatformRolePermissionsDelete added in v0.42.0

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

func (*Queries) PlatformRoleUpsert added in v0.42.0

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

Platform RBAC queries (#95, Layer 2 — the ClusterRole plane). core/platform_rbac.go.

func (*Queries) PlatformRolesList added in v0.42.0

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

func (*Queries) PlatformUserHasPermissionToken added in v0.42.0

func (q *Queries) PlatformUserHasPermissionToken(ctx context.Context, arg PlatformUserHasPermissionTokenParams) (bool, error)

Hot authz path: one indexed query from user + candidate grant tokens to "allowed?". No full permission-set materialization on every platform gate.

func (*Queries) PlatformUserPermissions added in v0.42.0

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

The efficient single indexed-JOIN per-request resolution (#95): every platform permission a user holds across all their platform roles. A regular user has 0 rows in platform_user_roles, so this returns empty without touching the permission table.

func (*Queries) PlatformUserRoleDelete added in v0.42.0

func (q *Queries) PlatformUserRoleDelete(ctx context.Context, arg PlatformUserRoleDeleteParams) (int64, error)

func (*Queries) PlatformUserRoleInsert added in v0.42.0

func (q *Queries) PlatformUserRoleInsert(ctx context.Context, arg PlatformUserRoleInsertParams) error

func (*Queries) PlatformUserRoleMembers added in v0.42.0

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

WHO holds a given platform role (the platform-admin roster read).

func (*Queries) PlatformUserRoles added in v0.42.0

func (q *Queries) PlatformUserRoles(ctx context.Context, userID string) ([]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) RemoteAppAttributeDefDelete added in v0.27.0

func (q *Queries) RemoteAppAttributeDefDelete(ctx context.Context, arg RemoteAppAttributeDefDeleteParams) (int64, error)

func (*Queries) RemoteAppAttributeDefGet added in v0.27.0

func (*Queries) RemoteAppAttributeDefGetLatest added in v0.27.0

func (*Queries) RemoteAppAttributeDefUpsert added in v0.27.0

Attribute definition registry (#75): REFERENCE-mode opaque definitions.

func (*Queries) RemoteAppAttributeDefsList added in v0.27.0

func (q *Queries) RemoteAppAttributeDefsList(ctx context.Context, remoteApplicationID string) ([]RemoteAppAttributeDefsListRow, error)

func (*Queries) RemoteApplicationByIssuer added in v0.27.0

func (q *Queries) RemoteApplicationByIssuer(ctx context.Context, issuer string) (RemoteApplicationByIssuerRow, error)

func (*Queries) RemoteApplicationBySlug added in v0.27.0

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

func (*Queries) RemoteApplicationDelete added in v0.27.0

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

func (*Queries) RemoteApplicationDisableAllByOrg added in v0.42.0

func (q *Queries) RemoteApplicationDisableAllByOrg(ctx context.Context, orgID string) (int64, error)

func (*Queries) RemoteApplicationUpsert added in v0.27.0

func (q *Queries) RemoteApplicationUpsert(ctx context.Context, arg RemoteApplicationUpsertParams) (RemoteApplicationUpsertRow, error)

Remote application registry (core/service_remote_applications.go). A remote_application is the federation PRINCIPAL: it authenticates by signing JWTs verified against its JWKS/public keys (#74).

func (*Queries) RemoteApplicationsAll added in v0.27.0

func (q *Queries) RemoteApplicationsAll(ctx context.Context) ([]RemoteApplicationsAllRow, error)

func (*Queries) RemoteApplicationsEnabled added in v0.27.0

func (q *Queries) RemoteApplicationsEnabled(ctx context.Context) ([]RemoteApplicationsEnabledRow, 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) 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 RemoteAppAttributeDefDeleteParams added in v0.27.0

type RemoteAppAttributeDefDeleteParams struct {
	RemoteApplicationID string
	Key                 string
}

type RemoteAppAttributeDefGetLatestParams added in v0.27.0

type RemoteAppAttributeDefGetLatestParams struct {
	RemoteApplicationID string
	Key                 string
}

type RemoteAppAttributeDefGetLatestRow added in v0.27.0

type RemoteAppAttributeDefGetLatestRow struct {
	RemoteApplicationID string
	Key                 string
	Version             int32
	Definition          []byte
	CreatedAt           time.Time
	UpdatedAt           time.Time
}

type RemoteAppAttributeDefGetParams added in v0.27.0

type RemoteAppAttributeDefGetParams struct {
	RemoteApplicationID string
	Key                 string
	Version             int32
}

type RemoteAppAttributeDefGetRow added in v0.27.0

type RemoteAppAttributeDefGetRow struct {
	RemoteApplicationID string
	Key                 string
	Version             int32
	Definition          []byte
	CreatedAt           time.Time
	UpdatedAt           time.Time
}

type RemoteAppAttributeDefUpsertParams added in v0.27.0

type RemoteAppAttributeDefUpsertParams struct {
	RemoteApplicationID string
	Key                 string
	Version             int32
	Definition          []byte
}

type RemoteAppAttributeDefUpsertRow added in v0.27.0

type RemoteAppAttributeDefUpsertRow struct {
	RemoteApplicationID string
	Key                 string
	Version             int32
	Definition          []byte
	CreatedAt           time.Time
	UpdatedAt           time.Time
}

type RemoteAppAttributeDefsListRow added in v0.27.0

type RemoteAppAttributeDefsListRow struct {
	RemoteApplicationID string
	Key                 string
	Version             int32
	Definition          []byte
	CreatedAt           time.Time
	UpdatedAt           time.Time
}

type RemoteApplicationByIssuerRow added in v0.27.0

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

type RemoteApplicationBySlugRow added in v0.27.0

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

type RemoteApplicationUpsertParams added in v0.27.0

type RemoteApplicationUpsertParams struct {
	Slug           string
	OrgID          *string
	Issuer         string
	JwksUri        string
	Mode           string
	PublicKeys     []byte
	Audiences      []string
	AllowedOrigins []string
	Enabled        bool
}

type RemoteApplicationUpsertRow added in v0.27.0

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

type RemoteApplicationsAllRow added in v0.27.0

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

type RemoteApplicationsEnabledRow added in v0.27.0

type RemoteApplicationsEnabledRow struct {
	ID             string
	Slug           string
	OrgID          string
	Issuer         string
	JwksUri        string
	Mode           string
	PublicKeys     []byte
	Audiences      []string
	AllowedOrigins []string
	Enabled        bool
	CreatedAt      time.Time
	UpdatedAt      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 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