sqlc

package
v0.0.0-...-9254706 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUserParams

type CreateUserParams struct {
	DisplayName string `db:"display_name" json:"display_name"`
	Username    string `db:"username" json:"username"`
	Email       string `db:"email" json:"email"`
	Password    string `db:"password" 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 Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateUser

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

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id int32) error

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id int32) (User, error)

func (*Queries) GetUserByEmail

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

func (*Queries) GetUserByUsername

func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error)

func (*Queries) GetUserDisplayName

func (q *Queries) GetUserDisplayName(ctx context.Context, id int32) (string, error)

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg *UpdateUserParams) error

func (*Queries) UpdateUserPassword

func (q *Queries) UpdateUserPassword(ctx context.Context, arg *UpdateUserPasswordParams) error

func (*Queries) WithTx

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

type UpdateUserParams

type UpdateUserParams struct {
	DisplayName string `db:"display_name" json:"display_name"`
	Username    string `db:"username" json:"username"`
	Email       string `db:"email" json:"email"`
	ID          int32  `db:"id" json:"id"`
}

type UpdateUserPasswordParams

type UpdateUserPasswordParams struct {
	Password string `db:"password" json:"password"`
	ID       int32  `db:"id" json:"id"`
}

type User

type User struct {
	ID          int32            `db:"id" json:"id"`
	DisplayName string           `db:"display_name" json:"display_name"`
	Username    string           `db:"username" json:"username"`
	Email       string           `db:"email" json:"email"`
	Password    string           `db:"password" json:"password"`
	CreatedAt   pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt   pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	DeletedAt   pgtype.Timestamp `db:"deleted_at" json:"deleted_at"`
}

Jump to

Keyboard shortcuts

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