mysql

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	Table string
	DB    func() *gorm.DB
}

func (*Model) Count

func (m *Model) Count(where []interface{}) (count int64)

func (*Model) Delete

func (m *Model) Delete(where []interface{}) error

func (*Model) Dialector added in v1.2.0

func (m *Model) Dialector(dialect *types.MysqlDialect) gorm.Dialector

func (*Model) Find

func (m *Model) Find(dest interface{}, where []interface{}, fields, order string, offset, limit int)

func (*Model) FindOne

func (m *Model) FindOne(dest interface{}, where []interface{}, fields, order string)

func (*Model) NewMysql

func (m *Model) NewMysql(dbc *types.DBCollector, mdt *types.MysqlDialect, cfg func() *gorm.Config) (*gorm.DB, error)

func (*Model) ParseDSN added in v1.2.0

func (m *Model) ParseDSN(dialect *types.MysqlDialect) string

func (*Model) Save

func (m *Model) Save(value interface{}, updates ...interface{}) (interface{}, error)

func (*Model) SaveOrUpdate added in v1.1.6

func (m *Model) SaveOrUpdate(value interface{}, primaryKey int, updateFields string) (interface{}, error)

func (*Model) Update

func (m *Model) Update(where []interface{}, value interface{}) error

Jump to

Keyboard shortcuts

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