booktest

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 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 Author

type Author struct {
	AuthorID int
	Name     string
}

type Book

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

type BookTypeType

type BookTypeType string
const (
	FICTION    BookTypeType = "FICTION"
	NONFICTION BookTypeType = "NONFICTION"
)

func (*BookTypeType) Scan

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

type BooksByTitleYearParams

type BooksByTitleYearParams struct {
	Title string
	Yr    int
}

type CreateBookParams

type CreateBookParams struct {
	AuthorID  int
	Isbn      string
	Unknown   interface{}
	Title     string
	Yr        int
	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 {
	MinPublishYear int
	AuthorID       int
}

type Queries

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

func New

func New(db DBTX) *Queries

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

func (*Queries) CreateBook

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

func (*Queries) DeleteAuthorBeforeYear

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

func (*Queries) DeleteBook

func (q *Queries) DeleteBook(ctx context.Context, book_id int) error

func (*Queries) GetAuthor

func (q *Queries) GetAuthor(ctx context.Context, author_id int) (Author, error)

func (*Queries) GetBook

func (q *Queries) GetBook(ctx context.Context, book_id int) (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
	BookTags string
	Isbn     string
	BookID   int
}

type UpdateBookParams

type UpdateBookParams struct {
	Title  string
	Tags   string
	BookID int
}

Jump to

Keyboard shortcuts

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