Documentation
¶
Index ¶
- func And(conds ...interface{}) *ormCondEx
- func Between(field string, i interface{}, j interface{}) *ormCond
- func BormMock(tbl, fun, caller, file, pkg string, data interface{}, ret int, err error)
- func BormMockFinish() error
- func Cond(c string, args ...interface{}) *ormCond
- func Eq(field string, i interface{}) *ormCond
- func Fields(fields ...string) *fieldsItem
- func ForceIndex(idx string) *forceIndexItem
- func GroupBy(fields ...string) *groupByItem
- func Gt(field string, i interface{}) *ormCond
- func Gte(field string, i interface{}) *ormCond
- func Having(conds ...interface{}) *havingItem
- func In(field string, args ...interface{}) *ormCond
- func Join(stmt string) *joinItem
- func Like(field string, pattern string) *ormCond
- func Limit(i ...interface{}) *limitItem
- func Lt(field string, i interface{}) *ormCond
- func Lte(field string, i interface{}) *ormCond
- func Neq(field string, i interface{}) *ormCond
- func OnDuplicateKeyUpdate(keyVals V) *onDuplicateKeyUpdateItem
- func Or(conds ...interface{}) *ormCondEx
- func OrderBy(orders ...string) *orderByItem
- func Transaction(db *sql.DB, cb func(tx *sql.Tx) error) error
- func Where(conds ...interface{}) *whereItem
- type BormDBIFace
- type BormItem
- type BormTable
- func (t *BormTable) Debug() *BormTable
- func (t *BormTable) Delete(args ...BormItem) (int, error)
- func (t *BormTable) Insert(objs interface{}, args ...BormItem) (int, error)
- func (t *BormTable) InsertIgnore(objs interface{}, args ...BormItem) (int, error)
- func (t *BormTable) Lookup(master bool, res interface{}, args ...BormItem) (int, error)
- func (t *BormTable) MasterSelect(res interface{}, args ...BormItem) (int, error)
- func (t *BormTable) NoReuse() *BormTable
- func (t *BormTable) NoSafeReuse() *BormTable
- func (t *BormTable) ReplaceInto(objs interface{}, args ...BormItem) (int, error)
- func (t *BormTable) Reuse() *BormTable
- func (t *BormTable) SafeReuse() *BormTable
- func (t *BormTable) Select(res interface{}, args ...BormItem) (int, error)
- func (t *BormTable) ToTimestamp() *BormTable
- func (t *BormTable) Update(obj interface{}, args ...BormItem) (int, error)
- func (t *BormTable) UseNameWhenTagEmpty() *BormTable
- type CallSite
- type Config
- type DataBindingItem
- type FieldInfo
- type MapFieldInfo
- type MockMatcher
- type StructFieldInfo
- type U
- type V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnDuplicateKeyUpdate ¶
func OnDuplicateKeyUpdate(keyVals V) *onDuplicateKeyUpdateItem
OnDuplicateKeyUpdate .
Types ¶
type BormDBIFace ¶
type BormDBIFace interface {
QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
}
BormDBIFace .
type BormTable ¶
type BormTable struct {
DB BormDBIFace
Name string
Cfg Config
// contains filtered or unexported fields
}
BormTable .
func TableContext ¶
func TableContext(ctx context.Context, db BormDBIFace, name string) *BormTable
TableContext creates a Table with Context, parameter order: context, db, name
func (*BormTable) InsertIgnore ¶
InsertIgnore .
func (*BormTable) MasterSelect ¶
func (*BormTable) NoReuse ¶
NoReuse disables Reuse functionality (if cache optimization is not needed)
func (*BormTable) NoSafeReuse ¶
NoSafeReuse has been merged into Reuse, kept for compatibility
func (*BormTable) ReplaceInto ¶
ReplaceInto .
func (*BormTable) UseNameWhenTagEmpty ¶
UseNameWhenTagEmpty .
type Config ¶
type Config struct {
Debug bool
Reuse bool // Enabled by default, provides 2-14x performance improvement
UseNameWhenTagEmpty bool
ToTimestamp bool
}
Config .
type DataBindingItem ¶
DataBindingItem .
type FieldInfo ¶
type FieldInfo interface {
GetName() string
GetValue(ptr unsafe.Pointer) interface{}
GetType() reflect2.Type
}
FieldInfo generic field information interface
type MapFieldInfo ¶
MapFieldInfo map field information
func (*MapFieldInfo) GetName ¶
func (f *MapFieldInfo) GetName() string
func (*MapFieldInfo) GetType ¶
func (f *MapFieldInfo) GetType() reflect2.Type
func (*MapFieldInfo) GetValue ¶
func (f *MapFieldInfo) GetValue(ptr unsafe.Pointer) interface{}
type MockMatcher ¶
type MockMatcher struct {
Tbl string
Func string
Caller string
File string
Pkg string
Data interface{}
Ret int
Err error
}
MockMatcher .
type StructFieldInfo ¶
type StructFieldInfo struct {
Field reflect2.StructField
}
StructFieldInfo struct field information
func (*StructFieldInfo) GetName ¶
func (f *StructFieldInfo) GetName() string
func (*StructFieldInfo) GetType ¶
func (f *StructFieldInfo) GetType() reflect2.Type
func (*StructFieldInfo) GetValue ¶
func (f *StructFieldInfo) GetValue(ptr unsafe.Pointer) interface{}
Click to show internal directories.
Click to hide internal directories.