sql

package
v0.11.15 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Genre

type Genre struct {
	ID        int64 `gorm:"primaryKey"`
	Name      string
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt
}

Genre is genre database model.

type SQL

type SQL struct {
	// contains filtered or unexported fields
}

SQL contains functions for genre sql database.

func New

func New(db *gorm.DB) *SQL

New to create new genre database.

func (*SQL) BatchUpdate

func (sql *SQL) BatchUpdate(ctx context.Context, data []entity.Genre) (int, error)

BatchUpdate to batch update genre.

func (*SQL) Get added in v0.10.0

func (sql *SQL) Get(ctx context.Context, data entity.GetRequest) ([]*entity.Genre, int, int, error)

Get to get list.

func (*SQL) GetByID added in v0.10.0

func (sql *SQL) GetByID(ctx context.Context, id int64) (*entity.Genre, int, error)

GetByID to get by id.

func (*SQL) GetByIDs

func (sql *SQL) GetByIDs(ctx context.Context, ids []int64) ([]*entity.Genre, int, error)

GetByIDs to get genre by ids.

func (*SQL) GetHistories added in v0.10.0

func (sql *SQL) GetHistories(ctx context.Context, data entity.GetHistoriesRequest) ([]entity.History, int, error)

GetHistories to get histories.

Jump to

Keyboard shortcuts

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