example

package
v0.0.0-...-91ff4c3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: BSD-3-Clause Imports: 6 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
	Biography []byte
}

type Book

type Book struct {
	BookID        int32
	AuthorID      int32
	Isbn          string
	BookType      Booktype
	Title         string
	Year          int32
	AvailableTime pgtype.Timestamptz
	Tags          []string
	Published     pgtype.Bool
	Price         pgtype.Float8
}

type Booktype

type Booktype string
const (
	BooktypeBOOKTYPEUNSPECIFIED Booktype = "BOOK_TYPE_UNSPECIFIED"
	BooktypeBOOKTYPEFICTION     Booktype = "BOOK_TYPE_FICTION"
	BooktypeBOOKTYPENONFICTION  Booktype = "BOOK_TYPE_NONFICTION"
)

func (*Booktype) Scan

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

type CreateAuthorParams

type CreateAuthorParams struct {
	AuthorID  int32
	Name      string
	Biography []byte
}

type CreateBookParams

type CreateBookParams struct {
	BookID        int32
	AuthorID      int32
	Isbn          string
	BookType      Booktype
	Title         string
	Year          int32
	AvailableTime pgtype.Timestamptz
	Tags          []string
	Published     pgtype.Bool
	Price         pgtype.Float8
}

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 NullBooktype

type NullBooktype struct {
	Booktype Booktype
	Valid    bool // Valid is true if Booktype is not NULL
}

func (*NullBooktype) Scan

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

Scan implements the Scanner interface.

func (NullBooktype) Value

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

Value implements the driver Valuer interface.

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

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

func (*Queries) DeleteAuthor

func (q *Queries) DeleteAuthor(ctx context.Context, authorID int32) 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)

Code generated by protoc-gen-sqlc. DO NOT EDIT. source:

examples/library/v1/author.proto

func (*Queries) GetBook

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

Code generated by protoc-gen-sqlc. DO NOT EDIT. source:

examples/library/v1/book.proto

func (*Queries) ListAuthor

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

func (*Queries) ListBook

func (q *Queries) ListBook(ctx context.Context) ([]Book, error)

func (*Queries) UpdateAuthor

func (q *Queries) UpdateAuthor(ctx context.Context, arg UpdateAuthorParams) (Author, error)

func (*Queries) UpdateBook

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

func (*Queries) WithTx

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

type UpdateAuthorParams

type UpdateAuthorParams struct {
	AuthorID  int32
	Name      string
	Biography []byte
}

type UpdateBookParams

type UpdateBookParams struct {
	BookID        int32
	AuthorID      int32
	Isbn          string
	BookType      Booktype
	Title         string
	Year          int32
	AvailableTime pgtype.Timestamptz
	Tags          []string
	Published     pgtype.Bool
	Price         pgtype.Float8
}

Jump to

Keyboard shortcuts

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