Documentation
¶
Index ¶
- Constants
- func Close(db *sqlx.DB) error
- func ExecFile(db *sqlx.DB, filePath string) error
- func MigrateDown(m *migrate.Migrate) error
- func MigrateUp(dsn string) (*migrate.Migrate, error)
- func Open(path string) (*sqlx.DB, error)
- func OpenAndMigrateUp(dsn string) (*sqlx.DB, error)
- func Tx(db *sqlx.DB, ctx context.Context, fn txFn) error
- type AuthorStore
- func (s *AuthorStore) Create(a *teal.Author) (*teal.Author, error)
- func (s *AuthorStore) Delete(id int64) error
- func (s *AuthorStore) Get(id int64) (*teal.Author, error)
- func (s *AuthorStore) GetAll() ([]*teal.Author, error)
- func (s *AuthorStore) GetAllNames() ([]string, error)
- func (s *AuthorStore) GetByName(name string) (*teal.Author, error)
- func (s *AuthorStore) Update(id int64, a *teal.Author) (*teal.Author, error)
- type BookQuery
- type BookStore
- func (bs *BookStore) Create(b *teal.Book) (*teal.Book, error)
- func (bs *BookStore) Delete(id int64) error
- func (bs *BookStore) Get(id int64) (*teal.Book, error)
- func (bs *BookStore) GetAll(filters teal.BookFilters) ([]*teal.Book, int, error)
- func (bs *BookStore) GetByISBN(isbn string) (*teal.Book, error)
- func (bs *BookStore) Update(id int64, b *teal.Book) (*teal.Book, error)
- type GenreStore
- func (s *GenreStore) Create(a *teal.Genre) (*teal.Genre, error)
- func (s *GenreStore) Delete(id int64) error
- func (s *GenreStore) Get(id int64) (*teal.Genre, error)
- func (s *GenreStore) GetAll() ([]*teal.Genre, error)
- func (s *GenreStore) GetAllNames() ([]string, error)
- func (s *GenreStore) GetByName(name string) (*teal.Genre, error)
- func (s *GenreStore) Update(id int64, a *teal.Genre) (*teal.Genre, error)
- type Store
- type TagStore
- func (s *TagStore) Create(a *teal.Tag) (*teal.Tag, error)
- func (s *TagStore) Delete(id int64) error
- func (s *TagStore) Get(id int64) (*teal.Tag, error)
- func (s *TagStore) GetAll() ([]*teal.Tag, error)
- func (s *TagStore) GetAllNames() ([]string, error)
- func (s *TagStore) GetByName(name string) (*teal.Tag, error)
- func (s *TagStore) Update(id int64, a *teal.Tag) (*teal.Tag, error)
- type UserStore
Constants ¶
View Source
const ( SQLITE = "sqlite3" POSTGRES = "postgres" )
Variables ¶
This section is empty.
Functions ¶
func MigrateDown ¶
func MigrateDown(m *migrate.Migrate) error
Types ¶
type AuthorStore ¶
type AuthorStore struct {
// contains filtered or unexported fields
}
func (*AuthorStore) Delete ¶
func (s *AuthorStore) Delete(id int64) error
func (*AuthorStore) GetAllNames ¶
func (s *AuthorStore) GetAllNames() ([]string, error)
type BookQuery ¶
type BookQuery struct { *teal.Book TotalCount int `db:"total_count"` AuthorString string `db:"author_string"` GenreString teal.NullString `db:"genre_string"` TagString teal.NullString `db:"tag_string"` }
type BookStore ¶
type BookStore struct {
// contains filtered or unexported fields
}
func (*BookStore) Create ¶
Create a book entry in books, author entries in authors and establishes the necessary book author relationships
type GenreStore ¶
type GenreStore struct {
// contains filtered or unexported fields
}
func (*GenreStore) Delete ¶
func (s *GenreStore) Delete(id int64) error
func (*GenreStore) GetAllNames ¶
func (s *GenreStore) GetAllNames() ([]string, error)
type Store ¶
type Store struct { Books *BookStore Authors *AuthorStore Users *UserStore Genres *GenreStore Tags *TagStore }
type TagStore ¶
type TagStore struct {
// contains filtered or unexported fields
}
func (*TagStore) GetAllNames ¶
type UserStore ¶
type UserStore struct {
// contains filtered or unexported fields
}
func (*UserStore) GetByUsername ¶
Click to show internal directories.
Click to hide internal directories.