authors

package
v0.0.0-...-1448b23 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT 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
	Name string
	Bio  pgtype.Text
}

type CreateAuthorParams

type CreateAuthorParams struct {
	Name string
	Bio  pgtype.Text
}

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

func (q *Queries) CreateAuthor(ctx context.Context, arg CreateAuthorParams) (Author, error)

func (*Queries) DeleteAuthor

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

func (*Queries) GetAuthor

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

func (*Queries) ListAuthors

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

func (*Queries) WithTx

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

Jump to

Keyboard shortcuts

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