booktest

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 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 {
	AuthorID int32
	Name     string
}

type Book

type Book struct {
	BookID    int32
	AuthorID  int32
	Isbn      string
	BookType  BooksBookType
	Title     string
	Yr        int32
	Available time.Time
	Tags      string
}

type BooksBookType added in v1.6.0

type BooksBookType string
const (
	BooksBookTypeFICTION    BooksBookType = "FICTION"
	BooksBookTypeNONFICTION BooksBookType = "NONFICTION"
)

func (*BooksBookType) Scan added in v1.6.0

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

type BooksByTagsRow added in v1.5.0

type BooksByTagsRow struct {
	BookID int32
	Title  string
	Name   string
	Isbn   string
	Tags   string
}

type BooksByTitleYearParams

type BooksByTitleYearParams struct {
	Title string
	Yr    int32
}

type CreateBookParams

type CreateBookParams struct {
	AuthorID  int32
	Isbn      string
	BookType  BooksBookType
	Title     string
	Yr        int32
	Available time.Time
	Tags      string
}

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 DeleteAuthorBeforeYearParams

type DeleteAuthorBeforeYearParams struct {
	Yr       int32
	AuthorID int32
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) BooksByTags added in v1.5.0

func (q *Queries) BooksByTags(ctx context.Context, tags string) ([]BooksByTagsRow, error)

func (*Queries) BooksByTitleYear

func (q *Queries) BooksByTitleYear(ctx context.Context, arg BooksByTitleYearParams) ([]Book, error)

func (*Queries) CreateAuthor

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

func (*Queries) CreateBook

func (q *Queries) CreateBook(ctx context.Context, arg CreateBookParams) (sql.Result, error)

func (*Queries) DeleteAuthorBeforeYear

func (q *Queries) DeleteAuthorBeforeYear(ctx context.Context, arg DeleteAuthorBeforeYearParams) error

func (*Queries) DeleteBook

func (q *Queries) DeleteBook(ctx context.Context, bookID int32) error

func (*Queries) GetAuthor

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

func (*Queries) GetBook

func (q *Queries) GetBook(ctx context.Context, bookID int32) (Book, error)

func (*Queries) UpdateBook

func (q *Queries) UpdateBook(ctx context.Context, arg UpdateBookParams) error

func (*Queries) UpdateBookISBN

func (q *Queries) UpdateBookISBN(ctx context.Context, arg UpdateBookISBNParams) error

func (*Queries) WithTx

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

type UpdateBookISBNParams

type UpdateBookISBNParams struct {
	Title  string
	Tags   string
	Isbn   string
	BookID int32
}

type UpdateBookParams

type UpdateBookParams struct {
	Title  string
	Tags   string
	BookID int32
}

Jump to

Keyboard shortcuts

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