gormutil

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

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

Go to latest
Published: Mar 2, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeletedByFromClaim

func DeletedByFromClaim(d *gorm.DB) (map[string]interface{}, bool)

DeletedByFromClaim for the hook after deleting record.

func Paginate

func Paginate(paging Paging) func(db *gorm.DB) *gorm.DB

Paginate page with limit and offset

func SoftDeleteClauseFromClaim

func SoftDeleteClauseFromClaim(d *gorm.DB, now time.Time) (map[string]interface{}, bool)

SoftDeleteClauseFromClaim for Bulk SoftDelete

func SoftDeleteClauseFromClaimWithDefaultTime

func SoftDeleteClauseFromClaimWithDefaultTime(d *gorm.DB) (map[string]interface{}, bool)

SoftDeleteClauseFromClaimWithDefaultTime for Bulk SoftDelete with Now

func UpdateWithClaimInfo

func UpdateWithClaimInfo(d *gorm.DB, data map[string]interface{}) map[string]interface{}

UpdateWithClaimInfo add update office_id and updated_by from context

func WithDeletedAtNull

func WithDeletedAtNull(table string) func(d *gorm.DB) *gorm.DB

WithDeletedAtNull where code = <input value>

func WithID

func WithID(id interface{}) func(d *gorm.DB) *gorm.DB

WithID where id = <input value>

func WithUserID

func WithUserID() func(d *gorm.DB) *gorm.DB

WithUserID where office_id = office_id from context

Types

type Paging

type Paging struct{ Size, Number uint64 }

Paging defines paging struct

Jump to

Keyboard shortcuts

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