queries

package
v0.0.0-...-7e87c26 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 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

type BookQueries struct {
	*sqlx.DB
}

BookQueries struct for queries from Book model.

func (*BookQueries) CreateBook

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

CreateBook method for creating book by given Book object.

func (*BookQueries) DeleteBook

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

DeleteBook method for delete book by given ID.

func (*BookQueries) GetBook

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

GetBook method for getting one book by given ID.

func (*BookQueries) GetBooks

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

GetBooks method for getting all books.

func (*BookQueries) GetBooksByAuthor

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

GetBooksByAuthor method for getting all books by given author.

func (*BookQueries) UpdateBook

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

UpdateBook method for updating book by given Book object.

type CoinQueries

type CoinQueries struct {
	*sqlx.DB
}

func (*CoinQueries) CreateCoin

func (q *CoinQueries) CreateCoin(c *models.Coin) error

CreateCoin method for creating coin by given Coin object

func (*CoinQueries) DeleteCoin

func (q *CoinQueries) DeleteCoin(id uuid.UUID) error

Delete coin method for change is_deleted = 1 by given ID.

func (*CoinQueries) GetCoin

func (q *CoinQueries) GetCoin(id uuid.UUID) (models.Coin, error)

func (*CoinQueries) GetCoins

func (q *CoinQueries) GetCoins() ([]models.Coin, error)

GetCoins method for getting all coins.

func (*CoinQueries) GetCoinsByExchangeID

func (q *CoinQueries) GetCoinsByExchangeID(exchangeID uuid.UUID) ([]models.Coin, error)

func (*CoinQueries) UpdateCoin

func (q *CoinQueries) UpdateCoin(id uuid.UUID, c *models.Coin) error

type ExchangeQueries

type ExchangeQueries struct {
	*sqlx.DB
}

func (*ExchangeQueries) CreateExchange

func (q *ExchangeQueries) CreateExchange(e *models.Exchange) error

func (*ExchangeQueries) DeleteExchange

func (q *ExchangeQueries) DeleteExchange(id uuid.UUID) error

func (*ExchangeQueries) GetExchange

func (q *ExchangeQueries) GetExchange(id uuid.UUID) (models.Exchange, error)

func (*ExchangeQueries) GetExchanges

func (q *ExchangeQueries) GetExchanges() ([]models.Exchange, error)

func (*ExchangeQueries) UpdateExchange

func (q *ExchangeQueries) UpdateExchange(id uuid.UUID, e *models.Exchange) error

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

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

GetUserByEmail query for getting one User by given Email.

func (*UserQueries) GetUserByID

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