Documentation ¶
Index ¶
- func Args(args ...interface{}) []interface{}
- func CheckSession(x interface{}) (*xorm.Session, error)
- func Count(session *xorm.Session, bean interface{}, opts ...GetOption) (int64, error)
- func Delete(session *xorm.Session, bean interface{}, opts ...DeleteOption) (int64, error)
- func Do(engine *xorm.Engine, fn func(*xorm.Session) error) error
- func Find(session *xorm.Session, bean interface{}, opts ...GetOption) error
- func FindAndCount(session *xorm.Session, bean interface{}, opts ...GetOption) (int64, error)
- func Get(session *xorm.Session, bean interface{}, opts ...GetOption) (bool, error)
- func Insert(session *xorm.Session, beans ...interface{}) (int64, error)
- func InsertMulti(session *xorm.Session, ones interface{}, opts ...InsertMultiOption) (int64, error)
- func NewEnginesFromConfig(cfg config.Config, opts ...Option) (engines map[string]transaction.Engine, err error)
- func NewEnginesFromFile(file string) (map[string]transaction.Engine, error)
- func NewXORMEngine(driver string, dsn string) (*xorm.Engine, error)
- func NewXORMEngines(cfg config.Config, opts ...Option) (engines map[string]*xorm.Engine, err error)
- func NewXORMEnginesFromFile(file string) (map[string]*xorm.Engine, error)
- func TransactionDo(engine *xorm.Engine, fn func(*xorm.Session) error) error
- func TransactionDoWithSession(s *xorm.Session, fn func(*xorm.Session) error) (err error)
- func Update(session *xorm.Session, bean interface{}, opts ...UpdateOption) (int64, error)
- type BaseRepo
- func (p *BaseRepo) Count(beans interface{}, opts ...GetOption) (int64, error)
- func (p *BaseRepo) Delete(bean interface{}, opts ...DeleteOption) (int64, error)
- func (p *BaseRepo) Find(beans interface{}, opts ...GetOption) error
- func (p *BaseRepo) FindAndCount(beans interface{}, opts ...GetOption) (int64, error)
- func (p *BaseRepo) Get(bean interface{}, opts ...GetOption) (bool, error)
- func (p *BaseRepo) Insert(beans ...interface{}) (int64, error)
- func (p *BaseRepo) InsertMulti(beans interface{}, opts ...InsertMultiOption) (int64, error)
- func (p *BaseRepo) SetSession(x interface{}) error
- func (p *BaseRepo) Update(bean interface{}, opts ...UpdateOption) (int64, error)
- type BaseRepository
- type DeleteOption
- type DeleteOptions
- type ExecRepository
- type GetOption
- func GetArgs(args ...interface{}) GetOption
- func GetCols(cols ...string) GetOption
- func GetDistinct(args ...string) GetOption
- func GetGroupBy(groupBy string) GetOption
- func GetHaving(having string) GetOption
- func GetIn(ins ...*In) GetOption
- func GetLimit(limit, offset int) GetOption
- func GetNotIn(ins ...*In) GetOption
- func GetOrderBy(order string) GetOption
- func GetWheres(wheres interface{}) GetOption
- type GetOptions
- type In
- type InsertMultiOption
- type InsertMultiOptions
- type Option
- type Options
- type UpdateOption
- type UpdateOptions
- type XEngine
- func (p *XEngine) BeginNonTransaction() (transaction.Transaction, error)
- func (p *XEngine) BeginTransaction() (transaction.Transaction, error)
- func (p *XEngine) Exec(sql string, args ...interface{}) (sql.Result, error)
- func (p *XEngine) NewSession() (interface{}, error)
- func (p *XEngine) NewXORMSession() (*xorm.Session, error)
- func (p *XEngine) TransactionDo(fn func(*xorm.Session) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSession ¶
func Delete ¶
func Delete(session *xorm.Session, bean interface{}, opts ...DeleteOption) (int64, error)
func FindAndCount ¶
func InsertMulti ¶
func InsertMulti(session *xorm.Session, ones interface{}, opts ...InsertMultiOption) (int64, error)
InsertMulti insert multi seperated slice data in a big slice with every step number default to insert the slice with no seperated.
func NewEnginesFromConfig ¶
func NewEnginesFromConfig(cfg config.Config, opts ...Option) (engines map[string]transaction.Engine, err error)
NewEnginesFromConfig initial engines from config
func NewEnginesFromFile ¶
func NewEnginesFromFile(file string) (map[string]transaction.Engine, error)
NewEnginesFromFile initial engines from file
func NewXORMEngines ¶
func NewXORMEnginesFromFile ¶
NewXORMEnginesFromFile initial xorm engine from file
func TransactionDo ¶
TransactionDo to do transaction with customer function
func TransactionDoWithSession ¶
TransactionDoWithSession to do transaction with customer function
Types ¶
type BaseRepo ¶
type BaseRepo struct {
// contains filtered or unexported fields
}
func NewBaseRepo ¶
func (*BaseRepo) Delete ¶
func (p *BaseRepo) Delete(bean interface{}, opts ...DeleteOption) (int64, error)
func (*BaseRepo) FindAndCount ¶
func (*BaseRepo) InsertMulti ¶
func (p *BaseRepo) InsertMulti(beans interface{}, opts ...InsertMultiOption) (int64, error)
func (*BaseRepo) SetSession ¶
type BaseRepository ¶
type DeleteOption ¶
type DeleteOption func(*DeleteOptions)
func DeleteArgs ¶
func DeleteArgs(args ...interface{}) DeleteOption
func DeleteIn ¶
func DeleteIn(ins ...*In) DeleteOption
func DeleteNotIn ¶
func DeleteNotIn(ins ...*In) DeleteOption
func DeleteWheres ¶
func DeleteWheres(wheres interface{}) DeleteOption
type DeleteOptions ¶
type ExecRepository ¶
type ExecRepository interface { Insert(...interface{}) (int64, error) InsertMulti(beans interface{}, opts ...InsertMultiOption) (int64, error) Update(bean interface{}, opts ...UpdateOption) (int64, error) Delete(bean interface{}, opts ...DeleteOption) (int64, error) transaction.Repo }
type GetOption ¶
type GetOption func(*GetOptions)
func GetDistinct ¶
func GetGroupBy ¶
func GetOrderBy ¶
type GetOptions ¶
type InsertMultiOption ¶
type InsertMultiOption func(*InsertMultiOptions)
func InsertMultiCheckNumber ¶
func InsertMultiCheckNumber(check ...bool) InsertMultiOption
func InsertMultiStepNumber ¶
func InsertMultiStepNumber(number int) InsertMultiOption
type InsertMultiOptions ¶
type Option ¶
type Option func(*Options)
func OptLogger ¶
func OptLogger(l logger.XormLogger) Option
type UpdateOption ¶
type UpdateOption func(*UpdateOptions)
func UpdateArgs ¶
func UpdateArgs(args ...interface{}) UpdateOption
func UpdateCols ¶
func UpdateCols(cols ...string) UpdateOption
func UpdateIn ¶
func UpdateIn(ins ...*In) UpdateOption
func UpdateNotIn ¶
func UpdateNotIn(ins ...*In) UpdateOption
func UpdateWheres ¶
func UpdateWheres(wheres interface{}) UpdateOption
type UpdateOptions ¶
type XEngine ¶
func (*XEngine) BeginNonTransaction ¶
func (p *XEngine) BeginNonTransaction() (transaction.Transaction, error)
func (*XEngine) BeginTransaction ¶
func (p *XEngine) BeginTransaction() (transaction.Transaction, error)
func (*XEngine) NewSession ¶
Click to show internal directories.
Click to hide internal directories.