Documentation ¶
Index ¶
- func Open(path string) (*sqlx.DB, error)
- func Tx(db *sqlx.DB, txFunc func(*sqlx.Tx) (any, error)) (any, error)
- type BookQuery
- 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) DeleteTag(id int64) error
- func (s *Store) GetAllAuthors() (dusk.Authors, error)
- func (s *Store) GetAllBooks() (dusk.Books, error)
- func (s *Store) GetAllBooksFromAuthor(id int64) (dusk.Books, error)
- func (s *Store) GetAllBooksFromTag(id int64) (dusk.Books, error)
- func (s *Store) GetAllTags() (dusk.Tags, error)
- func (s *Store) GetAuthor(id int64) (*dusk.Author, error)
- func (s *Store) GetBook(id int64) (*dusk.Book, error)
- func (s *Store) GetTag(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) UpdateTag(id int64, a *dusk.Tag) (*dusk.Tag, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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) 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) GetAllBooksFromAuthor ¶
func (*Store) UpdateAuthor ¶
Click to show internal directories.
Click to hide internal directories.