sqlc

package
v0.0.0-...-1db7b98 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 3 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 {
	ID           string
	Email        string
	Username     string
	PasswordHash string
	Bio          sql.NullString
	ImageUrl     sql.NullString
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetUserByEmailRow

type GetUserByEmailRow struct {
	ID           string
	Email        string
	Username     string
	Bio          sql.NullString
	PasswordHash string
	ImageUrl     sql.NullString
	UpdatedAt    time.Time
}

type GetUserByIdRow

type GetUserByIdRow struct {
	ID           string
	Email        string
	Username     string
	Bio          sql.NullString
	PasswordHash string
	ImageUrl     sql.NullString
	UpdatedAt    time.Time
}

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 string) error

func (*Queries) GetUserByEmail

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

func (*Queries) GetUserById

func (q *Queries) GetUserById(ctx context.Context, id string) (GetUserByIdRow, error)

func (*Queries) UpdateUser

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

func (*Queries) UserExists

func (q *Queries) UserExists(ctx context.Context, id string) (bool, error)

func (*Queries) WithTx

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

type UpdateUserParams

type UpdateUserParams struct {
	ID           string
	UpdatedAt    time.Time
	Email        sql.NullString
	PasswordHash sql.NullString
	Bio          sql.NullString
	ImageUrl     sql.NullString
}

type User

type User struct {
	ID           string
	Username     string
	Email        string
	PasswordHash string
	Bio          sql.NullString
	ImageUrl     sql.NullString
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

Jump to

Keyboard shortcuts

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