queries

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookQueries added in v1.2.0

type BookQueries struct {
	*sqlx.DB
}

BookQueries struct for queries from Book model.

func (*BookQueries) CreateBook added in v1.2.0

func (q *BookQueries) CreateBook(b *models.Book) error

CreateBook method for creating book by given Book object.

func (*BookQueries) DeleteBook added in v1.2.0

func (q *BookQueries) DeleteBook(id uuid.UUID) error

DeleteBook method for delete book by given ID.

func (*BookQueries) GetBook added in v1.2.0

func (q *BookQueries) GetBook(id uuid.UUID) (models.Book, error)

GetBook method for getting one book by given ID.

func (*BookQueries) GetBooks added in v1.2.0

func (q *BookQueries) GetBooks() ([]models.Book, error)

GetBooks method for getting all books.

func (*BookQueries) GetBooksByAuthor added in v1.2.0

func (q *BookQueries) GetBooksByAuthor(author string) ([]models.Book, error)

GetBooksByAuthor method for getting all books by given author.

func (*BookQueries) UpdateBook added in v1.2.0

func (q *BookQueries) UpdateBook(id uuid.UUID, b *models.Book) error

UpdateBook method for updating book by given Book object.

type UserQueries

type UserQueries struct {
	*sqlx.DB
}

UserQueries struct for queries from User model.

func (*UserQueries) CreateUser

func (q *UserQueries) CreateUser(u *models.User) error

CreateUser query for creating a new user by given email and password hash.

func (*UserQueries) GetUserByEmail added in v1.2.0

func (q *UserQueries) GetUserByEmail(email string) (models.User, error)

GetUserByEmail query for getting one User by given Email.

func (*UserQueries) GetUserByID added in v1.2.0

func (q *UserQueries) GetUserByID(id uuid.UUID) (models.User, error)

GetUserByID query for getting one User by given ID.

Jump to

Keyboard shortcuts

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