sqlc

package
v0.0.0-...-4b578d8 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthUser

type AuthUser struct {
	ID            int64              `json:"id"`
	Email         string             `json:"email"`
	EmailVerified bool               `json:"email_verified"`
	Phone         string             `json:"phone"`
	PhoneVerified bool               `json:"phone_verified"`
	Password      string             `json:"password"`
	Role          RoleType           `json:"role"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
}

type CreateAdminUserParams

type CreateAdminUserParams struct {
	Email    string `json:"email"`
	Phone    string `json:"phone"`
	Password string `json:"password"`
}

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 NullRoleType

type NullRoleType struct {
	RoleType RoleType `json:"role_type"`
	Valid    bool     `json:"valid"` // Valid is true if RoleType is not NULL
}

func (*NullRoleType) Scan

func (ns *NullRoleType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRoleType) Value

func (ns NullRoleType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateAdminUser

func (q *Queries) CreateAdminUser(ctx context.Context, arg CreateAdminUserParams) error

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, email string) (AuthUser, error)

func (*Queries) GetUserDetails

func (q *Queries) GetUserDetails(ctx context.Context, email string) (AuthUser, error)

func (*Queries) UpdateVerification

func (q *Queries) UpdateVerification(ctx context.Context, arg UpdateVerificationParams) (int64, error)

func (*Queries) WithTx

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

type RoleType

type RoleType string
const (
	RoleTypeAdmin    RoleType = "admin"
	RoleTypeCustomer RoleType = "customer"
)

func (*RoleType) Scan

func (e *RoleType) Scan(src interface{}) error

type UpdateVerificationParams

type UpdateVerificationParams struct {
	Emailverified bool  `json:"emailverified"`
	Phoneverified bool  `json:"phoneverified"`
	Userid        int64 `json:"userid"`
}

Jump to

Keyboard shortcuts

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