Documentation ¶
Index ¶
- type Dao
- type MgoDao
- func (m MgoDao[E]) All(query bson.M) ([]E, error)
- func (m MgoDao[E]) Delete(query bson.M) error
- func (m MgoDao[E]) Insert(entity *E) error
- func (m MgoDao[E]) One(query bson.M) (*E, error)
- func (m MgoDao[E]) Pager(query bson.M, sort []string, page, size int) ([]E, *models.ResultPage, error)
- func (m MgoDao[E]) Updates(id bson.ObjectId, doc E) error
- type MySQLDao
- func (receiver *MySQLDao[E]) All(entity E, opts ...QueryOption) ([]E, error)
- func (receiver *MySQLDao[E]) Create(entity *E) error
- func (m *MySQLDao[E]) Debug() *MySQLDao[E]
- func (receiver *MySQLDao[E]) Delete(entity E) error
- func (receiver *MySQLDao[E]) MultiCreate(entities []*E) error
- func (receiver *MySQLDao[E]) One(entity E) (*E, error)
- func (receiver *MySQLDao[E]) Pager(conn *gorm.DB, page, size int) ([]E, *models.ResultPage, error)
- func (receiver *MySQLDao[E]) Save(entity *E) error
- func (receiver *MySQLDao[E]) Updates(entity *E) error
- type QueryOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MgoDao ¶
MgoDao 注意使用前必须先将CollectionName赋值
type MySQLDao ¶
type MySQLDao[E schema.Tabler] struct { Tag func() string // contains filtered or unexported fields }
func (*MySQLDao[E]) All ¶
func (receiver *MySQLDao[E]) All(entity E, opts ...QueryOption) ([]E, error)
All mysql动态查询数据
func (*MySQLDao[E]) MultiCreate ¶
MultiCreate mysql动态插入多条数据
type QueryOption ¶ added in v1.19.47
Click to show internal directories.
Click to hide internal directories.