Versions in this module Expand all Collapse all v1 v1.0.0 Oct 16, 2020 Changes in this version + func Escape(input string) string + func Expr(expression string, args ...interface{}) interface + type Expression func(db *gorm.DB) *gorm.DB + func Group(query string) Expression + func Join(query string, args ...interface{}) Expression + func Model(value interface{}) Expression + func Order(value interface{}) Expression + func Page(pageNum int, perCount int) Expression + func Select(query interface{}, args ...interface{}) Expression + func Table(name string) Expression + func Where(query interface{}, args ...interface{}) Expression + type FieldName struct + DbName string + Host string + Password string + Port string + Username string + type Option func(*Repository) + func Addr(addr string) Option + func DbName(dbName string) Option + func Host(host string) Option + func LogMode(mode bool) Option + func Port(port string) Option + func Pwd(password string) Option + func UserName(userName string) Option + type Repository struct + Logger *log.ZapLogger + func New(options ...Option) *Repository + func (repo *Repository) Exist(out interface{}, where ...interface{}) (e error) + func (repo *Repository) Insert(val interface{}) (e error) + func (repo *Repository) Migrate(initial func(*Repository), values ...interface{}) + func (repo *Repository) Modify(val interface{}) (e error) + func (repo *Repository) ModifyColumn(val interface{}, attr string, upValue interface{}, where ...interface{}) (affects int64, e error) + func (repo *Repository) ModifyColumns(val interface{}, columns interface{}, where ...interface{}) (affects int64, e error) + func (repo *Repository) ModifyFunc(val interface{}, modifier func(interface{}), where ...interface{}) (e error) + func (repo *Repository) Print(args ...interface{}) + func (repo *Repository) Query(out interface{}, count bool, exps ...Expression) (c int, e error) + func (repo *Repository) Read(out interface{}, where ...interface{}) (e error) + func (repo *Repository) ReadAll(out interface{}, where ...interface{}) (e error) + func (repo *Repository) ReadAllWithOrderBy(out interface{}, orderby interface{}, where ...interface{}) (e error) + func (repo *Repository) ReadWithOrderBy(out interface{}, orderby interface{}, where ...interface{}) (e error) + func (repo *Repository) Remove(val interface{}, where ...interface{}) (e error) + func (repo *Repository) RemoveWithAffect(val interface{}, where ...interface{}) (affects int64, e error) + func (repo *Repository) SoftRemove(value interface{}, where ...interface{}) (e error) + func (repo *Repository) Transaction(f func(*Repository) error) (e error)