batch

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 8 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 {
	AuthorID  int32        `json:"author_id"`
	Name      string       `json:"name"`
	Biography pgtype.JSONB `json:"biography"`
}

type Book

type Book struct {
	BookID    int32     `json:"book_id"`
	AuthorID  int32     `json:"author_id"`
	Isbn      string    `json:"isbn"`
	BookType  BookType  `json:"book_type"`
	Title     string    `json:"title"`
	Year      int32     `json:"year"`
	Available time.Time `json:"available"`
	Tags      []string  `json:"tags"`
}

type BookType

type BookType string
const (
	BookTypeFICTION    BookType = "FICTION"
	BookTypeNONFICTION BookType = "NONFICTION"
)

func (*BookType) Scan

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

type BooksByYearBatchResults

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

func (*BooksByYearBatchResults) Close

func (b *BooksByYearBatchResults) Close() error

func (*BooksByYearBatchResults) Query

func (b *BooksByYearBatchResults) Query(f func(int, []Book, error))

type CreateBookBatchResults

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

func (*CreateBookBatchResults) Close

func (b *CreateBookBatchResults) Close() error

func (*CreateBookBatchResults) QueryRow

func (b *CreateBookBatchResults) QueryRow(f func(int, Book, error))

type CreateBookParams

type CreateBookParams struct {
	AuthorID  int32     `json:"author_id"`
	Isbn      string    `json:"isbn"`
	BookType  BookType  `json:"book_type"`
	Title     string    `json:"title"`
	Year      int32     `json:"year"`
	Available time.Time `json:"available"`
	Tags      []string  `json:"tags"`
}

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
	SendBatch(context.Context, *pgx.Batch) pgx.BatchResults
}

type DeleteBookBatchResults

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

func (*DeleteBookBatchResults) Close

func (b *DeleteBookBatchResults) Close() error

func (*DeleteBookBatchResults) Exec

func (b *DeleteBookBatchResults) Exec(f func(int, error))

type DeleteBookNamedFuncBatchResults added in v1.16.0

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

func (*DeleteBookNamedFuncBatchResults) Close added in v1.16.0

func (*DeleteBookNamedFuncBatchResults) Exec added in v1.16.0

func (b *DeleteBookNamedFuncBatchResults) Exec(f func(int, error))

type DeleteBookNamedSignBatchResults added in v1.16.0

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

func (*DeleteBookNamedSignBatchResults) Close added in v1.16.0

func (*DeleteBookNamedSignBatchResults) Exec added in v1.16.0

func (b *DeleteBookNamedSignBatchResults) Exec(f func(int, error))

type GetBiographyBatchResults added in v1.16.0

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

func (*GetBiographyBatchResults) Close added in v1.16.0

func (b *GetBiographyBatchResults) Close() error

func (*GetBiographyBatchResults) QueryRow added in v1.16.0

func (b *GetBiographyBatchResults) QueryRow(f func(int, pgtype.JSONB, error))

type NullBookType added in v1.15.0

type NullBookType struct {
	BookType BookType
	Valid    bool // Valid is true if BookType is not NULL
}

func (*NullBookType) Scan added in v1.15.0

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

Scan implements the Scanner interface.

func (NullBookType) Value added in v1.15.0

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

Value implements the driver Valuer interface.

type Querier

type Querier interface {
	BooksByYear(ctx context.Context, year []int32) *BooksByYearBatchResults
	CreateAuthor(ctx context.Context, name string) (Author, error)
	CreateBook(ctx context.Context, arg []CreateBookParams) *CreateBookBatchResults
	DeleteBook(ctx context.Context, bookID []int32) *DeleteBookBatchResults
	DeleteBookExecResult(ctx context.Context, bookID int32) (pgconn.CommandTag, error)
	DeleteBookNamedFunc(ctx context.Context, bookID []int32) *DeleteBookNamedFuncBatchResults
	DeleteBookNamedSign(ctx context.Context, bookID []int32) *DeleteBookNamedSignBatchResults
	GetAuthor(ctx context.Context, authorID int32) (Author, error)
	GetBiography(ctx context.Context, authorID []int32) *GetBiographyBatchResults
	UpdateBook(ctx context.Context, arg []UpdateBookParams) *UpdateBookBatchResults
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) BooksByYear

func (q *Queries) BooksByYear(ctx context.Context, year []int32) *BooksByYearBatchResults

func (*Queries) CreateAuthor

func (q *Queries) CreateAuthor(ctx context.Context, name string) (Author, error)

func (*Queries) CreateBook

func (q *Queries) CreateBook(ctx context.Context, arg []CreateBookParams) *CreateBookBatchResults

func (*Queries) DeleteBook

func (q *Queries) DeleteBook(ctx context.Context, bookID []int32) *DeleteBookBatchResults

func (*Queries) DeleteBookExecResult added in v1.16.0

func (q *Queries) DeleteBookExecResult(ctx context.Context, bookID int32) (pgconn.CommandTag, error)

func (*Queries) DeleteBookNamedFunc added in v1.16.0

func (q *Queries) DeleteBookNamedFunc(ctx context.Context, bookID []int32) *DeleteBookNamedFuncBatchResults

func (*Queries) DeleteBookNamedSign added in v1.16.0

func (q *Queries) DeleteBookNamedSign(ctx context.Context, bookID []int32) *DeleteBookNamedSignBatchResults

func (*Queries) GetAuthor

func (q *Queries) GetAuthor(ctx context.Context, authorID int32) (Author, error)

func (*Queries) GetBiography added in v1.16.0

func (q *Queries) GetBiography(ctx context.Context, authorID []int32) *GetBiographyBatchResults

func (*Queries) UpdateBook

func (q *Queries) UpdateBook(ctx context.Context, arg []UpdateBookParams) *UpdateBookBatchResults

func (*Queries) WithTx

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

type UpdateBookBatchResults

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

func (*UpdateBookBatchResults) Close

func (b *UpdateBookBatchResults) Close() error

func (*UpdateBookBatchResults) Exec

func (b *UpdateBookBatchResults) Exec(f func(int, error))

type UpdateBookParams

type UpdateBookParams struct {
	Title  string   `json:"title"`
	Tags   []string `json:"tags"`
	BookID int32    `json:"book_id"`
}

Jump to

Keyboard shortcuts

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