sqlc

package
v0.3.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 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 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 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 (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 (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) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, 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) 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) UpsertOAuthAccount added in v0.3.0

func (q *Queries) UpsertOAuthAccount(ctx context.Context, arg UpsertOAuthAccountParams) (OauthAccount, 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) 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
}

type SetUserPasswordParams added in v0.2.0

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

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 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
}

Jump to

Keyboard shortcuts

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