Documentation ¶
Index ¶
- Constants
- func NewCakesRepository(db *sqlx.DB, logger grpclog.LoggerV2) repositories.CakesRepository
- type CakesRepositoryImpl
- func (s *CakesRepositoryImpl) Create(ctx context.Context, cake *models.Cakes) (*int64, error)
- func (s *CakesRepositoryImpl) Delete(ctx context.Context, id int) error
- func (r *CakesRepositoryImpl) Get(ctx context.Context, id int) (*models.Cakes, error)
- func (r *CakesRepositoryImpl) List(ctx context.Context) ([]models.Cakes, error)
- func (s *CakesRepositoryImpl) Update(ctx context.Context, cake *models.Cakes) error
Constants ¶
View Source
const CAKES_REPOSITORY_CREATE_SQL = `
INSERT INTO cakes (
title, description, rating, image
)
VALUES (
:title, :description, :rating, :image
);
`
View Source
const CAKES_REPOSITORY_DELETE_SQL = `
UPDATE cakes
SET deleted_at = NOW()
WHERE id = ?
`
View Source
const CAKES_REPOSITORY_GET_SQL = `` /* 189-byte string literal not displayed */
View Source
const CAKES_REPOSITORY_LIST_SQL = `` /* 204-byte string literal not displayed */
View Source
const CAKES_REPOSITORY_UPDATE_SQL = `` /* 165-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func NewCakesRepository ¶
func NewCakesRepository( db *sqlx.DB, logger grpclog.LoggerV2, ) repositories.CakesRepository
Types ¶
type CakesRepositoryImpl ¶
type CakesRepositoryImpl struct {
// contains filtered or unexported fields
}
func (*CakesRepositoryImpl) Delete ¶
func (s *CakesRepositoryImpl) Delete(ctx context.Context, id int) error
Click to show internal directories.
Click to hide internal directories.