sqlc

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditEvent

type AuditEvent struct {
	ID             pgtype.UUID
	OrganizationID pgtype.UUID
	ActorUserID    pgtype.UUID
	ActorSessionID pgtype.UUID
	Action         string
	TargetType     pgtype.Text
	TargetID       pgtype.Text
	Metadata       []byte
	Ip             pgtype.Text
	UserAgent      pgtype.Text
	CreatedAt      pgtype.Timestamptz
}

type ConfirmTOTPSecretParams

type ConfirmTOTPSecretParams struct {
	UserID      pgtype.UUID
	ConfirmedAt pgtype.Timestamptz
}

type ConsumeRecoveryCodeByIDParams

type ConsumeRecoveryCodeByIDParams struct {
	ID     pgtype.UUID
	UsedAt pgtype.Timestamptz
}

type CountGroupsByOrganizationParams

type CountGroupsByOrganizationParams struct {
	OrganizationID pgtype.UUID
	DisplayName    string
	ExternalID     string
}

type CountUsersByOrganizationParams

type CountUsersByOrganizationParams struct {
	OrganizationID pgtype.UUID
	UserName       string
	ExternalID     string
	Email          string
}

type CountUsersWithPermissionInOrgParams

type CountUsersWithPermissionInOrgParams struct {
	Name           string
	OrganizationID pgtype.UUID
}

type CreateMagicLinkParams

type CreateMagicLinkParams struct {
	ID        pgtype.UUID
	Email     string
	TokenHash []byte
	ExpiresAt pgtype.Timestamptz
	CreatedAt pgtype.Timestamptz
}

type CreatePasswordResetTokenParams

type CreatePasswordResetTokenParams struct {
	ID        pgtype.UUID
	UserID    pgtype.UUID
	TokenHash []byte
	ExpiresAt pgtype.Timestamptz
	CreatedAt pgtype.Timestamptz
}

type CreateSessionParams

type CreateSessionParams struct {
	ID        pgtype.UUID
	UserID    pgtype.UUID
	TokenHash []byte
	UserAgent string
	Ip        *netip.Addr
	CreatedAt pgtype.Timestamptz
	ExpiresAt pgtype.Timestamptz
}

type CreateSessionWithAuthLevelParams

type CreateSessionWithAuthLevelParams struct {
	ID        pgtype.UUID
	UserID    pgtype.UUID
	TokenHash []byte
	UserAgent string
	Ip        *netip.Addr
	CreatedAt pgtype.Timestamptz
	ExpiresAt pgtype.Timestamptz
	AuthLevel string
}

type CreateUserParams

type CreateUserParams struct {
	ID        pgtype.UUID
	Email     string
	Name      string
	AvatarUrl string
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
}

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 DeleteGroupMemberParams

type DeleteGroupMemberParams struct {
	GroupID pgtype.UUID
	UserID  pgtype.UUID
}

type DeleteOrganizationMemberParams

type DeleteOrganizationMemberParams struct {
	OrganizationID pgtype.UUID
	UserID         pgtype.UUID
}

type DeleteWebAuthnCredentialParams

type DeleteWebAuthnCredentialParams struct {
	ID     pgtype.UUID
	UserID pgtype.UUID
}

type GrantUserRoleParams

type GrantUserRoleParams struct {
	UserID    pgtype.UUID
	RoleID    pgtype.UUID
	GrantedAt pgtype.Timestamptz
	GrantedBy pgtype.UUID
}

type Group

type Group struct {
	ID             pgtype.UUID
	OrganizationID pgtype.UUID
	DisplayName    string
	ExternalID     *string
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
}

type GroupByExternalIDInOrgParams

type GroupByExternalIDInOrgParams struct {
	OrganizationID pgtype.UUID
	ExternalID     *string
}

type GroupMember

type GroupMember struct {
	GroupID pgtype.UUID
	UserID  pgtype.UUID
}

type InsertAuditEventParams

type InsertAuditEventParams struct {
	ID             pgtype.UUID
	OrganizationID pgtype.UUID
	ActorUserID    pgtype.UUID
	ActorSessionID pgtype.UUID
	Action         string
	TargetType     pgtype.Text
	TargetID       pgtype.Text
	Metadata       []byte
	Ip             pgtype.Text // serialised inet via host(), see postgres_v10.go
	UserAgent      pgtype.Text
	CreatedAt      pgtype.Timestamptz
}

type InsertGroupMemberParams

type InsertGroupMemberParams struct {
	GroupID pgtype.UUID
	UserID  pgtype.UUID
}

type InsertGroupParams

type InsertGroupParams struct {
	ID             pgtype.UUID
	OrganizationID pgtype.UUID
	DisplayName    string
	ExternalID     *string
	CreatedAt      pgtype.Timestamptz
}

type InsertOrganizationParams

type InsertOrganizationParams struct {
	ID        pgtype.UUID
	Name      string
	Slug      string
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
}

type InsertPermissionParams

type InsertPermissionParams struct {
	ID          pgtype.UUID
	Name        string
	Description string
	CreatedAt   pgtype.Timestamptz
}

type InsertRecoveryCodeParams

type InsertRecoveryCodeParams struct {
	ID        pgtype.UUID
	UserID    pgtype.UUID
	CodeHash  []byte
	CreatedAt pgtype.Timestamptz
}

type InsertRoleParams

type InsertRoleParams struct {
	ID             pgtype.UUID
	OrganizationID pgtype.UUID
	Name           string
	Description    string
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
}

type InsertRolePermissionParams

type InsertRolePermissionParams struct {
	RoleID       pgtype.UUID
	PermissionID pgtype.UUID
}

type InsertSAMLConnectionParams

type InsertSAMLConnectionParams struct {
	ID             pgtype.UUID
	OrganizationID pgtype.UUID
	IdpEntityID    string
	IdpSsoUrl      string
	IdpX509Cert    string
	SpEntityID     string
	SpAcsUrl       string
	AttributeMap   []byte
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
}

type InsertSCIMTokenParams

type InsertSCIMTokenParams struct {
	ID             pgtype.UUID
	OrganizationID pgtype.UUID
	TokenHash      []byte
	Name           string
	CreatedAt      pgtype.Timestamptz
}

type InsertWebAuthnCredentialParams

type InsertWebAuthnCredentialParams struct {
	ID             pgtype.UUID
	UserID         pgtype.UUID
	CredentialID   []byte
	PublicKey      []byte
	SignCount      int64
	Transports     []string
	Aaguid         []byte
	Name           string
	CreatedAt      pgtype.Timestamptz
	LastUsedAt     pgtype.Timestamptz
	BackupEligible pgtype.Bool
	BackupState    pgtype.Bool
}

type ListGroupsByOrganizationParams

type ListGroupsByOrganizationParams struct {
	OrganizationID pgtype.UUID
	DisplayName    string
	ExternalID     string
	OffsetN        int32
	LimitN         int32
}

type ListUsersByOrganizationParams

type ListUsersByOrganizationParams struct {
	OrganizationID pgtype.UUID
	UserName       string
	ExternalID     string
	Email          string
	OffsetN        int32
	LimitN         int32
}
type MagicLink struct {
	ID        pgtype.UUID
	Email     string
	TokenHash []byte
	ExpiresAt pgtype.Timestamptz
	UsedAt    pgtype.Timestamptz
	CreatedAt pgtype.Timestamptz
}

type OAuthAccountByProviderUserIDParams

type OAuthAccountByProviderUserIDParams struct {
	Provider       string
	ProviderUserID string
}

type OauthAccount

type OauthAccount struct {
	ID              pgtype.UUID
	UserID          pgtype.UUID
	Provider        string
	ProviderUserID  string
	AccessTokenEnc  []byte
	RefreshTokenEnc []byte
	ExpiresAt       pgtype.Timestamptz
	Scope           string
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
}

type Organization

type Organization struct {
	ID        pgtype.UUID
	Name      string
	Slug      string
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
}

type OrganizationMember

type OrganizationMember struct {
	OrganizationID pgtype.UUID
	UserID         pgtype.UUID
	Role           string
	JoinedAt       pgtype.Timestamptz
}

type OrganizationMemberRoleParams

type OrganizationMemberRoleParams struct {
	OrganizationID pgtype.UUID
	UserID         pgtype.UUID
}

type PasswordResetToken

type PasswordResetToken struct {
	ID        pgtype.UUID
	UserID    pgtype.UUID
	TokenHash []byte
	ExpiresAt pgtype.Timestamptz
	UsedAt    pgtype.Timestamptz
	CreatedAt pgtype.Timestamptz
}

type Permission

type Permission struct {
	ID          pgtype.UUID
	Name        string
	Description string
	CreatedAt   pgtype.Timestamptz
}

type PermissionsForUserInOrgParams

type PermissionsForUserInOrgParams struct {
	UserID         pgtype.UUID
	OrganizationID pgtype.UUID
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ConfirmTOTPSecret

func (q *Queries) ConfirmTOTPSecret(ctx context.Context, arg ConfirmTOTPSecretParams) (int64, error)
func (q *Queries) ConsumeMagicLink(ctx context.Context, tokenHash []byte) (MagicLink, error)

func (*Queries) ConsumePasswordResetToken

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

func (*Queries) ConsumeRecoveryCodeByID

func (q *Queries) ConsumeRecoveryCodeByID(ctx context.Context, arg ConsumeRecoveryCodeByIDParams) (int64, error)

func (*Queries) CountGroupsByOrganization

func (q *Queries) CountGroupsByOrganization(ctx context.Context, arg CountGroupsByOrganizationParams) (int64, error)

func (*Queries) CountUsersByOrganization

func (q *Queries) CountUsersByOrganization(ctx context.Context, arg CountUsersByOrganizationParams) (int64, error)

func (*Queries) CountUsersWithPermissionInOrg

func (q *Queries) CountUsersWithPermissionInOrg(ctx context.Context, arg CountUsersWithPermissionInOrgParams) (int64, error)
func (q *Queries) CreateMagicLink(ctx context.Context, arg CreateMagicLinkParams) error

func (*Queries) CreatePasswordResetToken

func (q *Queries) CreatePasswordResetToken(ctx context.Context, arg CreatePasswordResetTokenParams) error

func (*Queries) CreateSession

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

func (*Queries) CreateSessionWithAuthLevel

func (q *Queries) CreateSessionWithAuthLevel(ctx context.Context, arg CreateSessionWithAuthLevelParams) (Session, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) DeleteAllGroupMembers

func (q *Queries) DeleteAllGroupMembers(ctx context.Context, groupID pgtype.UUID) error

func (*Queries) DeleteGroup

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

func (*Queries) DeleteGroupMember

func (q *Queries) DeleteGroupMember(ctx context.Context, arg DeleteGroupMemberParams) error

func (*Queries) DeleteOrganization

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

func (*Queries) DeleteOrganizationMember

func (q *Queries) DeleteOrganizationMember(ctx context.Context, arg DeleteOrganizationMemberParams) (int64, error)

func (*Queries) DeleteRecoveryCodesByUserID

func (q *Queries) DeleteRecoveryCodesByUserID(ctx context.Context, userID pgtype.UUID) error

func (*Queries) DeleteRolePermissions

func (q *Queries) DeleteRolePermissions(ctx context.Context, roleID pgtype.UUID) error

func (*Queries) DeleteRoleRow

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

func (*Queries) DeleteSAMLConnection

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

func (*Queries) DeleteTOTPSecret

func (q *Queries) DeleteTOTPSecret(ctx context.Context, userID pgtype.UUID) error

func (*Queries) DeleteWebAuthnCredential

func (q *Queries) DeleteWebAuthnCredential(ctx context.Context, arg DeleteWebAuthnCredentialParams) (int64, error)

func (*Queries) GrantUserRole

func (q *Queries) GrantUserRole(ctx context.Context, arg GrantUserRoleParams) error

func (*Queries) GroupByExternalIDInOrg

func (q *Queries) GroupByExternalIDInOrg(ctx context.Context, arg GroupByExternalIDInOrgParams) (Group, error)

func (*Queries) GroupByID

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

func (*Queries) GroupMembersByGroupID

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

func (*Queries) InsertAuditEvent

func (q *Queries) InsertAuditEvent(ctx context.Context, arg InsertAuditEventParams) error

func (*Queries) InsertGroup

func (q *Queries) InsertGroup(ctx context.Context, arg InsertGroupParams) (Group, error)

func (*Queries) InsertGroupMember

func (q *Queries) InsertGroupMember(ctx context.Context, arg InsertGroupMemberParams) error

func (*Queries) InsertOrganization

func (q *Queries) InsertOrganization(ctx context.Context, arg InsertOrganizationParams) (Organization, error)

func (*Queries) InsertPermission

func (q *Queries) InsertPermission(ctx context.Context, arg InsertPermissionParams) (Permission, error)

func (*Queries) InsertRecoveryCode

func (q *Queries) InsertRecoveryCode(ctx context.Context, arg InsertRecoveryCodeParams) error

func (*Queries) InsertRole

func (q *Queries) InsertRole(ctx context.Context, arg InsertRoleParams) (Role, error)

func (*Queries) InsertRolePermission

func (q *Queries) InsertRolePermission(ctx context.Context, arg InsertRolePermissionParams) error

func (*Queries) InsertSAMLConnection

func (q *Queries) InsertSAMLConnection(ctx context.Context, arg InsertSAMLConnectionParams) (SamlConnection, error)

func (*Queries) InsertSCIMToken

func (q *Queries) InsertSCIMToken(ctx context.Context, arg InsertSCIMTokenParams) (ScimToken, error)

func (*Queries) InsertWebAuthnCredential

func (q *Queries) InsertWebAuthnCredential(ctx context.Context, arg InsertWebAuthnCredentialParams) (WebauthnCredential, error)

func (*Queries) ListGroupsByOrganization

func (q *Queries) ListGroupsByOrganization(ctx context.Context, arg ListGroupsByOrganizationParams) ([]Group, error)

func (*Queries) ListPermissions

func (q *Queries) ListPermissions(ctx context.Context) ([]Permission, error)

func (*Queries) ListUsersByOrganization

func (q *Queries) ListUsersByOrganization(ctx context.Context, arg ListUsersByOrganizationParams) ([]User, error)

func (*Queries) MarkEmailVerified

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

func (*Queries) OAuthAccountByProviderUserID

func (q *Queries) OAuthAccountByProviderUserID(ctx context.Context, arg OAuthAccountByProviderUserIDParams) (OauthAccount, error)

func (*Queries) OrganizationByID

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

func (*Queries) OrganizationBySlug

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

func (*Queries) OrganizationMemberRole

func (q *Queries) OrganizationMemberRole(ctx context.Context, arg OrganizationMemberRoleParams) (string, error)

func (*Queries) OrganizationMembersByOrg

func (q *Queries) OrganizationMembersByOrg(ctx context.Context, organizationID pgtype.UUID) ([]OrganizationMember, error)

func (*Queries) OrganizationsByUser

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

func (*Queries) PermissionByName

func (q *Queries) PermissionByName(ctx context.Context, name string) (Permission, error)

func (*Queries) PermissionsByRoleID

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

func (*Queries) PermissionsForUserInOrg

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

func (*Queries) RecoveryCodesByUserID

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

func (*Queries) RevokeSCIMTokenByID

func (q *Queries) RevokeSCIMTokenByID(ctx context.Context, arg RevokeSCIMTokenByIDParams) (int64, error)

func (*Queries) RevokeSession

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

func (*Queries) RevokeUserRole

func (q *Queries) RevokeUserRole(ctx context.Context, arg RevokeUserRoleParams) (int64, error)

func (*Queries) RevokeUserSessions

func (q *Queries) RevokeUserSessions(ctx context.Context, userID pgtype.UUID) error

func (*Queries) RoleByID

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

func (*Queries) RoleByOrgAndName

func (q *Queries) RoleByOrgAndName(ctx context.Context, arg RoleByOrgAndNameParams) (Role, error)

func (*Queries) RolesByOrganization

func (q *Queries) RolesByOrganization(ctx context.Context, organizationID pgtype.UUID) ([]Role, error)

func (*Queries) RolesForUser

func (q *Queries) RolesForUser(ctx context.Context, arg RolesForUserParams) ([]Role, error)

func (*Queries) SAMLConnectionByID

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

func (*Queries) SAMLConnectionsByOrg

func (q *Queries) SAMLConnectionsByOrg(ctx context.Context, organizationID pgtype.UUID) ([]SamlConnection, error)

func (*Queries) SAMLIdentityByConnectionAndNameID

func (q *Queries) SAMLIdentityByConnectionAndNameID(ctx context.Context, arg SAMLIdentityByConnectionAndNameIDParams) (SamlIdentity, error)

func (*Queries) SCIMTokenByHash

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

func (*Queries) SCIMTokensByOrg

func (q *Queries) SCIMTokensByOrg(ctx context.Context, organizationID pgtype.UUID) ([]ScimToken, error)

func (*Queries) SessionByID

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

func (*Queries) SessionByTokenHash

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

func (*Queries) SetSessionActiveOrganization

func (q *Queries) SetSessionActiveOrganization(ctx context.Context, arg SetSessionActiveOrganizationParams) (int64, error)

func (*Queries) SetUserPassword

func (q *Queries) SetUserPassword(ctx context.Context, arg SetUserPasswordParams) error

func (*Queries) TOTPSecretByUserID

func (q *Queries) TOTPSecretByUserID(ctx context.Context, userID pgtype.UUID) (TotpSecret, error)

func (*Queries) TouchSAMLIdentityLastLogin

func (q *Queries) TouchSAMLIdentityLastLogin(ctx context.Context, arg TouchSAMLIdentityLastLoginParams) error

func (*Queries) TouchSCIMTokenLastUsed

func (q *Queries) TouchSCIMTokenLastUsed(ctx context.Context, arg TouchSCIMTokenLastUsedParams) error

func (*Queries) UpdateGroup

func (q *Queries) UpdateGroup(ctx context.Context, arg UpdateGroupParams) (int64, error)

func (*Queries) UpdateOrganization

func (q *Queries) UpdateOrganization(ctx context.Context, arg UpdateOrganizationParams) (int64, error)

func (*Queries) UpdateRoleRow

func (q *Queries) UpdateRoleRow(ctx context.Context, arg UpdateRoleRowParams) (Role, error)

func (*Queries) UpdateSAMLConnection

func (q *Queries) UpdateSAMLConnection(ctx context.Context, arg UpdateSAMLConnectionParams) (int64, error)

func (*Queries) UpdateSessionAuthLevel

func (q *Queries) UpdateSessionAuthLevel(ctx context.Context, arg UpdateSessionAuthLevelParams) error

func (*Queries) UpdateUserSCIM

func (q *Queries) UpdateUserSCIM(ctx context.Context, arg UpdateUserSCIMParams) (int64, error)

func (*Queries) UpdateWebAuthnBackupFlags

func (q *Queries) UpdateWebAuthnBackupFlags(ctx context.Context, arg UpdateWebAuthnBackupFlagsParams) (int64, error)

func (*Queries) UpdateWebAuthnSignCount

func (q *Queries) UpdateWebAuthnSignCount(ctx context.Context, arg UpdateWebAuthnSignCountParams) (int64, error)

func (*Queries) UpsertOAuthAccount

func (q *Queries) UpsertOAuthAccount(ctx context.Context, arg UpsertOAuthAccountParams) (OauthAccount, error)

func (*Queries) UpsertOrganizationMember

func (q *Queries) UpsertOrganizationMember(ctx context.Context, arg UpsertOrganizationMemberParams) error

func (*Queries) UpsertPendingTOTPSecret

func (q *Queries) UpsertPendingTOTPSecret(ctx context.Context, arg UpsertPendingTOTPSecretParams) error

func (*Queries) UpsertSAMLIdentity

func (q *Queries) UpsertSAMLIdentity(ctx context.Context, arg UpsertSAMLIdentityParams) (SamlIdentity, error)

func (*Queries) UserByEmail

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

func (*Queries) UserByEmailWithPassword

func (q *Queries) UserByEmailWithPassword(ctx context.Context, email string) (UserByEmailWithPasswordRow, error)

func (*Queries) UserByExternalIDInOrg

func (q *Queries) UserByExternalIDInOrg(ctx context.Context, arg UserByExternalIDInOrgParams) (User, error)

func (*Queries) UserByID

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

func (*Queries) WebAuthnCredentialByCredentialID

func (q *Queries) WebAuthnCredentialByCredentialID(ctx context.Context, credentialID []byte) (WebauthnCredential, error)

func (*Queries) WebAuthnCredentialsByUserID

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

func (*Queries) WithTx

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

type RevokeSCIMTokenByIDParams

type RevokeSCIMTokenByIDParams struct {
	ID        pgtype.UUID
	RevokedAt pgtype.Timestamptz
}

type RevokeUserRoleParams

type RevokeUserRoleParams struct {
	UserID pgtype.UUID
	RoleID pgtype.UUID
}

type Role

type Role struct {
	ID             pgtype.UUID
	OrganizationID pgtype.UUID
	Name           string
	Description    string
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
}

type RoleByOrgAndNameParams

type RoleByOrgAndNameParams struct {
	Name           string
	OrganizationID pgtype.UUID
}

type RolePermission

type RolePermission struct {
	RoleID       pgtype.UUID
	PermissionID pgtype.UUID
}

type RolesForUserParams

type RolesForUserParams struct {
	UserID         pgtype.UUID
	OrganizationID pgtype.UUID
}

type SAMLIdentityByConnectionAndNameIDParams

type SAMLIdentityByConnectionAndNameIDParams struct {
	ConnectionID pgtype.UUID
	NameID       string
}

type SamlConnection

type SamlConnection struct {
	ID             pgtype.UUID
	OrganizationID pgtype.UUID
	IdpEntityID    string
	IdpSsoUrl      string
	IdpX509Cert    string
	SpEntityID     string
	SpAcsUrl       string
	AttributeMap   []byte
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
}

type SamlIdentity

type SamlIdentity struct {
	ID           pgtype.UUID
	ConnectionID pgtype.UUID
	UserID       pgtype.UUID
	NameID       string
	NameIDFormat string
	LastLoginAt  pgtype.Timestamptz
	CreatedAt    pgtype.Timestamptz
}

type ScimToken

type ScimToken struct {
	ID             pgtype.UUID
	OrganizationID pgtype.UUID
	TokenHash      []byte
	Name           string
	CreatedAt      pgtype.Timestamptz
	LastUsedAt     pgtype.Timestamptz
	RevokedAt      pgtype.Timestamptz
}

type Session

type Session struct {
	ID        pgtype.UUID
	UserID    pgtype.UUID
	TokenHash []byte
	UserAgent string
	Ip        *netip.Addr
	CreatedAt pgtype.Timestamptz
	ExpiresAt pgtype.Timestamptz
	RevokedAt pgtype.Timestamptz
	AuthLevel string
	// Nullable; queries that do not select it leave the field as pgtype.UUID{Valid:false}.
	ActiveOrganizationID pgtype.UUID
}

type SetSessionActiveOrganizationParams

type SetSessionActiveOrganizationParams struct {
	ID                   pgtype.UUID
	ActiveOrganizationID pgtype.UUID
}

type SetUserPasswordParams

type SetUserPasswordParams struct {
	ID           pgtype.UUID
	PasswordHash *string
}

type TotpRecoveryCode

type TotpRecoveryCode struct {
	ID        pgtype.UUID
	UserID    pgtype.UUID
	CodeHash  []byte
	UsedAt    pgtype.Timestamptz
	CreatedAt pgtype.Timestamptz
}

type TotpSecret

type TotpSecret struct {
	UserID      pgtype.UUID
	SecretEnc   []byte
	ConfirmedAt pgtype.Timestamptz
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
}

type TouchSAMLIdentityLastLoginParams

type TouchSAMLIdentityLastLoginParams struct {
	ID          pgtype.UUID
	LastLoginAt pgtype.Timestamptz
}

type TouchSCIMTokenLastUsedParams

type TouchSCIMTokenLastUsedParams struct {
	ID         pgtype.UUID
	LastUsedAt pgtype.Timestamptz
}

type UpdateGroupParams

type UpdateGroupParams struct {
	ID          pgtype.UUID
	DisplayName string
	ExternalID  *string
}

type UpdateOrganizationParams

type UpdateOrganizationParams struct {
	ID   pgtype.UUID
	Name string
	Slug string
}

type UpdateRoleRowParams

type UpdateRoleRowParams struct {
	ID          pgtype.UUID
	Name        string
	Description string
}

type UpdateSAMLConnectionParams

type UpdateSAMLConnectionParams struct {
	ID           pgtype.UUID
	IdpEntityID  string
	IdpSsoUrl    string
	IdpX509Cert  string
	SpEntityID   string
	SpAcsUrl     string
	AttributeMap []byte
}

type UpdateSessionAuthLevelParams

type UpdateSessionAuthLevelParams struct {
	ID        pgtype.UUID
	AuthLevel string
}

type UpdateUserSCIMParams

type UpdateUserSCIMParams struct {
	ID          pgtype.UUID
	Email       string
	Name        string
	AvatarUrl   string
	ExternalID  string
	GivenName   string
	FamilyName  string
	DisplayName string
}

type UpdateWebAuthnBackupFlagsParams

type UpdateWebAuthnBackupFlagsParams struct {
	CredentialID   []byte
	BackupEligible pgtype.Bool
	BackupState    pgtype.Bool
}

type UpdateWebAuthnSignCountParams

type UpdateWebAuthnSignCountParams struct {
	CredentialID []byte
	SignCount    int64
	LastUsedAt   pgtype.Timestamptz
}

type UpsertOAuthAccountParams

type UpsertOAuthAccountParams struct {
	ID              pgtype.UUID
	UserID          pgtype.UUID
	Provider        string
	ProviderUserID  string
	AccessTokenEnc  []byte
	RefreshTokenEnc []byte
	ExpiresAt       pgtype.Timestamptz
	Scope           string
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
}

type UpsertOrganizationMemberParams

type UpsertOrganizationMemberParams struct {
	OrganizationID pgtype.UUID
	UserID         pgtype.UUID
	Role           string
	JoinedAt       pgtype.Timestamptz
}

type UpsertPendingTOTPSecretParams

type UpsertPendingTOTPSecretParams struct {
	UserID    pgtype.UUID
	SecretEnc []byte
	CreatedAt pgtype.Timestamptz
}

type UpsertSAMLIdentityParams

type UpsertSAMLIdentityParams struct {
	ID           pgtype.UUID
	ConnectionID pgtype.UUID
	UserID       pgtype.UUID
	NameID       string
	NameIDFormat string
	CreatedAt    pgtype.Timestamptz
}

type User

type User struct {
	ID              pgtype.UUID
	Email           string
	EmailVerifiedAt pgtype.Timestamptz
	Name            string
	AvatarUrl       string
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	PasswordHash    *string
	// SCIM columns default to ” (migration 0008), so non-SCIM users read empty strings.
	ExternalID  string
	GivenName   string
	FamilyName  string
	DisplayName string
}

type UserByEmailWithPasswordRow

type UserByEmailWithPasswordRow struct {
	ID              pgtype.UUID
	Email           string
	EmailVerifiedAt pgtype.Timestamptz
	Name            string
	AvatarUrl       string
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	PasswordHash    string
}

type UserByExternalIDInOrgParams

type UserByExternalIDInOrgParams struct {
	OrganizationID pgtype.UUID
	ExternalID     string
}

type UserRole

type UserRole struct {
	UserID    pgtype.UUID
	RoleID    pgtype.UUID
	GrantedAt pgtype.Timestamptz
	GrantedBy pgtype.UUID
}

type WebauthnCredential

type WebauthnCredential struct {
	ID           pgtype.UUID
	UserID       pgtype.UUID
	CredentialID []byte
	PublicKey    []byte
	SignCount    int64
	Transports   []string
	Aaguid       []byte
	Name         string
	CreatedAt    pgtype.Timestamptz
	LastUsedAt   pgtype.Timestamptz
	// BackupEligible and BackupState were hand-added (migration 0017). Nullable columns map to
	// pgtype.Bool, where Valid=false means never recorded.
	BackupEligible pgtype.Bool
	BackupState    pgtype.Bool
}

Jump to

Keyboard shortcuts

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