Versions in this module Expand all Collapse all v1 v1.0.1 Aug 15, 2024 Changes in this version + var InvalidTransactionError = errors.New("invalid transaction, it is already committed or roll backed") + func GetProject(tx *TX, options ...Option) (*model.ErdaProject, bool, error) + func Init(db *gorm.DB) + func NotSoftDeleted(db *gorm.DB) *gorm.DB + func Value(value interface{}) whereValue + type Column interface + func Col(col string) Column + type Option func(db *gorm.DB) *gorm.DB + func OrderBy(col string, order Order) Option + func Paging(size, no int) Option + func Where(format string, args ...interface{}) Option + func Wheres(m interface{}) Option + type Order string + var ASC Order = "ASC" + var DESC Order = "DESC" + type OrderColumn interface + ASC func() Option + DESC func() Option + type SetColumn interface + Set func(value interface{}) Option + type TX struct + Error error + func Begin() *TX + func Q() *TX + func (tx *TX) CommitOrRollback() + func (tx *TX) Create(i interface{}) error + func (tx *TX) CreateInBatches(i interface{}, size int) error + func (tx *TX) DB() *gorm.DB + func (tx *TX) Delete(i interface{}, options ...Option) error + func (tx *TX) Get(i interface{}, options ...Option) (bool, error) + func (tx *TX) List(i interface{}, options ...Option) (int64, error) + func (tx *TX) UpdateColumns(i interface{}, options ...Option) error + func (tx *TX) Updates(i, v interface{}, options ...Option) error + type WhereColumn interface + EqGreaterThan func(value interface{}) Option + EqLessThan func(value interface{}) Option + GreaterThan func(value interface{}) Option + In func(values ...interface{}) Option + InMap func(values map[interface{}]struct{}) Option + Is func(value interface{}) Option + LessThan func(value interface{}) Option + Like func(value interface{}) Option + type WhereValue interface + In func(cols ...string) Option