sqlc

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 5 Imported by: ? modules, 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 ConfirmTOTPSecretParams added in v0.5.0

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

type ConsumeRecoveryCodeByIDParams added in v0.5.0

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

type CreateMagicLinkParams

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

type CreatePasswordResetTokenParams added in v0.2.0

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

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 DeleteWebAuthnCredentialParams added in v0.5.0

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

type InsertRecoveryCodeParams added in v0.5.0

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

type InsertWebAuthnCredentialParams added in v0.5.0

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
}
type MagicLink struct {
	ID        pgtype.UUID
	Email     string
	TokenHash []byte
	ExpiresAt pgtype.Timestamptz
	UsedAt    pgtype.Timestamptz
	CreatedAt pgtype.Timestamptz
}

type OAuthAccountByProviderUserIDParams added in v0.3.0

type OAuthAccountByProviderUserIDParams struct {
	Provider       string
	ProviderUserID string
}

type OauthAccount added in v0.3.0

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 PasswordResetToken added in v0.2.0

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

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ConfirmTOTPSecret added in v0.5.0

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

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

func (*Queries) ConsumeRecoveryCodeByID added in v0.5.0

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

func (*Queries) CreatePasswordResetToken added in v0.2.0

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

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) DeleteRecoveryCodesByUserID added in v0.5.0

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

func (*Queries) DeleteTOTPSecret added in v0.5.0

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

func (*Queries) DeleteWebAuthnCredential added in v0.5.0

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

func (*Queries) InsertRecoveryCode added in v0.5.0

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

func (*Queries) InsertWebAuthnCredential added in v0.5.0

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

func (*Queries) MarkEmailVerified

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

func (*Queries) OAuthAccountByProviderUserID added in v0.3.0

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

func (*Queries) RecoveryCodesByUserID added in v0.5.0

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

func (*Queries) RevokeSession

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

func (*Queries) RevokeUserSessions

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

func (*Queries) SessionByTokenHash

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

func (*Queries) SetUserPassword added in v0.2.0

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

func (*Queries) TOTPSecretByUserID added in v0.5.0

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

func (*Queries) UpdateSessionAuthLevel added in v0.5.0

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

func (*Queries) UpdateWebAuthnSignCount added in v0.5.0

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

func (*Queries) UpsertOAuthAccount added in v0.3.0

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

func (*Queries) UpsertPendingTOTPSecret added in v0.5.0

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

func (*Queries) UserByEmail

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

func (*Queries) UserByEmailWithPassword added in v0.2.0

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

func (*Queries) UserByID

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

func (*Queries) WebAuthnCredentialByCredentialID added in v0.5.0

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

func (*Queries) WebAuthnCredentialsByUserID added in v0.5.0

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

func (*Queries) WithTx

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

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
}

type SetUserPasswordParams added in v0.2.0

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

type TotpRecoveryCode added in v0.5.0

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

type TotpSecret added in v0.5.0

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

type UpdateSessionAuthLevelParams added in v0.5.0

type UpdateSessionAuthLevelParams struct {
	ID        pgtype.UUID
	AuthLevel string
}

type UpdateWebAuthnSignCountParams added in v0.5.0

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

type UpsertOAuthAccountParams added in v0.3.0

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 UpsertPendingTOTPSecretParams added in v0.5.0

type UpsertPendingTOTPSecretParams struct {
	UserID    pgtype.UUID
	SecretEnc []byte
	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
}

type UserByEmailWithPasswordRow added in v0.2.0

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

type WebauthnCredential added in v0.5.0

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
}

Jump to

Keyboard shortcuts

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