db

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagName              = "json"
	SearchWordColumnName = "search_word"
)

Variables

This section is empty.

Functions

func GetFieldName

func GetFieldName(field *structs.Field) string

Types

type Chain

type Chain struct {
	*gorm.DB
}

func GetChain

func GetChain(tx *gorm.DB) *Chain

func (*Chain) AddQueryOrderDir

func (c *Chain) AddQueryOrderDir(req Request, defaultColumn string) *Chain

func (*Chain) AddQueryOrderDirWithPrefix

func (c *Chain) AddQueryOrderDirWithPrefix(tableName string, req Request, defaultColumn string) *Chain

func (*Chain) BuildFilterConditions

func (c *Chain) BuildFilterConditions(req Request, tableName string, exclude ...string) *Chain

func (*Chain) BuildFilterConditionsWithPrefix

func (c *Chain) BuildFilterConditionsWithPrefix(req Request, tableName string, exclude ...string) *Chain

type MysqlConnPool

type MysqlConnPool struct {
}

* MysqlConnPool * use gorm

func GetInstance

func GetInstance() *MysqlConnPool

func (*MysqlConnPool) GetMysqlDB

func (m *MysqlConnPool) GetMysqlDB() *gorm.DB

func (*MysqlConnPool) InitDataPool

func (m *MysqlConnPool) InitDataPool() (isSucc bool)

* @fuc init connection

type Request

type Request interface {
	Reset()
	String() string
	ProtoMessage()
	Descriptor() ([]byte, []int)
}

type RequestWithReverse

type RequestWithReverse interface {
	RequestWithSortKey
	GetReverse() *wrappers.BoolValue
}

type RequestWithSortKey

type RequestWithSortKey interface {
	Request
	GetSortKey() *wrappers.StringValue
}

Jump to

Keyboard shortcuts

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