Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KeyWord ¶ added in v0.0.37
type KeyWord struct { SearchBy string PageNum string PageSize string OrderBy string PaginationOff string }
KeyWord query utils key work definition
type QueryConfig ¶
type QueryConfig struct { FilterBackend []func(db *gorm.DB) *gorm.DB PageSize int SearchByList []string FilterList []string OrderByList []string PreloadList map[string]func(db *gorm.DB) *gorm.DB RemotePreloadlist []RemotePreloader // SetFilterCustomizeFunc // run local // option 1 : func(db *gorm.DB, queryValue string) *gorm.DB // run remotely // option 2 : rpc call --> to do // func(manager interface{}, methodName string) *gorm.DB FilterCustomizeFunc map[string]interface{} IsDebug bool }
QueryConfig query config
func DefaultConfig ¶
func DefaultConfig(tCtx application.Context) *QueryConfig
DefaultConfig with system setting
type QueryDecoder ¶
type QueryDecoder interface { ConditionSQL() string ValueSQL() interface{} }
QueryDecoder query decoder
func NewDecoder ¶
func NewDecoder(queryName string, queryValue string) QueryDecoder
NewDecoder new query decoder
type QueryHandler ¶
type QueryHandler interface { RemotePreloadlist() []RemotePreloader PageSize() int PageNum() int IsPaginationOff() bool HandleDBBackend() []func(*gorm.DB) *gorm.DB HandleWithPagination(query string) []func(*gorm.DB) *gorm.DB Handle(query string) []func(*gorm.DB) *gorm.DB HandleRemotePreloader(interface{}) error }
QueryHandler query handler in query out gorm scopes
func New ¶
func New(config *QueryConfig) QueryHandler
New query handler with customize handler config
func NewWithDefaultConfig ¶
func NewWithDefaultConfig(tCtx application.Context, query string) QueryHandler
NewWithDefaultConfig query handler with default config
Click to show internal directories.
Click to hide internal directories.