postgresql

package
v0.0.0-...-50d7d3f Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRepo

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

func NewBaseRepo

func NewBaseRepo(db *gorm.DB) *BaseRepo

func (*BaseRepo) BulkCreate

func (r *BaseRepo) BulkCreate(ctx context.Context, arr []model.Model) error

func (*BaseRepo) Create

func (r *BaseRepo) Create(ctx context.Context, m model.Model) error

func (*BaseRepo) CreateOrUpdate

func (r *BaseRepo) CreateOrUpdate(ctx context.Context, m model.Model, query interface{}, attrs ...interface{}) error

func (*BaseRepo) DeleteByID

func (r *BaseRepo) DeleteByID(ctx context.Context, m model.Model, id string) error

func (*BaseRepo) FindByID

func (r *BaseRepo) FindByID(ctx context.Context, m model.Model, id string, preloadFields ...string) error

func (*BaseRepo) FindByIDWithPreloadCondition

func (r *BaseRepo) FindByIDWithPreloadCondition(ctx context.Context, m model.Model, id string, preloadFields ...repository.PreloadField) error

func (*BaseRepo) GetDB

func (r *BaseRepo) GetDB(ctx context.Context) *gorm.DB

func (*BaseRepo) Save

func (r *BaseRepo) Save(ctx context.Context, m model.Model) error

func (*BaseRepo) Search

func (r *BaseRepo) Search(ctx context.Context, val interface{}, f filter.Filter, preloadFields ...string) error

func (*BaseRepo) SearchAndCount

func (r *BaseRepo) SearchAndCount(ctx context.Context, val interface{}, f filter.Filter, preloadFields ...string) (int64, error)

func (*BaseRepo) SearchWithPreloadCondition

func (r *BaseRepo) SearchWithPreloadCondition(ctx context.Context, val interface{}, f filter.Filter, preloadFields ...repository.PreloadField) error

func (*BaseRepo) Update

func (r *BaseRepo) Update(ctx context.Context, m model.Model, attrs ...interface{}) error

func (*BaseRepo) Updates

func (r *BaseRepo) Updates(ctx context.Context, m model.Model, params interface{}) error

Jump to

Keyboard shortcuts

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