mysql

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PluginsMap = map[string]func(db *gorm.DB, config *store.Config){
	"tagfile":     tagfile.Register,
	"unmarshaler": unmarshaler.Register,
}
View Source
var TFORMAT = "2006-01-02T15:04:05+08:00"
View Source
var TIME_LOCATION = "Asia/Shanghai" //上海

Functions

func Distance added in v0.0.5

func Distance(point string, dist uint32) func(db *gorm.DB) *gorm.DB

func Like added in v0.0.7

func Like(column, pattern string) func(*gorm.DB) *gorm.DB

Like("field","value%")==> Where field LIKE value%

func NewMysql added in v0.0.6

func NewMysql(config *store.Config) store.Store

func Now

func Now() string

func Page

func Page(page, lmt uint32) func(db *gorm.DB) *gorm.DB

Page fenye page 分页数,lmt每页限制条数

func ParseTime

func ParseTime(format, time_str string) (time.Time, error)

func RegisterPlugins added in v0.0.5

func RegisterPlugins(db *gorm.DB, conf *store.Config, plugins []string)

func Timezome

func Timezome(tz map[string]int64, field string, format ...string) func(db *gorm.DB) *gorm.DB

Timezome time qquery tz["from"] 开始时间戳,tz["to"]截止时间戳 field 时间字段名

Types

type Mysql

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

func (*Mysql) Close

func (e *Mysql) Close()

func (*Mysql) Connect added in v0.0.6

func (e *Mysql) Connect(confs ...*store.Config)

Connect 初始化MySQLme

func (*Mysql) GetInstance

func (e *Mysql) GetInstance(conf ...*store.Config) *gorm.DB

func (*Mysql) Prefix added in v0.0.6

func (e *Mysql) Prefix(prefix ...string) string

Directories

Path Synopsis
plugins

Jump to

Keyboard shortcuts

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