db

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Conn *sql.DB
}

Handler for pool connections

func InitialDataBase

func InitialDataBase() (*Handler, error)

InitialDataBase database connection

func (*Handler) Close

func (p *Handler) Close() error

func (*Handler) GetBookById

func (p *Handler) GetBookById(ctx context.Context, id int64) (*models.Book, error)

GetBookById return book by id

func (*Handler) GetBookByName

func (p *Handler) GetBookByName(ctx context.Context, name string) (*models.Book, error)

GetBookByName return book by name

func (*Handler) GetBooksByShelfs

func (p *Handler) GetBooksByShelfs(ctx context.Context, id int64) (*models.Shelf, error)

GetShelfsID return books by id of shelf

func (*Handler) GetPageByID

func (p *Handler) GetPageByID(ctx context.Context, id int64) (*models.Page, error)

GetPageByID return page by id

func (*Handler) GetShelves

func (p *Handler) GetShelves(ctx context.Context) (*models.Library, error)

GetShelves return all shelves

Jump to

Keyboard shortcuts

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