sqlc

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 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 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 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 (q *Queries) CreateMagicLink(ctx context.Context, arg CreateMagicLinkParams) 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) 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) UserByEmail

func (q *Queries) UserByEmail(ctx context.Context, email string) (User, 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 User

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

Jump to

Keyboard shortcuts

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