Documentation
¶
Index ¶
- func GetTableName(dest any) string
- type Cursor
- type DBConn
- type Model
- func (q *Model) All(data any) error
- func (m *Model) Asc(condition any) types.ORMModel
- func (m *Model) BulkWrite(datas any, order bool) error
- func (s *Model) Commit() error
- func (q *Model) Count() int64
- func (m *Model) Create(data any) (id string, err error)
- func (q *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) GetContext() context.Context
- 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) (err 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 (q *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 (s *Model) Rollback() error
- func (m *Model) Save(data any, value ...any) (err error)
- func (m *Model) Session(transactionFunc func(types.Session) error) error
- func (m *Model) SetContext(ctx context.Context) 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 Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Model ¶
type Model struct {
Data any
OpList *types.OrderedMap // key:操作模式Mode value:操作值
Ctx context.Context //上下文
Table string
// contains filtered or unexported fields
}
func (*Model) BulkWrite ¶ added in v0.1.9
**
operations := []BulkWriteOperation{
{
Type: "insert",
Data: &User{Name: "Alice"},
},
{
Type: "update",
Data: &User{},
Where: map[string]any{"name": "Bob"},
Values: map[string]any{"age": 30},
},
{
Type: "delete",
Data: &User{},
Where: map[string]any{"name": "Charlie"},
},
}
err := model.BulkWrite(operations, true) **
func (*Model) GetContext ¶ added in v0.0.4
func (*Model) ResetFilter ¶ added in v0.5.9
func (*Model) SetContext ¶ added in v0.0.4
Click to show internal directories.
Click to hide internal directories.