Versions in this module Expand all Collapse all v1 v1.1.0 Jun 23, 2025 Changes in this version + func Errorf(s string, v ...any) + func Logf(s string, v ...any) + func SayHello(ctx context.Context, db DB, name string) (string, error) + func SetErrorLogger(logger any) + func SetLogger(logger any) + 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 AuthorBookResultsByTags(ctx context.Context, db DB, tags string) ([]*AuthorBookResult, error) + type Book struct + AuthorID int + Available time.Time + BookID int + 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 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 DB interface + ExecContext func(context.Context, string, ...any) (sql.Result, error) + QueryContext func(context.Context, string, ...any) (*sql.Rows, error) + QueryRowContext func(context.Context, string, ...any) *sql.Row + type ErrInsertFailed struct + Err error + func (err *ErrInsertFailed) Error() string + func (err *ErrInsertFailed) Unwrap() error + 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