Versions in this module Expand all Collapse all v1 v1.1.1 Nov 5, 2022 Changes in this version + func Errorf(s string, v ...interface{}) + func Logf(s string, v ...interface{}) + func SayHello(ctx context.Context, db DB, name string) (string, error) + func SetErrorLogger(logger interface{}) + func SetLogger(logger interface{}) + type Author struct + AuthorID int + Name string + func AuthorByAuthorID(ctx context.Context, db DB, authorID int) (*Author, error) + func AuthorsByName(ctx context.Context, db DB, name string) ([]*Author, error) + func (a *Author) Delete(ctx context.Context, db DB) error + func (a *Author) Deleted() bool + func (a *Author) Exists() bool + func (a *Author) Insert(ctx context.Context, db DB) error + func (a *Author) Save(ctx context.Context, db DB) error + func (a *Author) Update(ctx context.Context, db DB) error + func (a *Author) Upsert(ctx context.Context, db DB) error + type AuthorBookResult struct + AuthorID int + AuthorName string + BookID int + BookISBN string + BookTags string + BookTitle string + func AuthorBookResultsByTag(ctx context.Context, db DB, tag string) ([]*AuthorBookResult, error) + type Book struct + AuthorID int + Available time.Time + BookID int + BookType BookType + Description string + ISBN string + Tags string + Title string + Year int + func BookByBookID(ctx context.Context, db DB, bookID int) (*Book, error) + func BookByISBN(ctx context.Context, db DB, isbn string) (*Book, error) + func BooksByAuthorID(ctx context.Context, db DB, authorID int) ([]*Book, error) + func BooksByTitleYear(ctx context.Context, db DB, title string, year int) ([]*Book, error) + func (b *Book) Author(ctx context.Context, db DB) (*Author, error) + func (b *Book) Delete(ctx context.Context, db DB) error + func (b *Book) Deleted() bool + func (b *Book) Exists() bool + func (b *Book) Insert(ctx context.Context, db DB) error + func (b *Book) Save(ctx context.Context, db DB) error + func (b *Book) Update(ctx context.Context, db DB) error + func (b *Book) Upsert(ctx context.Context, db DB) error + type BookType uint16 + const BookTypeFiction + const BookTypeNonfiction + func (bt *BookType) Scan(v interface{}) error + func (bt *BookType) UnmarshalText(buf []byte) error + func (bt BookType) MarshalText() ([]byte, error) + func (bt BookType) String() string + func (bt BookType) Value() (driver.Value, error) + type DB interface + ExecContext func(context.Context, string, ...interface{}) (sql.Result, error) + QueryContext func(context.Context, string, ...interface{}) (*sql.Rows, error) + QueryRowContext func(context.Context, string, ...interface{}) *sql.Row + type ErrInsertFailed struct + Err error + func (err *ErrInsertFailed) Error() string + func (err *ErrInsertFailed) Unwrap() error + type ErrInvalidBookType string + func (err ErrInvalidBookType) Error() string + type ErrUpdateFailed struct + Err error + func (err *ErrUpdateFailed) Error() string + func (err *ErrUpdateFailed) Unwrap() error + type ErrUpsertFailed struct + Err error + func (err *ErrUpsertFailed) Error() string + func (err *ErrUpsertFailed) Unwrap() error + type Error string + const ErrAlreadyExists + const ErrDoesNotExist + const ErrMarkedForDeletion + func (err Error) Error() string + type NullBookType struct + BookType BookType + Valid bool + func (nbt *NullBookType) Scan(v interface{}) error + func (nbt NullBookType) Value() (driver.Value, error)