database

package
v0.0.0-...-d352032 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorStore

type AuthorStore struct {
	*sqlx.DB
}

func (*AuthorStore) AllAuthors

func (s *AuthorStore) AllAuthors() ([]types.Author, error)

func (*AuthorStore) Author

func (s *AuthorStore) Author(id uuid.UUID) (types.Author, error)

func (*AuthorStore) CreateAuthor

func (s *AuthorStore) CreateAuthor(a *types.Author) error

func (*AuthorStore) DeleteAuthor

func (s *AuthorStore) DeleteAuthor(id uuid.UUID) error

func (*AuthorStore) UpdateAuthor

func (s *AuthorStore) UpdateAuthor(a *types.Author) error

type BookStore

type BookStore struct {
	*sqlx.DB
}

func (*BookStore) Book

func (s *BookStore) Book(id uuid.UUID) (types.Book, error)

func (*BookStore) BooksByAuthor

func (s *BookStore) BooksByAuthor(authorID uuid.UUID) ([]types.Book, error)

func (*BookStore) BooksWithAuthors

func (s *BookStore) BooksWithAuthors() ([]types.BookInfo, error)

func (*BookStore) CreateBook

func (s *BookStore) CreateBook(b *types.Book) error

func (*BookStore) DeleteBook

func (s *BookStore) DeleteBook(id uuid.UUID) error

func (*BookStore) UpdateBook

func (s *BookStore) UpdateBook(b *types.Book) error

type Store

type Store struct {
	*AuthorStore
	*BookStore
}

func NewStore

func NewStore(databaseURL string) (*Store, error)

Jump to

Keyboard shortcuts

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