Documentation ¶
Index ¶
- func Open(path string) (*sqlx.DB, error)
- func Tprintf(tmpl string, data map[string]interface{}) string
- func Tx(db *sqlx.DB, txFunc func(*sqlx.Tx) (any, error)) (any, error)
- type AuthorQueryRow
- type BookQueryRow
- type BookRow
- type RowMetadata
- type Store
- func (s *Store) Close() error
- func (s *Store) CreateAuthor(a *dusk.Author) (*dusk.Author, error)
- func (s *Store) CreateBook(b *dusk.Book) (*dusk.Book, error)
- func (s *Store) CreateTag(t *dusk.Tag) (*dusk.Tag, error)
- func (s *Store) DeleteAuthor(id int64) error
- func (s *Store) DeleteBook(id int64) error
- func (s *Store) DeleteBooks(ids []int64) error
- func (s *Store) DeleteSeries(id int64) error
- func (s *Store) DeleteTag(id int64) error
- func (s *Store) GetAllAuthors(f *filters.Search) (*page.Page[dusk.Author], error)
- func (s *Store) GetAllBooks(f *filters.Book) (*page.Page[dusk.Book], error)
- func (s *Store) GetAllBooksFromAuthor(id int64, f *filters.Book) (*page.Page[dusk.Book], error)
- func (s *Store) GetAllBooksFromSeries(id int64, f *filters.Book) (*page.Page[dusk.Book], error)
- func (s *Store) GetAllBooksFromTag(id int64, f *filters.Book) (*page.Page[dusk.Book], error)
- func (s *Store) GetAllSeries() ([]*dusk.Series, error)
- func (s *Store) GetAllTags(f *filters.Search) (*page.Page[dusk.Tag], error)
- func (s *Store) GetAuthor(id int64) (*dusk.Author, error)
- func (s *Store) GetAuthorsFromBook(id int64) ([]dusk.Author, error)
- func (s *Store) GetBook(id int64) (*dusk.Book, error)
- func (s *Store) GetSeries(id int64) (*dusk.Series, error)
- func (s *Store) GetTag(id int64) (*dusk.Tag, error)
- func (s *Store) GetTagsFromBook(id int64) ([]dusk.Tag, error)
- func (s *Store) MigrateUp(filePath string) error
- func (s *Store) UpdateAuthor(id int64, a *dusk.Author) (*dusk.Author, error)
- func (s *Store) UpdateBook(id int64, b *dusk.Book) (*dusk.Book, error)
- func (s *Store) UpdateSeries(id int64, a *dusk.Series) (*dusk.Series, error)
- func (s *Store) UpdateSeriesByName(name string, a *dusk.Series) (*dusk.Series, error)
- func (s *Store) UpdateTag(id int64, a *dusk.Tag) (*dusk.Tag, error)
- type TagQueryRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthorQueryRow ¶
type AuthorQueryRow struct { *RowMetadata *dusk.Author }
type BookQueryRow ¶
type BookQueryRow struct { *RowMetadata *BookRow }
type RowMetadata ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) DeleteAuthor ¶
Authors with existing books cannot be deleted. This constraint is introduced to prevent authors from being deleted while they are still linked to existing books. This relationship is only one way as books can be deleted, regardless if their authors still exist. It should also be noted that authors with no books will be deleted automatically in DeleteBook().
func (*Store) DeleteBook ¶
func (*Store) DeleteBooks ¶
func (*Store) DeleteSeries ¶
Series with existing books CAN be deleted. Their deletion will cause the series to be unlinked from all relevant books.
func (*Store) DeleteTag ¶
Tags with existing books CAN be deleted. Their deletion will cause the tag to be unlinked from all relevant books. This relationship goes both ways. A tag that has no books will be deleted automatically.
func (*Store) GetAllAuthors ¶
func (*Store) GetAllBooks ¶
func (*Store) GetAllBooksFromAuthor ¶
func (*Store) GetAllBooksFromSeries ¶
func (*Store) GetAllBooksFromTag ¶
func (*Store) GetAllTags ¶
func (*Store) GetAuthorsFromBook ¶
func (*Store) UpdateAuthor ¶
func (*Store) UpdateSeries ¶
func (*Store) UpdateSeriesByName ¶
type TagQueryRow ¶
type TagQueryRow struct { *RowMetadata *dusk.Tag }