authors

package
v0.0.0-...-bc15ebc Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.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 Author

type Author struct {
	ID   int64       `json:"id"`
	Name string      `json:"name"`
	Bio  pgtype.Text `json:"bio"`
}

type CreateParams

type CreateParams struct {
	Name string      `json:"name"`
	Bio  pgtype.Text `json:"bio"`
}

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) Create

func (q *Queries) Create(ctx context.Context, arg CreateParams) (Author, error)

func (*Queries) Delete

func (q *Queries) Delete(ctx context.Context, id int64) error

func (*Queries) Get

func (q *Queries) Get(ctx context.Context, id int64) (Author, error)

func (*Queries) GetMany

func (q *Queries) GetMany(ctx context.Context) ([]Author, error)

func (*Queries) Update

func (q *Queries) Update(ctx context.Context, arg UpdateParams) (Author, error)

func (*Queries) WithTx

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

type UpdateParams

type UpdateParams struct {
	ID   int64       `json:"id"`
	Name string      `json:"name"`
	Bio  pgtype.Text `json:"bio"`
}

Jump to

Keyboard shortcuts

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