Documentation
¶
Index ¶
- func ConvertToBSONM(data any) (bson.M, error)
- func GetTableName(dest any) string
- func Init() (types.ORM, error)
- type CtxKey
- type Cursor
- type DBConn
- type IDModel
- type Model
- func (m *Model) All(data any) error
- func (m *Model) Asc(condition any) types.ORMModel
- func (m *Model) BulkWrite(datas any, order bool) error
- func (m *Model) CheckOID()
- func (m *Model) Count() int64
- func (m *Model) Create(data any) (id string, err error)
- func (m *Model) Cursor() (types.Cursor, error)
- func (m *Model) Delete(data ...any) error
- func (m *Model) Desc(condition any) types.ORMModel
- func (m *Model) Equal(key any, value ...any) types.ORMModel
- func (m *Model) Find() types.ORMQuery
- func (m *Model) GetCollection(dest any) string
- func (m *Model) GetContext() context.Context
- func (m *Model) GetValue(key string) (any, bool)
- func (m *Model) Gt(condition any, value ...any) types.ORMModel
- func (m *Model) Gte(condition any, value ...any) types.ORMModel
- func (m *Model) Insert(data any) error
- func (m *Model) Like(condition any, value ...any) types.ORMModel
- func (m *Model) Limit(limit int) types.ORMModel
- func (m *Model) Lt(condition any, value ...any) types.ORMModel
- func (m *Model) Lte(condition any, value ...any) types.ORMModel
- func (m *Model) Not(condition any, value ...any) types.ORMModel
- func (m *Model) Offset(offset int) types.ORMModel
- func (m *Model) One(data any) error
- func (m *Model) Or(condition any, value ...any) types.ORMModel
- func (m *Model) Page(page, limit int) types.ORMModel
- func (m *Model) Reset() types.ORMModel
- func (m *Model) ResetFilter() types.ORMModel
- func (m *Model) Save(data any, value ...any) (err error)
- func (m *Model) Session(transactionFunc func(session types.Session) error) error
- func (m *Model) SetContext(ctx context.Context) types.ORMModel
- func (m *Model) SetValue(key string, value any) types.ORMModel
- func (m *Model) TableName(table any) types.ORMModel
- func (m *Model) Update(data any, value ...any) error
- func (m *Model) Upsert(data any, value ...any) error
- func (m *Model) Where(condition any, value ...any) types.ORMModel
- func (m *Model) WhereGt(condition any, value ...any) types.ORMModel
- func (m *Model) WhereGte(condition any, value ...any) types.ORMModel
- func (m *Model) WhereIs(key string, value any) types.ORMModel
- func (m *Model) WhereLike(condition any, value ...any) types.ORMModel
- func (m *Model) WhereLt(condition any, value ...any) types.ORMModel
- func (m *Model) WhereLte(condition any, value ...any) types.ORMModel
- func (m *Model) WhereNot(condition any, value ...any) types.ORMModel
- func (m *Model) WhereOr(condition any, value ...any) types.ORMModel
- type Query
- type SessionModel
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTableName ¶ added in v0.5.9
Types ¶
type Model ¶
type Model struct {
Tx *DBConn
Data any
OpList sync.Map // key:操作模式Mode value:操作值
WhereList bson.M
Ctx context.Context //上下文
Collection string
}
func (*Model) GetContext ¶ added in v0.0.4
func (*Model) ResetFilter ¶ added in v0.5.9
func (*Model) SetContext ¶ added in v0.0.4
type SessionModel ¶ added in v0.3.7
type SessionModel struct {
*Model
// contains filtered or unexported fields
}
func (*SessionModel) Commit ¶ added in v0.3.7
func (m *SessionModel) Commit() error
func (*SessionModel) Rollback ¶ added in v0.3.7
func (m *SessionModel) Rollback() error
Click to show internal directories.
Click to hide internal directories.